xref: /openbmc/u-boot/common/Makefile (revision 9b827cf1)
1#
2# (C) Copyright 2004-2006
3# 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
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
16# 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
26LIB	= $(obj)libcommon.a
27
28AOBJS	=
29
30# core
31COBJS-y += main.o
32COBJS-y += circbuf.o
33COBJS-y += console.o
34COBJS-y += command.o
35COBJS-y += devices.o
36COBJS-y += dlmalloc.o
37COBJS-y += exports.o
38COBJS-y += hush.o
39COBJS-y += image.o
40COBJS-y += memsize.o
41COBJS-y += s_record.o
42COBJS-y += serial.o
43COBJS-y += xyzModem.o
44
45# core command
46COBJS-y += cmd_boot.o
47COBJS-y += cmd_bootm.o
48COBJS-y += cmd_nvedit.o
49
50# environment
51COBJS-y += env_common.o
52COBJS-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
53COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
54COBJS-y += env_embedded.o
55COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
56COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
57COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
58COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
59COBJS-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
60COBJS-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
61
62# command
63COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
64COBJS-$(CONFIG_AUTOSCRIPT) += cmd_autoscript.o
65COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
66COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
67COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
68COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
69COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
70COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
71COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
72COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
73COBJS-$(CONFIG_CMD_DATE) += cmd_date.o
74ifdef CONFIG_4xx
75COBJS-$(CONFIG_CMD_SETGETDCR) += cmd_dcr.o
76endif
77ifdef CONFIG_POST
78COBJS-$(CONFIG_CMD_DIAG) += cmd_diag.o
79endif
80COBJS-$(CONFIG_CMD_DISPLAY) += cmd_display.o
81COBJS-$(CONFIG_CMD_DOC) += cmd_doc.o
82COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
83COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
84COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
85COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
86COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
87COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
88COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
89COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
90COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
91COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
92ifdef CONFIG_FPGA
93COBJS-y += fpga.o
94COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
95COBJS-$(CONFIG_FPGA_SPARTAN2) += spartan2.o
96COBJS-$(CONFIG_FPGA_SPARTAN3) += spartan3.o
97COBJS-$(CONFIG_FPGA_VIRTEX2) += virtex2.o
98COBJS-$(CONFIG_FPGA_XILINX) += xilinx.o
99ifdef CONFIG_FPGA_ALTERA
100COBJS-y += altera.o
101COBJS-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
102COBJS-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
103COBJS-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
104endif
105endif
106COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
107COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
108COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
109COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
110COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
111COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
112COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
113COBJS-y += cmd_load.o
114COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
115COBJS-$(CONFIG_ID_EEPROM) += cmd_mac.o
116COBJS-$(CONFIG_CMD_MEMORY) += cmd_mem.o
117COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
118COBJS-$(CONFIG_MII) += miiphyutil.o
119COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
120COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
121COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
122COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
123COBJS-$(CONFIG_MP) += cmd_mp.o
124COBJS-y += cmd_nand.o
125COBJS-$(CONFIG_CMD_NET) += cmd_net.o
126COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
127COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
128ifdef CONFIG_PCI
129COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
130endif
131COBJS-y += cmd_pcmcia.o
132COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
133COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
134COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
135COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
136COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
137COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
138COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
139COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
140COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
141COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
142COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
143ifdef CONFIG_CMD_USB
144COBJS-y += cmd_usb.o
145COBJS-y += usb.o
146COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
147endif
148COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
149COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
150COBJS-$(CONFIG_VFD) += cmd_vfd.o
151
152# others
153COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
154COBJS-$(CONFIG_CMD_DOC) += docecc.o
155COBJS-y += flash.o
156COBJS-y += kgdb.o
157COBJS-$(CONFIG_LCD) += lcd.o
158COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
159COBJS-$(CONFIG_UPDATE_TFTP) += update.o
160COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
161
162
163COBJS	:= $(sort $(COBJS-y))
164SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
165OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
166
167CPPFLAGS += -I..
168
169all:	$(LIB) $(AOBJS)
170
171$(LIB): $(obj).depend $(OBJS)
172	$(AR) $(ARFLAGS) $@ $(OBJS)
173
174$(obj)env_embedded.o: $(src)env_embedded.c $(obj)../tools/envcrc
175	$(CC) $(AFLAGS) -Wa,--no-warn \
176		-DENV_CRC=$(shell $(obj)../tools/envcrc) \
177		-c -o $@ $(src)env_embedded.c
178
179$(obj)../tools/envcrc:
180	$(MAKE) -C ../tools
181
182#########################################################################
183
184# defines $(obj).depend target
185include $(SRCTREE)/rules.mk
186
187sinclude $(obj).depend
188
189#########################################################################
190