2 # (C) Copyright 2004-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # See file CREDITS for list of people who contributed to this
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 include $(TOPDIR)/config.mk
26 LIB = $(obj)libcommon.o
29 ifndef CONFIG_SPL_BUILD
34 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
40 COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
41 COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
45 COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
47 COBJS-y += cmd_version.o
51 COBJS-y += env_callback.o
52 COBJS-y += env_flags.o
53 COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
54 COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
55 XCOBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
56 COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
57 XCOBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
58 COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
59 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
60 COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
61 COBJS-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
62 COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
63 COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
64 COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
65 COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
66 COBJS-$(CONFIG_ENV_IS_IN_REMOTE) += env_remote.o
67 COBJS-$(CONFIG_ENV_IS_IN_UBI) += env_ubi.o
68 COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
71 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
72 COBJS-$(CONFIG_SOURCE) += cmd_source.o
73 COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o
74 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
75 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
76 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
77 COBJS-$(CONFIG_CMD_BOOTMENU) += cmd_bootmenu.o
78 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
79 COBJS-$(CONFIG_CMD_BOOTSTAGE) += cmd_bootstage.o
80 COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
81 COBJS-$(CONFIG_CMD_CBFS) += cmd_cbfs.o
82 COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
83 COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
84 COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
85 COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
86 COBJS-$(CONFIG_CMD_SOUND) += cmd_sound.o
88 COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
91 COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
93 COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
94 COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
95 COBJS-$(CONFIG_CMD_ECHO) += cmd_echo.o
96 COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
97 COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
98 COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
99 COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o
100 COBJS-$(CONFIG_CMD_EXT4) += cmd_ext4.o
101 COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
102 COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
103 COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
104 COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
105 COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
106 COBJS-$(CONFIG_CMD_FITUPD) += cmd_fitupd.o
107 COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
109 COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
111 COBJS-$(CONFIG_CMD_FS_GENERIC) += cmd_fs.o
112 COBJS-$(CONFIG_CMD_FUSE) += cmd_fuse.o
113 COBJS-$(CONFIG_CMD_GETTIME) += cmd_gettime.o
114 COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
115 COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
116 COBJS-$(CONFIG_CMD_HASH) += cmd_hash.o
117 COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
118 COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
119 COBJS-$(CONFIG_CMD_INI) += cmd_ini.o
120 COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
121 COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
122 COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
123 COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o
124 COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o
125 COBJS-$(CONFIG_CMD_LED) += cmd_led.o
126 COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
127 COBJS-y += cmd_load.o
128 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
129 COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o
130 COBJS-$(CONFIG_CMD_MD5SUM) += cmd_md5sum.o
131 COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o
132 COBJS-$(CONFIG_CMD_IO) += cmd_io.o
133 COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
134 COBJS-$(CONFIG_MII) += miiphyutil.o
135 COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
136 COBJS-$(CONFIG_PHYLIB) += miiphyutil.o
137 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
139 COBJS-$(CONFIG_CMD_MII) += cmd_mdio.o
141 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
142 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
143 COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
144 COBJS-$(CONFIG_MP) += cmd_mp.o
145 COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
146 COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
147 COBJS-$(CONFIG_CMD_NET) += cmd_net.o
148 COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
149 COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
150 COBJS-$(CONFIG_CMD_PART) += cmd_part.o
152 COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
154 COBJS-y += cmd_pcmcia.o
155 COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
156 COBJS-$(CONFIG_CMD_PXE) += cmd_pxe.o
157 COBJS-$(CONFIG_CMD_READ) += cmd_read.o
158 COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
159 COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
160 COBJS-$(CONFIG_SANDBOX) += cmd_sandbox.o
161 COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
162 COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
163 COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
164 COBJS-$(CONFIG_CMD_SHA1SUM) += cmd_sha1sum.o
165 COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
166 COBJS-$(CONFIG_CMD_SOFTSWITCH) += cmd_softswitch.o
167 COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
168 COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
169 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
170 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
171 COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
172 COBJS-$(CONFIG_CMD_TRACE) += cmd_trace.o
173 COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
174 COBJS-$(CONFIG_CMD_TPM) += cmd_tpm.o
175 COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
176 COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
177 COBJS-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
178 COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
179 COBJS-$(CONFIG_CMD_UNZIP) += cmd_unzip.o
182 COBJS-y += usb.o usb_hub.o
183 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
185 COBJS-$(CONFIG_CMD_USB_MASS_STORAGE) += cmd_usb_mass_storage.o
186 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
187 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
188 COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
189 COBJS-$(CONFIG_CMD_ZIP) += cmd_zip.o
190 COBJS-$(CONFIG_CMD_ZFS) += cmd_zfs.o
193 COBJS-$(CONFIG_BOOTSTAGE) += bootstage.o
194 COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
196 COBJS-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
197 COBJS-$(CONFIG_I2C_EDID) += edid.o
198 COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
200 COBJS-$(CONFIG_LCD) += lcd.o
201 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
202 COBJS-$(CONFIG_MENU) += menu.o
203 COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
204 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
205 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
206 COBJS-$(CONFIG_CMD_DFU) += cmd_dfu.o
207 COBJS-$(CONFIG_CMD_GPT) += cmd_gpt.o
210 ifdef CONFIG_SPL_BUILD
211 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
212 COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o
213 COBJS-$(CONFIG_SPL_NET_SUPPORT) += miiphyutil.o
215 COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_attr.o
216 COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_flags.o
217 COBJS-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
218 ifneq ($(CONFIG_SPL_NET_SUPPORT),y)
219 COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
220 COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
221 COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
222 COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
223 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
225 COBJS-y += env_nowhere.o
229 COBJS-y += cmd_nvedit.o
231 COBJS-y += env_common.o
236 ifdef CONFIG_SPD_EEPROM
239 COBJS-$(SPD) += ddr_spd.o
240 COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
241 COBJS-$(CONFIG_BOUNCE_BUFFER) += bouncebuf.o
243 COBJS-y += dlmalloc.o
245 COBJS-$(CONFIG_OF_LIBFDT) += image-fdt.o
246 COBJS-$(CONFIG_FIT) += image-fit.o
247 COBJS-$(CONFIG_FIT_SIGNATURE) += image-sig.o
252 COBJS := $(sort $(COBJS-y))
253 XCOBJS := $(sort $(XCOBJS-y))
254 SRCS := $(COBJS:.o=.c) $(XCOBJS:.o=.c)
255 OBJS := $(addprefix $(obj),$(COBJS))
256 XOBJS := $(addprefix $(obj),$(XCOBJS))
262 $(LIB): $(obj).depend $(OBJS)
263 $(call cmd_link_o_target, $(OBJS))
265 $(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc
266 $(CC) $(AFLAGS) -Wa,--no-warn \
267 -DENV_CRC=$(shell $(obj)../tools/envcrc) \
268 -c -o $@ $(src)env_embedded.c
270 $(obj)../tools/envcrc:
273 # SEE README.arm-unaligned-accesses
274 $(obj)hush.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
275 $(obj)fdt_support.o: CFLAGS += $(PLATFORM_NO_UNALIGNED)
277 #########################################################################
279 # defines $(obj).depend target
280 include $(SRCTREE)/rules.mk
282 sinclude $(obj).depend
284 #########################################################################