Makefile 7.18 KB
Newer Older
wdenk's avatar
wdenk committed
1
#
2
# (C) Copyright 2004-2006
wdenk's avatar
wdenk committed
3 4 5 6 7 8 9 10 11 12 13 14
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
wdenk's avatar
wdenk committed
16 17 18 19 20 21 22 23 24 25
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#

include $(TOPDIR)/config.mk

26
LIB	= $(obj)libcommon.o
wdenk's avatar
wdenk committed
27

28
# core
29
ifndef CONFIG_SPL_BUILD
30
COBJS-y += main.o
31 32
COBJS-y += command.o
COBJS-y += exports.o
33
COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
34
COBJS-y += s_record.o
35
COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
36 37
COBJS-y += xyzModem.o

38
# core command
39
COBJS-y += cmd_boot.o
40
COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
41
COBJS-y += cmd_help.o
42
COBJS-y += cmd_nvedit.o
43
COBJS-y += cmd_version.o
44

45 46
# environment
COBJS-y += env_common.o
47
COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
48
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
49
XCOBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
50
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
51
XCOBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
52
COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
53
COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
Terry Lv's avatar
Terry Lv committed
54
COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
55
COBJS-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
56
COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
57
COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
58
COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
59
COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
60
COBJS-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
61
COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
62 63

# command
64
COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
65 66
COBJS-$(CONFIG_SOURCE) += cmd_source.o
COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o
67
COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
68
COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
69
COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
70
COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
71 72
COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
73
COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
74
COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
75 76 77 78 79 80 81 82 83
COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
ifdef CONFIG_4xx
COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
endif
ifdef CONFIG_POST
COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
endif
COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
84
COBJS-$(CONFIG_CMD_ECHO) += cmd_echo.o
85 86
COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
87
COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
88
COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o
89 90
COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
91
COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
92
COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
93
COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
94
COBJS-$(CONFIG_CMD_FITUPD) += cmd_fitupd.o
95 96 97 98
COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
ifdef CONFIG_FPGA
COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
endif
99
COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
100 101 102
COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
103
COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
104 105
COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
106
COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o
107
COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o
108
COBJS-$(CONFIG_CMD_LED) += cmd_led.o
109
COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
110
COBJS-y += cmd_load.o
111
COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
112
COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o
113
COBJS-$(CONFIG_CMD_MD5SUM) += cmd_md5sum.o
114
COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o
115
COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
116 117
COBJS-$(CONFIG_MII) += miiphyutil.o
COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
Andy Fleming's avatar
Andy Fleming committed
118
COBJS-$(CONFIG_PHYLIB) += miiphyutil.o
119
COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
120 121 122
ifdef CONFIG_PHYLIB
COBJS-$(CONFIG_CMD_MII) += cmd_mdio.o
endif
123 124
COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
125
COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
126
COBJS-$(CONFIG_MP) += cmd_mp.o
127
COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
128
COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
129
COBJS-$(CONFIG_CMD_NET) += cmd_net.o
130
COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
131
COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
132 133 134
ifdef CONFIG_PCI
COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
endif
135
COBJS-y += cmd_pcmcia.o
136
COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
Jason Hobbs's avatar
Jason Hobbs committed
137
COBJS-$(CONFIG_CMD_PXE) += cmd_pxe.o
138 139
COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
140
COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
141
COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
142
COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
143
COBJS-$(CONFIG_CMD_SHA1SUM) += cmd_sha1sum.o
Kumar Gala's avatar
Kumar Gala committed
144
COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
145
COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
146
COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
147
COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
148
COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
149
COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
150
COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
151
COBJS-$(CONFIG_CMD_TPM) += cmd_tpm.o
152
COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
153
COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
Stefan Roese's avatar
Stefan Roese committed
154
COBJS-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
155
COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
156
COBJS-$(CONFIG_CMD_UNZIP) += cmd_unzip.o
157 158
ifdef CONFIG_CMD_USB
COBJS-y += cmd_usb.o
159
COBJS-y += usb.o usb_hub.o
160 161
COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
endif
162
COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
163
COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
Simon Schwarz's avatar
Simon Schwarz committed
164
COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
165
COBJS-$(CONFIG_CMD_ZFS) += cmd_zfs.o
166 167

# others
168 169 170 171 172 173 174
ifdef CONFIG_DDR_SPD
SPD := y
endif
ifdef CONFIG_SPD_EEPROM
SPD := y
endif
COBJS-$(SPD) += ddr_spd.o
175
COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
176
COBJS-$(CONFIG_BOOTSTAGE) += bootstage.o
177
COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
178
COBJS-y += flash.o
179
COBJS-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
180
COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
181 182
COBJS-$(CONFIG_LCD) += lcd.o
COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
183
COBJS-$(CONFIG_MENU) += menu.o
184
COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
185
COBJS-$(CONFIG_UPDATE_TFTP) += update.o
186
COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
187 188
endif

189 190 191
ifdef CONFIG_SPL_BUILD
COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
endif
192
COBJS-y += console.o
193
COBJS-y += dlmalloc.o
194
COBJS-y += image.o
195 196
COBJS-y += memsize.o
COBJS-y += stdio.o
197

wdenk's avatar
wdenk committed
198

199
COBJS	:= $(sort $(COBJS-y))
200 201 202 203
XCOBJS	:= $(sort $(XCOBJS-y))
SRCS	:= $(COBJS:.o=.c) $(XCOBJS:.o=.c)
OBJS	:= $(addprefix $(obj),$(COBJS))
XOBJS	:= $(addprefix $(obj),$(XCOBJS))
wdenk's avatar
wdenk committed
204 205 206

CPPFLAGS += -I..

207
all:	$(LIB) $(XOBJS)
wdenk's avatar
wdenk committed
208

209
$(LIB): $(obj).depend $(OBJS)
210
	$(call cmd_link_o_target, $(OBJS))
wdenk's avatar
wdenk committed
211

212
$(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc
wdenk's avatar
wdenk committed
213
	$(CC) $(AFLAGS) -Wa,--no-warn \
214
		-DENV_CRC=$(shell $(obj)../tools/envcrc) \
215
		-c -o $@ $(src)env_embedded.c
wdenk's avatar
wdenk committed
216

217
$(obj)../tools/envcrc:
218 219
	$(MAKE) -C ../tools

wdenk's avatar
wdenk committed
220 221
#########################################################################

222 223
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
wdenk's avatar
wdenk committed
224

225
sinclude $(obj).depend
wdenk's avatar
wdenk committed
226 227

#########################################################################