2 # (C) Copyright 2004-2006, Texas Instruments, <www.ti.com>
3 # Jian Zhang <jzhang@ti.com>
5 # (C) Copyright 2000-2004
6 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
8 # See file CREDITS for list of people who contributed to this
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation; either version 2 of
14 # the License, or (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write to the Free Software
23 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 HOSTARCH := $(shell uname -m | \
35 HOSTOS := $(shell uname -s | tr A-Z a-z | \
36 sed -e 's/\(cygwin\).*/cygwin/')
40 # Deal with colliding definitions from tcsh etc.
43 #########################################################################
45 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
48 ifeq (include/config.mk,$(wildcard include/config.mk))
49 # load ARCH, BOARD, and CPU configuration
50 include include/config.mk
51 export ARCH CPU BOARD VENDOR
52 # load other configuration
53 include $(TOPDIR)/config.mk
56 CROSS_COMPILE = arm-none-linux-gnueabi-
57 #CROSS_COMPILE = arm-linux-
61 #########################################################################
62 # X-LOAD objects....order is important (i.e. start must be first)
64 OBJS = cpu/$(CPU)/start.o
67 LIBS += board/$(BOARDDIR)/lib$(BOARD).a
68 LIBS += cpu/$(CPU)/lib$(CPU).a
69 LIBS += lib/lib$(ARCH).a
70 LIBS += fs/fat/libfat.a
71 LIBS += disk/libdisk.a
72 LIBS += drivers/libdrivers.a
73 LIBS += common/libcommon.a
77 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
80 #########################################################################
81 #########################################################################
83 ALL = x-load.bin System.map
87 ift: $(ALL) x-load.bin.ift
89 x-load.bin.ift: signGP System.map x-load.bin
90 TEXT_BASE=`grep -w _start System.map|cut -d ' ' -f1`
91 ./signGP x-load.bin $(TEXT_BASE)
95 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
97 x-load: $(OBJS) $(LIBS) $(LDSCRIPT)
98 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
99 $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
100 --start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
101 -Map x-load.map -o x-load
104 $(MAKE) -C `dirname $@`
109 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
115 signGP: scripts/signGP.c
116 gcc -Wall -g -O3 -o signGP $<
118 #########################################################################
120 all install x-load x-load.srec oneboot depend dep:
121 @echo "System not configured - see README" >&2
125 #########################################################################
128 rm -f include/config.h include/config.mk
130 #========================================================================
132 #========================================================================
133 #########################################################################
134 ## OMAP1 (ARM92xT) Systems
135 #########################################################################
137 omap1710h3_config : unconfig
138 @./mkconfig $(@:_config=) arm arm926ejs omap1710h3
140 #########################################################################
141 ## OMAP2 (ARM1136) Systems
142 #########################################################################
144 omap2420h4_config : unconfig
145 @./mkconfig $(@:_config=) arm arm1136 omap2420h4
147 omap2430sdp_config : unconfig
148 @./mkconfig $(@:_config=) arm arm1136 omap2430sdp
150 #########################################################################
151 ## OMAP3 (ARM-CortexA8) Systems
152 #########################################################################
153 omap3430sdp_config : unconfig
154 @./mkconfig $(@:_config=) arm omap3 omap3430sdp
156 omap3430labrador_config : unconfig
157 @./mkconfig $(@:_config=) arm omap3 omap3430labrador
159 omap3evm_config : unconfig
160 @./mkconfig $(@:_config=) arm omap3 omap3evm
162 overo_config : unconfig
163 @./mkconfig $(@:_config=) arm omap3 overo
165 omap3530beagle_config : unconfig
166 @./mkconfig $(@:_config=) arm omap3 omap3530beagle
168 #########################################################################
169 ## OMAP4 (ARM-CortexA9) Systems
170 #########################################################################
171 omap4430panda_config : unconfig
172 @./mkconfig $(@:_config=) arm omap4 omap4430panda
174 #########################################################################
178 \( -name 'core' -o -name '*.bak' -o -name '*~' \
179 -o -name '*.o' -o -name '*.a' \) -print \
184 \( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
187 rm -f $(OBJS) *.bak tags TAGS
189 rm -f x-load x-load.map $(ALL) x-load.bin.ift signGP MLO
190 rm -f include/asm/proc include/asm/arch
193 distclean: clobber unconfig
196 F=`basename $(TOPDIR)` ; cd .. ; \
197 gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
199 #########################################################################