1 # Makefile for DataFlashBoot.bin
2 # Must use toolchain with H/W FLoating Point
5 BINNAME
=$(BASENAME
).bin
6 OUTNAME
=$(BASENAME
).out
7 LSSNAME
=$(BASENAME
).lss
8 MAPNAME
=$(BASENAME
).map
11 BINNAME2
=$(BASENAME2
).bin
12 OUTNAME2
=$(BASENAME2
).out
13 LSSNAME2
=$(BASENAME2
).lss
14 MAPNAME2
=$(BASENAME2
).map
18 CFLAGS_LOCAL
=-Os
-Wall
-I
$(INCPATH
)
19 BUILD
=$(CC
) $(CFLAGS
) $(CFLAGS_LOCAL
)
21 LDFLAGS
+=-T elf32-littlearm.lds
-Ttext
0
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
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
32 I
=config.h com.h dataflash.h embedded_services.h main.h stdio.h
include/AT91RM9200.h
include/lib_AT91RM9200.h
34 all:clean $(BASENAME
) $(BASENAME2
)
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
)
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
)
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
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
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
82 install: $(BINNAME
) $(BINNAME2
)