]> git.ipfire.org Git - people/ms/u-boot.git/blame - examples/Makefile
86xx: Add CPU_TYPE_ENTRY support
[people/ms/u-boot.git] / examples / Makefile
CommitLineData
717b5aad 1#
f9328639 2# (C) Copyright 2000-2006
717b5aad
WD
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
27b207fd 24ifeq ($(ARCH),ppc)
717b5aad 25LOAD_ADDR = 0x40000
27b207fd
WD
26endif
27
28ifeq ($(ARCH),i386)
29LOAD_ADDR = 0x40000
30endif
31
32ifeq ($(ARCH),arm)
118978c8
WR
33ifeq ($(BOARD),omap2420h4)
34LOAD_ADDR = 0x80300000
35else
91eee546
DB
36ifeq ($(CPU),omap3)
37LOAD_ADDR = 0x80300000
38else
27b207fd
WD
39LOAD_ADDR = 0xc100000
40endif
118978c8 41endif
91eee546 42endif
27b207fd
WD
43
44ifeq ($(ARCH),mips)
45LOAD_ADDR = 0x80200000 -T mips.lds
46endif
717b5aad 47
4a551709 48ifeq ($(ARCH),nios)
e4cc71aa 49LOAD_ADDR = 0x00800000 -L $(gcclibdir)/m32 -T nios.lds
4a551709
WD
50endif
51
5c952cf0 52ifeq ($(ARCH),nios2)
c2ced000 53LOAD_ADDR = 0x02000000 -L $(gcclibdir) -T nios2.lds
5c952cf0
WD
54endif
55
bf9e3b38
WD
56ifeq ($(ARCH),m68k)
57LOAD_ADDR = 0x20000 -L $(clibdir)
58endif
59
507bbe3e
WD
60ifeq ($(ARCH),microblaze)
61LOAD_ADDR = 0x80F00000
62endif
63
0afe519a
WD
64ifeq ($(ARCH),blackfin)
65LOAD_ADDR = 0x1000
66endif
67
7b64fef3
WD
68ifeq ($(ARCH),avr32)
69LOAD_ADDR = 0x00000000
70endif
71
0b135cfc
NI
72ifeq ($(ARCH),sh)
73LOAD_ADDR = 0x8C000000
6ad43d0d
NI
74ifeq ($(CPU),sh2)
75BIG_ENDIAN=y
76endif
0b135cfc
NI
77endif
78
c2f02da2
DH
79ifeq ($(ARCH),sparc)
80LOAD_ADDR = 0x00000000 -L $(gcclibdir) -T sparc.lds
81endif
0b135cfc 82
717b5aad
WD
83include $(TOPDIR)/config.mk
84
96582987 85ELF = hello_world
717b5aad 86SREC = hello_world.srec
96582987 87BIN = hello_world.bin
717b5aad 88
c0176630 89ifeq ($(CPU),mpc8xx)
dfece950
WD
90ELF += test_burst
91SREC += test_burst.srec
92BIN += test_burst.bin
931da93e
WD
93endif
94
7a8e9bed 95ifeq ($(ARCH),i386)
96582987
WD
96ELF += 82559_eeprom
97SREC += 82559_eeprom.srec
98BIN += 82559_eeprom.bin
7a8e9bed
WD
99endif
100
85ec0bcc 101ifeq ($(ARCH),ppc)
96582987
WD
102ELF += sched
103SREC += sched.srec
104BIN += sched.bin
85ec0bcc
WD
105endif
106
0afe519a 107ifeq ($(ARCH),blackfin)
ad2d1639
MF
108BFIN_BIN = smc91111_eeprom smc911x_eeprom
109ELF += $(BFIN_BIN)
110SREC += $(addsuffix .srec,$(BFIN_BIN))
111BIN += $(addsuffix .bin,$(BFIN_BIN))
26bf7dec 112endif
0afe519a 113
717b5aad
WD
114# The following example is pretty 8xx specific...
115ifeq ($(CPU),mpc8xx)
96582987
WD
116ELF += timer
117SREC += timer.srec
118BIN += timer.bin
717b5aad
WD
119endif
120
3e38691e
WD
121# The following example is 8260 specific...
122ifeq ($(CPU),mpc8260)
96582987
WD
123ELF += mem_to_mem_idma2intr
124SREC += mem_to_mem_idma2intr.srec
125BIN += mem_to_mem_idma2intr.bin
3e38691e
WD
126endif
127
ec0f7277
DZ
128# Demo for 52xx IRQs
129ifeq ($(CPU),mpc5xxx)
96582987
WD
130ELF += interrupt
131SREC += interrupt.srec
132BIN += interrupt.bin
ec0f7277
DZ
133endif
134
717b5aad
WD
135# Utility for resetting i82559 EEPROM
136ifeq ($(BOARD),oxc)
96582987
WD
137ELF += eepro100_eeprom
138SREC += eepro100_eeprom.srec
139BIN += eepro100_eeprom.bin
717b5aad
WD
140endif
141
2d5b561e
WD
142ifeq ($(BIG_ENDIAN),y)
143EX_LDFLAGS += -EB
144endif
145
f9328639 146COBJS := $(SREC:.srec=.o)
717b5aad 147
f9328639 148LIB = $(obj)libstubs.a
27b207fd 149LIBAOBJS=
85ec0bcc
WD
150ifeq ($(ARCH),ppc)
151LIBAOBJS+= $(ARCH)_longjmp.o $(ARCH)_setjmp.o
c0176630
WD
152endif
153ifeq ($(CPU),mpc8xx)
931da93e 154LIBAOBJS+= test_burst_lib.o
85ec0bcc 155endif
27b207fd 156LIBCOBJS= stubs.o
f9328639
MB
157
158LIBOBJS = $(addprefix $(obj),$(LIBAOBJS) $(LIBCOBJS))
159
160SRCS := $(COBJS:.o=.c) $(LIBCOBJS:.o=.c) $(if $(LIBAOBJS),$(LIBAOBJS:.o=.S))
161OBJS := $(addprefix $(obj),$(COBJS))
96582987 162ELF := $(addprefix $(obj),$(ELF))
f9328639
MB
163BIN := $(addprefix $(obj),$(BIN))
164SREC := $(addprefix $(obj),$(SREC))
717b5aad 165
c29fdfc1 166gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
bf9e3b38 167clibdir := $(shell dirname `$(CC) $(CFLAGS) -print-file-name=libc.a`)
c29fdfc1 168
717b5aad
WD
169CPPFLAGS += -I..
170
96582987 171all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF)
717b5aad
WD
172
173#########################################################################
f9328639 174$(LIB): $(obj).depend $(LIBOBJS)
2b208f53 175 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
717b5aad 176
96582987 177$(ELF):
f9328639
MB
178$(obj)%: $(obj)%.o $(LIB)
179 $(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
0858b835 180 -o $@ -e $(SYM_PREFIX)$(notdir $(<:.o=)) $< $(LIB) \
f9328639 181 -L$(gcclibdir) -lgcc
96582987
WD
182
183$(SREC):
f9328639
MB
184$(obj)%.srec: $(obj)%
185 $(OBJCOPY) -O srec $< $@ 2>/dev/null
717b5aad 186
96582987 187$(BIN):
f9328639
MB
188$(obj)%.bin: $(obj)%
189 $(OBJCOPY) -O binary $< $@ 2>/dev/null
dc7c9a1a 190
717b5aad
WD
191#########################################################################
192
f9328639
MB
193# defines $(obj).depend target
194include $(SRCTREE)/rules.mk
717b5aad 195
f9328639 196sinclude $(obj).depend
717b5aad
WD
197
198#########################################################################