blob: 1b672ad96e8b28186da88351955c5b374909b22e [file] [log] [blame]
wdenke831ad52002-10-17 21:52:26 +00001#
Marian Balakowiczf9328632006-09-01 19:49:50 +02002# (C) Copyright 2004-2006
wdenke831ad52002-10-17 21:52:26 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
5# See file CREDITS for list of people who contributed to this
6# project.
7#
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.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
wdenk232c1502004-03-12 00:14:09 +000015# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wdenke831ad52002-10-17 21:52:26 +000016# GNU General Public License for more details.
17#
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,
21# MA 02111-1307 USA
22#
23
24include $(TOPDIR)/config.mk
25
Sebastien Carlier6d8962e2010-11-05 15:48:07 +010026LIB = $(obj)libcommon.o
wdenke831ad52002-10-17 21:52:26 +000027
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020028# core
Aneesh V05bad4a2011-07-13 05:11:06 +000029ifndef CONFIG_SPL_BUILD
Grant Likelyf0037c52007-09-24 09:05:30 -060030COBJS-y += main.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020031COBJS-y += command.o
Simon Glassfe341072011-09-17 06:48:49 +000032ifndef CONFIG_SANDBOX
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020033COBJS-y += dlmalloc.o
Simon Glassfe341072011-09-17 06:48:49 +000034endif
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020035COBJS-y += exports.o
Mike Frysingere915f8b2009-02-05 21:04:36 -050036COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020037COBJS-y += image.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020038COBJS-y += s_record.o
Mike Frysingere915f8b2009-02-05 21:04:36 -050039COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020040COBJS-y += xyzModem.o
41
Jean-Christophe PLAGNIOL-VILLARDa80b21d2008-10-31 12:12:12 +010042# core command
Jean-Christophe PLAGNIOL-VILLARD2d02d912008-08-30 23:47:38 +020043COBJS-y += cmd_boot.o
Mike Frysinger52f0aa82010-12-20 18:57:09 -050044COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050045COBJS-y += cmd_help.o
Jean-Christophe PLAGNIOL-VILLARD2d02d912008-08-30 23:47:38 +020046COBJS-y += cmd_nvedit.o
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050047COBJS-y += cmd_version.o
Jean-Christophe PLAGNIOL-VILLARD2d02d912008-08-30 23:47:38 +020048
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020049# environment
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020050COBJS-y += env_common.o
Jean-Christophe PLAGNIOL-VILLARDd8cc04d2008-09-10 22:47:58 +020051COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
Jean-Christophe PLAGNIOL-VILLARDbf5a7712008-09-05 09:19:54 +020052COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
Wolfgang Denk0390e262010-11-20 15:04:02 +010053XCOBJS-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
Wolfgang Denka747a7f2009-10-27 00:03:32 +010054COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
Wolfgang Denk0390e262010-11-20 15:04:02 +010055XCOBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
Wolfgang Denka747a7f2009-10-27 00:03:32 +010056COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
Jean-Christophe PLAGNIOL-VILLARD507641d2008-09-10 22:48:04 +020057COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
unsik Kim75eb82e2009-02-25 11:31:24 +090058COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
Terry Lva8060352010-05-17 10:57:01 +080059COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
Jean-Christophe PLAGNIOL-VILLARD06f61352008-09-10 22:47:59 +020060COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
Jean-Christophe PLAGNIOL-VILLARD957a0e62008-09-10 22:47:59 +020061COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
Jean-Christophe PLAGNIOL-VILLARD55c5f492008-09-10 22:48:00 +020062COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
Jean-Christophe PLAGNIOL-VILLARD2556ef72008-09-10 22:48:00 +020063COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
Jean-Christophe PLAGNIOL-VILLARDc0878af2008-09-10 22:48:01 +020064COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020065
66# command
Daniel Hellstrom2a2fa792008-03-26 23:00:38 +010067COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
Wolfgang Denk74de7ae2009-04-01 23:34:12 +020068COBJS-$(CONFIG_SOURCE) += cmd_source.o
69COBJS-$(CONFIG_CMD_SOURCE) += cmd_source.o
Grant Likely4a437192007-09-24 09:05:31 -060070COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +020071COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
Grant Likely4a437192007-09-24 09:05:31 -060072COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
Mike Frysinger86a20fb2008-02-16 07:40:36 -050073COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
Grant Likely4a437192007-09-24 09:05:31 -060074COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
75COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
Mike Frysingercf675d32008-02-19 00:35:17 -050076COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
Jean-Christophe PLAGNIOL-VILLARDb9c0e4c2009-03-27 23:26:42 +010077COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
Grant Likely4a437192007-09-24 09:05:31 -060078COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
79ifdef CONFIG_4xx
80COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
81endif
82ifdef CONFIG_POST
83COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
84endif
85COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
Grant Likely4a437192007-09-24 09:05:31 -060086COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050087COBJS-$(CONFIG_CMD_ECHO) += cmd_echo.o
Jean-Christophe PLAGNIOL-VILLARDd1034bc2008-09-10 22:47:52 +020088COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
89COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
Grant Likely4a437192007-09-24 09:05:31 -060090COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
Peter Tyser6b8f5ad2009-10-16 17:36:25 -050091COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_exit.o
Grant Likely4a437192007-09-24 09:05:31 -060092COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
93COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
Jean-Christophe PLAGNIOL-VILLARDe5648ac2008-08-30 23:47:41 +020094COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
Kumar Gala9c9109e2007-11-26 11:19:12 -060095COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
Grant Likely4a437192007-09-24 09:05:31 -060096COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
Andreas Pretzsch7130a572011-07-16 05:51:00 +000097COBJS-$(CONFIG_CMD_FITUPD) += cmd_fitupd.o
Grant Likely4a437192007-09-24 09:05:31 -060098COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
99ifdef CONFIG_FPGA
100COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
101endif
Mike Frysingera972b8d2011-04-03 04:40:46 -0400102COBJS-$(CONFIG_CMD_GPIO) += cmd_gpio.o
Grant Likely4a437192007-09-24 09:05:31 -0600103COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
104COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
105COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
Kumar Galaffa4baf2008-08-15 08:24:33 -0500106COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
Grant Likely4a437192007-09-24 09:05:31 -0600107COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
108COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
Heiko Schocher88ffb262010-01-07 08:55:54 +0100109COBJS-$(CONFIG_CMD_CRAMFS) += cmd_cramfs.o
Mike Frysinger1ba7fd22010-12-26 12:34:49 -0500110COBJS-$(CONFIG_CMD_LDRINFO) += cmd_ldrinfo.o
Jason Kridner4421acf2011-04-20 18:11:38 -0500111COBJS-$(CONFIG_CMD_LED) += cmd_led.o
Harald Welte0a823aa2008-07-09 22:30:30 +0800112COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600113COBJS-y += cmd_load.o
Grant Likely4a437192007-09-24 09:05:31 -0600114COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
Jean-Christophe PLAGNIOL-VILLARD32628c52008-08-30 23:54:58 +0200115COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o
Mike Frysingerc3d2a172011-04-02 21:40:19 -0400116COBJS-$(CONFIG_CMD_MD5SUM) += cmd_md5sum.o
Jean-Christophe PLAGNIOL-VILLARDb64b7752008-09-10 22:48:05 +0200117COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +0200118COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
unsik Kim75eb82e2009-02-25 11:31:24 +0900119COBJS-$(CONFIG_CMD_MG_DISK) += cmd_mgdisk.o
Wolfgang Denk47ffd6c2008-09-09 15:45:18 +0200120COBJS-$(CONFIG_MII) += miiphyutil.o
121COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
Andy Fleming5f184712011-04-08 02:10:27 -0500122COBJS-$(CONFIG_PHYLIB) += miiphyutil.o
Grant Likely4a437192007-09-24 09:05:31 -0600123COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
Andy Fleming995daa02011-03-21 18:03:22 -0500124ifdef CONFIG_PHYLIB
125COBJS-$(CONFIG_CMD_MII) += cmd_mdio.o
126endif
Grant Likely4a437192007-09-24 09:05:31 -0600127COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
128COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
Thomas Choud52ebf12010-12-24 13:12:21 +0000129COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +0200130COBJS-$(CONFIG_MP) += cmd_mp.o
Stefan Roese68d7d652009-03-19 13:30:36 +0100131COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
Peter Tyser581d04f2009-10-15 10:48:18 -0500132COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
Grant Likely4a437192007-09-24 09:05:31 -0600133COBJS-$(CONFIG_CMD_NET) += cmd_net.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200134COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
Mike Frysingerd0b01a22008-02-04 19:26:57 -0500135COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
Grant Likely4a437192007-09-24 09:05:31 -0600136ifdef CONFIG_PCI
137COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
138endif
Grant Likelyf0037c52007-09-24 09:05:30 -0600139COBJS-y += cmd_pcmcia.o
Grant Likely4a437192007-09-24 09:05:31 -0600140COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
Jason Hobbs06283a62011-08-31 10:37:30 -0500141COBJS-$(CONFIG_CMD_PXE) += cmd_pxe.o
Grant Likely4a437192007-09-24 09:05:31 -0600142COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
143COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
Dave Liuc7057b52008-03-26 22:49:44 +0800144COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +0200145COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
Grant Likely4a437192007-09-24 09:05:31 -0600146COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
Mike Frysingerc3d2a172011-04-02 21:40:19 -0400147COBJS-$(CONFIG_CMD_SHA1SUM) += cmd_sha1sum.o
Kumar Galad0586982008-02-14 20:44:42 -0600148COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
Grant Likely4a437192007-09-24 09:05:31 -0600149COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
Mike Frysingerdd14af72008-11-27 16:50:32 -0500150COBJS-$(CONFIG_CMD_SPIBOOTLDR) += cmd_spibootldr.o
Mike Frysinger30942b12008-02-04 19:26:57 -0500151COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
Harald Welted16471e2007-12-19 14:14:47 +0100152COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
Che-liang Chiouca366d02011-10-06 23:40:48 +0000153COBJS-$(CONFIG_CMD_TIME) += cmd_time.o
Peter Tyser6b8f5ad2009-10-16 17:36:25 -0500154COBJS-$(CONFIG_SYS_HUSH_PARSER) += cmd_test.o
Reinhard Arlt52a0e2d2009-06-10 19:09:40 +0200155COBJS-$(CONFIG_CMD_TSI148) += cmd_tsi148.o
Kyungmin Park694a0b32008-11-19 11:47:05 +0100156COBJS-$(CONFIG_CMD_UBI) += cmd_ubi.o
Stefan Roesece6d0c82009-03-19 15:35:50 +0100157COBJS-$(CONFIG_CMD_UBIFS) += cmd_ubifs.o
Grant Likely4a437192007-09-24 09:05:31 -0600158COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
Mike Frysingerc3d2a172011-04-02 21:40:19 -0400159COBJS-$(CONFIG_CMD_UNZIP) += cmd_unzip.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200160ifdef CONFIG_CMD_USB
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +0200161COBJS-y += cmd_usb.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600162COBJS-y += usb.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200163COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
164endif
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +0200165COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
166COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
Jean-Christophe PLAGNIOL-VILLARDa80b21d2008-10-31 12:12:12 +0100167
168# others
York Sund29d17d2011-08-26 11:32:44 -0700169ifdef CONFIG_DDR_SPD
170SPD := y
171endif
172ifdef CONFIG_SPD_EEPROM
173SPD := y
174endif
175COBJS-$(SPD) += ddr_spd.o
Anton Vorontsov93f9dcf2009-06-10 00:25:27 +0400176COBJS-$(CONFIG_HWCONFIG) += hwconfig.o
Gary Jennejohn16a28ef2008-11-06 15:04:23 +0100177COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +0200178COBJS-y += flash.o
Robin Getz0c909552009-12-21 18:40:42 -0500179COBJS-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
Mike Frysingerecb1dc82009-05-20 04:35:14 -0400180COBJS-$(CONFIG_KALLSYMS) += kallsyms.o
Jean-Christophe PLAGNIOL-VILLARD578118b2008-08-29 21:53:57 +0200181COBJS-$(CONFIG_LCD) += lcd.o
182COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
Jason Hobbsb69bf522011-08-23 11:06:49 +0000183COBJS-$(CONFIG_MENU) += menu.o
Jean-Christophe PLAGNIOL-VILLARD55e0ed62009-04-25 14:57:52 +0200184COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
Bartlomiej Sieka4bae9092008-10-01 15:26:31 +0200185COBJS-$(CONFIG_UPDATE_TFTP) += update.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200186COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
Aneesh V05bad4a2011-07-13 05:11:06 +0000187endif
188
189COBJS-y += console.o
Aneesh V2d01dd92011-10-21 12:29:34 -0400190COBJS-y += dlmalloc.o
Aneesh V05bad4a2011-07-13 05:11:06 +0000191COBJS-y += memsize.o
192COBJS-y += stdio.o
Jean-Christophe PLAGNIOL-VILLARDa80b21d2008-10-31 12:12:12 +0100193
wdenke831ad52002-10-17 21:52:26 +0000194
Wolfgang Denk2c8ccf22008-09-09 16:55:47 +0200195COBJS := $(sort $(COBJS-y))
Wolfgang Denk0390e262010-11-20 15:04:02 +0100196XCOBJS := $(sort $(XCOBJS-y))
197SRCS := $(COBJS:.o=.c) $(XCOBJS:.o=.c)
198OBJS := $(addprefix $(obj),$(COBJS))
199XOBJS := $(addprefix $(obj),$(XCOBJS))
wdenke831ad52002-10-17 21:52:26 +0000200
201CPPFLAGS += -I..
202
Wolfgang Denk0390e262010-11-20 15:04:02 +0100203all: $(LIB) $(XOBJS)
wdenke831ad52002-10-17 21:52:26 +0000204
Marian Balakowiczf9328632006-09-01 19:49:50 +0200205$(LIB): $(obj).depend $(OBJS)
Sebastien Carlier6d8962e2010-11-05 15:48:07 +0100206 $(call cmd_link_o_target, $(OBJS))
wdenke831ad52002-10-17 21:52:26 +0000207
Jean-Christophe PLAGNIOL-VILLARD0cf4fd32008-09-10 22:48:01 +0200208$(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc
wdenke831ad52002-10-17 21:52:26 +0000209 $(CC) $(AFLAGS) -Wa,--no-warn \
Marian Balakowiczf9328632006-09-01 19:49:50 +0200210 -DENV_CRC=$(shell $(obj)../tools/envcrc) \
Jean-Christophe PLAGNIOL-VILLARD0cf4fd32008-09-10 22:48:01 +0200211 -c -o $@ $(src)env_embedded.c
wdenke831ad52002-10-17 21:52:26 +0000212
Marian Balakowiczf9328632006-09-01 19:49:50 +0200213$(obj)../tools/envcrc:
wdenka8c7c702003-12-06 19:49:23 +0000214 $(MAKE) -C ../tools
215
wdenke831ad52002-10-17 21:52:26 +0000216#########################################################################
217
Marian Balakowiczf9328632006-09-01 19:49:50 +0200218# defines $(obj).depend target
219include $(SRCTREE)/rules.mk
wdenke831ad52002-10-17 21:52:26 +0000220
Marian Balakowiczf9328632006-09-01 19:49:50 +0200221sinclude $(obj).depend
wdenke831ad52002-10-17 21:52:26 +0000222
223#########################################################################