Makefile 5.29 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.a
wdenk's avatar
wdenk committed
27 28 29

AOBJS	=

30
# core
31 32
COBJS-y += main.o
COBJS-y += circbuf.o
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
COBJS-y += console.o
COBJS-y += command.o
COBJS-y += devices.o
COBJS-y += dlmalloc.o
COBJS-y += exports.o
COBJS-y += hush.o
COBJS-y += image.o
COBJS-y += memsize.o
COBJS-y += s_record.o
COBJS-y += serial.o
COBJS-y += xyzModem.o

# environment
COBJS-y += environment.o
COBJS-y += env_common.o
COBJS-y += env_dataflash.o
COBJS-y += env_eeprom.o
COBJS-y += env_flash.o
COBJS-y += env_nand.o
COBJS-y += env_nvram.o
COBJS-y += env_onenand.o
COBJS-y += env_sf.o
COBJS-y += env_nowhere.o

# command
58
COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
59 60
COBJS-$(CONFIG_AUTOSCRIPT) += cmd_autoscript.o
COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
61
COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
62
COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
63
COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
64
COBJS-y += cmd_boot.o
65
COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
66
COBJS-y += cmd_bootm.o
67 68
COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
69
COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
70 71 72 73 74 75 76 77 78 79
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_DOC) += cmd_doc.o
COBJS-$(CONFIG_CMD_DTT) += cmd_dtt.o
80
COBJS-y += cmd_eeprom.o
81 82 83
COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
84
COBJS-y += cmd_fdc.o
85
COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o
86 87 88
COBJS-$(CONFIG_CMD_FDOS) += cmd_fdos.o
COBJS-$(CONFIG_CMD_FLASH) += cmd_flash.o
ifdef CONFIG_FPGA
89
COBJS-y += fpga.o
90
COBJS-$(CONFIG_CMD_FPGA) += cmd_fpga.o
91 92 93 94 95 96 97 98 99 100
COBJS-$(CONFIG_FPGA_SPARTAN2) += spartan2.o
COBJS-$(CONFIG_FPGA_SPARTAN3) += spartan3.o
COBJS-$(CONFIG_FPGA_VIRTEX2) += virtex2.o
COBJS-$(CONFIG_FPGA_XILINX) += xilinx.o
ifdef CONFIG_FPGA_ALTERA
COBJS-y += altera.o
COBJS-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
COBJS-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
COBJS-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
endif
101 102 103 104
endif
COBJS-$(CONFIG_CMD_I2C) += cmd_i2c.o
COBJS-$(CONFIG_CMD_IDE) += cmd_ide.o
COBJS-$(CONFIG_CMD_IMMAP) += cmd_immap.o
105
COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
106 107
COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
108
COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
109
COBJS-y += cmd_load.o
110
COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
111
COBJS-y += cmd_mac.o
112
COBJS-y += cmd_mem.o
113
COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
114 115
COBJS-$(CONFIG_MII) += miiphyutil.o
COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
116 117 118
COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
119
COBJS-$(CONFIG_MP) += cmd_mp.o
120
COBJS-y += cmd_nand.o
121
COBJS-$(CONFIG_CMD_NET) += cmd_net.o
122
COBJS-y += cmd_nvedit.o
123
COBJS-$(CONFIG_CMD_ONENAND) += cmd_onenand.o
124
COBJS-$(CONFIG_CMD_OTP) += cmd_otp.o
125 126 127
ifdef CONFIG_PCI
COBJS-$(CONFIG_CMD_PCI) += cmd_pci.o
endif
128
COBJS-y += cmd_pcmcia.o
129 130 131
COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
132
COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
133
COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
134
COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
Kumar Gala's avatar
Kumar Gala committed
135
COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
136
COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
137
COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
138
COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
139
COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
140 141 142 143 144
ifdef CONFIG_CMD_USB
COBJS-y += cmd_usb.o
COBJS-y += usb.o
COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
endif
145
COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
William Juul's avatar
William Juul committed
146
COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
147
COBJS-y += cmd_vfd.o
148
COBJS-$(CONFIG_CMD_DOC) += docecc.o
149 150
COBJS-y += flash.o
COBJS-y += kgdb.o
151 152 153
COBJS-$(CONFIG_LCD) += lcd.o
COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
154
COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
wdenk's avatar
wdenk committed
155

156
COBJS	:= $(sort $(COBJS-y))
157 158
SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
wdenk's avatar
wdenk committed
159 160 161 162 163

CPPFLAGS += -I..

all:	$(LIB) $(AOBJS)

164
$(LIB): $(obj).depend $(OBJS)
165
	$(AR) $(ARFLAGS) $@ $(OBJS)
wdenk's avatar
wdenk committed
166

167
$(obj)environment.o: $(src)environment.c $(obj)../tools/envcrc
wdenk's avatar
wdenk committed
168
	$(CC) $(AFLAGS) -Wa,--no-warn \
169 170
		-DENV_CRC=$(shell $(obj)../tools/envcrc) \
		-c -o $@ $(src)environment.c
wdenk's avatar
wdenk committed
171

172
$(obj)../tools/envcrc:
wdenk's avatar
wdenk committed
173 174
	$(MAKE) -C ../tools

wdenk's avatar
wdenk committed
175 176
#########################################################################

177 178
# defines $(obj).depend target
include $(SRCTREE)/rules.mk
wdenk's avatar
wdenk committed
179

180
sinclude $(obj).depend
wdenk's avatar
wdenk committed
181 182

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