blob: 944b1c08ade49d82b725f0f763d4e06bc550c6e8 [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
Marian Balakowiczf9328632006-09-01 19:49:50 +020026LIB = $(obj)libcommon.a
wdenke831ad52002-10-17 21:52:26 +000027
28AOBJS =
29
Grant Likelyf0037c52007-09-24 09:05:30 -060030COBJS-y += main.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +020031COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
Grant Likelyf0037c52007-09-24 09:05:30 -060032COBJS-y += circbuf.o
Daniel Hellstrom2a2fa792008-03-26 23:00:38 +010033COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
Grant Likelyf0037c52007-09-24 09:05:30 -060034COBJS-y += cmd_autoscript.o
Grant Likely4a437192007-09-24 09:05:31 -060035COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
36COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
37COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
Marian Balakowiczb97a2a02008-01-08 18:14:09 +010038COBJS-y += image.o
Marian Balakowicz321359f2008-01-08 18:11:43 +010039COBJS-y += gunzip.o
Grant Likelyf0037c52007-09-24 09:05:30 -060040COBJS-y += cmd_boot.o
Mike Frysinger86a20fb2008-02-16 07:40:36 -050041COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
Grant Likelyf0037c52007-09-24 09:05:30 -060042COBJS-y += cmd_bootm.o
Grant Likely4a437192007-09-24 09:05:31 -060043COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
44COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
Mike Frysingercf675d32008-02-19 00:35:17 -050045COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
Grant Likely4a437192007-09-24 09:05:31 -060046COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
47ifdef CONFIG_4xx
48COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
49endif
50ifdef CONFIG_POST
51COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
52endif
53COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
54COBJS-$(CONFIG_CMD_DOC) += cmd_doc.o
55COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
Grant Likelyf0037c52007-09-24 09:05:30 -060056COBJS-y += cmd_eeprom.o
Grant Likely4a437192007-09-24 09:05:31 -060057COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
58COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
59COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
Grant Likelyf0037c52007-09-24 09:05:30 -060060COBJS-y += cmd_fdc.o
Kumar Gala9c9109e2007-11-26 11:19:12 -060061COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
Grant Likely4a437192007-09-24 09:05:31 -060062COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
63COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
64ifdef CONFIG_FPGA
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +020065COBJS-y += fpga.o
Grant Likely4a437192007-09-24 09:05:31 -060066COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +020067COBJS-$(CONFIG_FPGA_SPARTAN2) += spartan2.o
68COBJS-$(CONFIG_FPGA_SPARTAN3) += spartan3.o
69COBJS-$(CONFIG_FPGA_VIRTEX2) += virtex2.o
70COBJS-$(CONFIG_FPGA_XILINX) += xilinx.o
71ifdef CONFIG_FPGA_ALTERA
72COBJS-y += altera.o
73COBJS-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
74COBJS-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
75COBJS-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
76endif
Grant Likely4a437192007-09-24 09:05:31 -060077endif
78COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
79COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
80COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
Kumar Galaffa4baf2008-08-15 08:24:33 -050081COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
Grant Likely4a437192007-09-24 09:05:31 -060082COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
83COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
Harald Welte0a823aa2008-07-09 22:30:30 +080084COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
Grant Likelyf0037c52007-09-24 09:05:30 -060085COBJS-y += cmd_load.o
Grant Likely4a437192007-09-24 09:05:31 -060086COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
Grant Likelyf0037c52007-09-24 09:05:30 -060087COBJS-y += cmd_mem.o
Grant Likely4a437192007-09-24 09:05:31 -060088COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
89COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
90COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
Grant Likelyf0037c52007-09-24 09:05:30 -060091COBJS-y += cmd_nand.o
Grant Likely4a437192007-09-24 09:05:31 -060092COBJS-$(CONFIG_CMD_NET) += cmd_net.o
Grant Likelyf0037c52007-09-24 09:05:30 -060093COBJS-y += cmd_nvedit.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +020094COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
Mike Frysingerd0b01a22008-02-04 19:26:57 -050095COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
Grant Likely4a437192007-09-24 09:05:31 -060096ifdef CONFIG_PCI
97COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
98endif
Grant Likelyf0037c52007-09-24 09:05:30 -060099COBJS-y += cmd_pcmcia.o
Grant Likely4a437192007-09-24 09:05:31 -0600100COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
101COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
102COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
Dave Liuc7057b52008-03-26 22:49:44 +0800103COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
Grant Likely4a437192007-09-24 09:05:31 -0600104COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
Kumar Galad0586982008-02-14 20:44:42 -0600105COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
Grant Likely4a437192007-09-24 09:05:31 -0600106COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
Mike Frysinger30942b12008-02-04 19:26:57 -0500107COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
Harald Welted16471e2007-12-19 14:14:47 +0100108COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
Grant Likely4a437192007-09-24 09:05:31 -0600109COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
110COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
Marian Balakowiczed29bc42008-01-31 13:19:58 +0100111COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
William Juul90ef1172007-11-15 12:23:57 +0100112COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600113COBJS-y += cmd_vfd.o
114COBJS-y += command.o
115COBJS-y += console.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600116COBJS-y += devices.o
117COBJS-y += dlmalloc.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200118COBJS-$(CONFIG_CMD_DOC) += docecc.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600119COBJS-y += environment.o
120COBJS-y += env_common.o
121COBJS-y += env_nand.o
122COBJS-y += env_dataflash.o
123COBJS-y += env_flash.o
124COBJS-y += env_eeprom.o
125COBJS-y += env_onenand.o
Haavard Skinnemoen8c664972008-05-16 11:10:35 +0200126COBJS-y += env_sf.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600127COBJS-y += env_nvram.o
128COBJS-y += env_nowhere.o
129COBJS-y += exports.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600130COBJS-y += flash.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600131COBJS-y += hush.o
132COBJS-y += kgdb.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200133COBJS-$(CONFIG_LCD) += lcd.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600134COBJS-y += lists.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200135COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600136COBJS-y += memsize.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200137COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600138COBJS-y += miiphyutil.o
139COBJS-y += s_record.o
140COBJS-y += serial.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200141COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
142COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
143ifdef CONFIG_CMD_USB
Grant Likelyf0037c52007-09-24 09:05:30 -0600144COBJS-y += usb.o
Jean-Christophe PLAGNIOL-VILLARDd6e9ee92008-08-13 01:40:38 +0200145COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
146endif
147COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
Grant Likelyf0037c52007-09-24 09:05:30 -0600148COBJS-y += crc16.o
149COBJS-y += xyzModem.o
150COBJS-y += cmd_mac.o
Grant Likely4a437192007-09-24 09:05:31 -0600151COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
Kumar Galaec2b74f2008-01-17 16:48:33 -0600152COBJS-$(CONFIG_MP) += cmd_mp.o
Haavard Skinnemoenb6368462008-05-16 11:10:34 +0200153COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
James Yang0f2cbe32008-08-26 15:01:27 -0500154COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
wdenke831ad52002-10-17 21:52:26 +0000155
Grant Likelyf0037c52007-09-24 09:05:30 -0600156COBJS := $(COBJS-y)
Marian Balakowiczf9328632006-09-01 19:49:50 +0200157SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
158OBJS := $(addprefix $(obj),$(AOBJS) $(COBJS))
wdenke831ad52002-10-17 21:52:26 +0000159
160CPPFLAGS += -I..
161
162all: $(LIB) $(AOBJS)
163
Marian Balakowiczf9328632006-09-01 19:49:50 +0200164$(LIB): $(obj).depend $(OBJS)
Wolfgang Denk2b208f52006-10-09 01:02:05 +0200165 $(AR) $(ARFLAGS) $@ $(OBJS)
wdenke831ad52002-10-17 21:52:26 +0000166
Marian Balakowiczf9328632006-09-01 19:49:50 +0200167$(obj)environment.o: $(src)environment.c $(obj)../tools/envcrc
wdenke831ad52002-10-17 21:52:26 +0000168 $(CC) $(AFLAGS) -Wa,--no-warn \
Marian Balakowiczf9328632006-09-01 19:49:50 +0200169 -DENV_CRC=$(shell $(obj)../tools/envcrc) \
170 -c -o $@ $(src)environment.c
wdenke831ad52002-10-17 21:52:26 +0000171
Marian Balakowiczf9328632006-09-01 19:49:50 +0200172$(obj)../tools/envcrc:
wdenka8c7c702003-12-06 19:49:23 +0000173 $(MAKE) -C ../tools
174
wdenke831ad52002-10-17 21:52:26 +0000175#########################################################################
176
Marian Balakowiczf9328632006-09-01 19:49:50 +0200177# defines $(obj).depend target
178include $(SRCTREE)/rules.mk
wdenke831ad52002-10-17 21:52:26 +0000179
Marian Balakowiczf9328632006-09-01 19:49:50 +0200180sinclude $(obj).depend
wdenke831ad52002-10-17 21:52:26 +0000181
182#########################################################################