2 # Project: USBaspLoader (updater)
3 # Author: Stephan Bärwolf
4 # Creation Date: 2012-09-01
6 # License: GNU GPL v2 (see License.txt)
8 include ..
/Makefile.inc
10 # elsewise gcc would complain unnecessary
11 CFLAGS
= -Wall
-Wno-pointer-to-int-cast
-Os
-fno-move-loop-invariants
-fno-tree-scev-cprop
-fno-inline-small-functions
-I.
-mmcu
=$(DEVICE
) -DF_CPU
=$(F_CPU
) -DNEW_BOOTLOADER_ADDRESS
=$(NEW_BOOTLOADER_ADDRESS
) $(DEFINES
)
12 LDFLAGS
= -Wl
,--relax
,--gc-sections
14 ifneq ($(FLASHADDRESS
), 0)
15 ifneq ($(FLASHADDRESS
), 00)
16 ifneq ($(FLASHADDRESS
), 000)
17 ifneq ($(FLASHADDRESS
), 0000)
18 ifneq ($(FLASHADDRESS
), 00000)
19 ifneq ($(FLASHADDRESS
), 0x0)
20 ifneq ($(FLASHADDRESS
), 0x00)
21 ifneq ($(FLASHADDRESS
), 0x000)
22 ifneq ($(FLASHADDRESS
), 0x0000)
23 ifneq ($(FLASHADDRESS
), 0x00000)
24 FLASHPREAMBLE
= 0x0000
25 LDFLAGS
+= -Wl
,--section-start
=.text
=$(FLASHADDRESS
)
40 $(MAKE
) -C ..
/firmware main.hex
42 updater.o
: updater.c firmware.h
43 $(CC
) updater.c
-c
-o updater.o
$(CFLAGS
)
45 updater.elf
: updater.o
46 $(CC
) updater.o
-o updater.elf
$(CFLAGS
) $(LDFLAGS
)
48 updater.hex
: updater.elf
49 $(OBC
) -j .text
-j .data
-O ihex updater.elf updater.hex
53 $(AVRDUDE
) -D
-U flash
:w
:updater.hex
:i
58 firmware_gen.o
: firmware_gen.c
59 $(GCC
) firmware_gen.c
-c
-o firmware_gen.o
61 firmware_gen
: firmware_gen.o
62 $(GCC
) firmware_gen.o
-o firmware_gen
64 firmware.h
: firmware_gen ..
/firmware
/main.bin
65 $(OBC
) -j .text
-j .data
-O binary ..
/firmware
/main.bin usbasploader.raw
66 @.
/firmware_gen
> firmware.h