AVR32: sync with latest Atmel source (closes #3371)
[openwrt.git] / target / linux / at91 / image / dfboot / src / Makefile
1 # Makefile for DataFlashBoot.bin
2 # Must use toolchain with H/W FLoating Point
3
4 BASENAME=dfboot
5 BINNAME=$(BASENAME).bin
6 OUTNAME=$(BASENAME).out
7 LSSNAME=$(BASENAME).lss
8 MAPNAME=$(BASENAME).map
9
10 BASENAME2=dfbptest
11 BINNAME2=$(BASENAME2).bin
12 OUTNAME2=$(BASENAME2).out
13 LSSNAME2=$(BASENAME2).lss
14 MAPNAME2=$(BASENAME2).map
15
16 INCPATH=include
17
18 CFLAGS_LOCAL=-Os -Wall -I$(INCPATH)
19 BUILD=$(CC) $(CFLAGS) $(CFLAGS_LOCAL)
20
21 LDFLAGS+=-T elf32-littlearm.lds -Ttext 0
22 LINK=$(LD) $(LDFLAGS)
23
24 OBJS=objs/cstartup_ram.o objs/at45.o objs/com.o objs/dataflash.o\
25 objs/div0.o objs/init.o objs/main.o objs/asm_isr.o objs/asm_mci_isr.o\
26 objs/mci_device.o objs/jump.o objs/_udivsi3.o objs/_umodsi3.o
27
28 OBJS2=objs/cstartup_ram.o objs/at45.o objs/com.o objs/dataflash.o\
29 objs/div0.o objs/init.o objs/ptmain.o objs/asm_isr.o objs/asm_mci_isr.o\
30 objs/mci_device.o objs/jump.o objs/_udivsi3.o objs/_umodsi3.o
31
32 I=config.h com.h dataflash.h embedded_services.h main.h stdio.h include/AT91RM9200.h include/lib_AT91RM9200.h
33
34 all:clean $(BASENAME) $(BASENAME2)
35
36 $(BASENAME): $(OBJS)
37 $(LINK) -n -o $(OUTNAME) $(OBJS)
38 $(OBJCOPY) $(OUTNAME) -O binary $(BINNAME)
39 $(OBJDUMP) -h -s $(OUTNAME) > $(LSSNAME)
40 $(NM) -n $(OUTNAME) | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $(MAPNAME)
41 cp $(BINNAME) binary
42
43 $(BASENAME2): $(OBJS2)
44 $(LINK) -n -o $(OUTNAME2) $(OBJS2)
45 $(OBJCOPY) $(OUTNAME2) -O binary $(BINNAME2)
46 $(OBJDUMP) -h -s $(OUTNAME2) > $(LSSNAME2)
47 $(NM) -n $(OUTNAME2) | grep -v '\( [aUw] \)\|\(__crc_\)\|\( \$[adt]\)' > $(MAPNAME2)
48 cp $(BINNAME2) binary
49
50 # C objects here
51 objs/at45.o: at45.c $(I)
52 $(BUILD) -c -o objs/at45.o at45.c
53 objs/com.o: com.c $(I)
54 $(BUILD) -c -o objs/com.o com.c
55 objs/dataflash.o: dataflash.c $(I)
56 $(BUILD) -c -o objs/dataflash.o dataflash.c
57 objs/mci_device.o: mci_device.c $(I)
58 $(BUILD) -c -o objs/mci_device.o mci_device.c
59 objs/div0.o: div0.c $(I)
60 $(BUILD) -c -o objs/div0.o div0.c
61 objs/init.o: init.c $(I)
62 $(BUILD) -c -o objs/init.o init.c
63 objs/main.o: main.c $(I)
64 $(BUILD) -c -o objs/main.o main.c
65 objs/ptmain.o: main.c $(I)
66 $(BUILD) -c -D PRODTEST -o objs/ptmain.o main.c
67
68 # ASM objects here
69 objs/asm_isr.o: asm_isr.S
70 $(BUILD) -c -o objs/asm_isr.o asm_isr.S
71 objs/asm_mci_isr.o: asm_mci_isr.S
72 $(BUILD) -c -o objs/asm_mci_isr.o asm_mci_isr.S
73 objs/cstartup_ram.o: cstartup_ram.S
74 $(BUILD) -c -o objs/cstartup_ram.o cstartup_ram.S
75 objs/jump.o: jump.S
76 $(BUILD) -c -o objs/jump.o jump.S
77 objs/_udivsi3.o: _udivsi3.S
78 $(BUILD) -c -o objs/_udivsi3.o _udivsi3.S
79 objs/_umodsi3.o: _umodsi3.S
80 $(BUILD) -c -o objs/_umodsi3.o _umodsi3.S
81
82 install: $(BINNAME) $(BINNAME2)
83 cp $(BINNAME) binary
84 cp $(BINNAME2) binary
85
86 clean:
87 rm -f *~
88 rm -f objs/*
89 rm -f *.out
90 rm -f *.bin
91 rm -f *.lss
92 rm -f *.map
93 rm -f .unpacked
94 mkdir -p objs
This page took 0.068107 seconds and 5 git commands to generate.