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