54590905587978c72791db60a823d9b629db7b27
[openwrt/staging/chunkeey.git] / target / linux / etrax-2.6 / image / e100boot / src / cbl / rules.cbl
1 #
2 # $Id: rules.cbl,v 1.4 2005/04/20 11:18:54 starvik Exp $
3 #
4
5 VPATH := .:../src
6
7 ifeq ($(findstring _noleds,$(IMAGE)),_noleds)
8 USE_LEDS := 0
9 else
10 USE_LEDS := 1
11 endif
12
13 MAKEFLAGS := r
14 INCS := -I.
15 DEFS := -DUSE_LEDS=$(USE_LEDS)
16 CFLAGS := -Os -Wall -Wmissing-prototypes -W -Wa,-N -nostdinc $(INCS) $(DEFS) -MMD
17 ASFLAGS := $(CFLAGS)
18 LNFLAGS := -Wl,--section-start,.startup=0x380000f0 -nostdlib -Os -Wl,-T../src/ldscript
19 CC := cris-axis-elf-gcc
20
21 OUT := $(patsubst %.ima,%.out,$(IMAGE))
22
23 OBJS = crt0.o common_init.o
24 ifeq ($(findstring net,$(IMAGE)),net)
25 OBJS += net_init.o
26 else
27 OBJS += ser_init.o
28 endif
29 OBJS += common.o flash.o hwregs.o e100boot_version.o
30
31 all: ../$(IMAGE)
32
33 $(OUT): $(OBJS) ldscript
34 $(CC) -o $@ $(LNFLAGS) $(OBJS)
35
36 ../%.ima: %.out
37 bin-cris -o $@ $<
38 @find $@ -printf '# Size of image $@ is %s bytes.\n\n'
39
40 $(OBJS): ../rules.cbl Makefile
41
42 # We don't want this to be a dummy and be recreated every time we build,
43 # only after a make clean
44 e100boot_version.c:
45 @echo "Generating version file....."
46 @echo 'char e100boot_version[] = "This bootloader was built by '`id -u -n`' on '`date`'.\r\n";' > $@
47
48 dummy:
49
50 clean:
51 rm -rf *.o *.d *.out *.ima deps e100boot_version.c
52
53 ifneq ($(MAKECMDGOALS),clean)
54 -include *.d
55 endif