]> git.cryptolib.org Git - avr-crypto-lib.git/blob - Makefile
+ fix hmac-sha256
[avr-crypto-lib.git] / Makefile
1 PRG         = rc6
2 # camellia
3 # cryptotest
4 # OBJ       = main-camellia-test.o debug.o uart.o serial-tools.o camellia.o camellia-asm.o
5 # main-skipjack-test.o debug.o uart.o serial-tools.o skipjack.o
6 # main-sha1-test.o debug.o uart.o serial-tools.o sha1-asm.o
7 # main-md5-test.o debug.o uart.o serial-tools.o md5.o
8 # main-cast5-test.o debug.o uart.o serial-tools.o cast5.o
9 OBJ = main-rc6-test.o debug.o uart.o serial-tools.o rc6.o
10 # main.o debug.o uart.o serial-tools.o sha256-asm.o xtea-asm.o arcfour-asm.o prng.o cast5.o
11 MCU_TARGET     = atmega32
12 OPTIMIZE       = -Os
13
14 DEFS       =
15 LIBS       =
16
17 # You should not have to change anything below here.
18
19 CC           = avr-gcc
20
21 # Override is only needed by avr-lib build system.
22
23 override CFLAGS = -Wall -Wstrict-prototypes  $(OPTIMIZE) -mmcu=$(MCU_TARGET) 
24 $(DEFS)
25 override LDFLAGS       = -Wl,-Map,$(PRG).map
26 override ASFLAGS           = -mmcu=$(MCU_TARGET)
27
28 OBJCOPY = avr-objcopy
29 OBJDUMP = avr-objdump
30
31 all: $(PRG).elf lst text eeprom
32
33 $(PRG).elf: $(OBJ)
34         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
35
36 #rc6-test: 
37
38 clean:
39         rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak 
40         rm -rf *.lst *.map $(EXTRA_CLEAN_FILES)
41
42 lst:  $(PRG).lst
43
44 %.lst: %.elf
45         $(OBJDUMP) -h -S $< > $@
46
47 # Rules for building the .text rom images
48
49 text: hex bin srec
50
51 hex:  $(PRG).hex
52 bin:  $(PRG).bin
53 srec: $(PRG).srec
54
55 %.hex: %.elf
56         $(OBJCOPY) -j .text -j .data -O ihex $< $@
57
58 %.srec: %.elf
59         $(OBJCOPY) -j .text -j .data -O srec $< $@
60
61 %.bin: %.elf
62         $(OBJCOPY) -j .text -j .data -O binary $< $@
63
64 # Rules for building the .eeprom rom images
65
66 eeprom: ehex ebin esrec
67
68 ehex:  $(PRG)_eeprom.hex
69 ebin:  $(PRG)_eeprom.bin
70 esrec: $(PRG)_eeprom.srec
71
72 %_eeprom.hex: %.elf
73         $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@
74
75 %_eeprom.srec: %.elf
76         $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O srec $< $@
77
78 %_eeprom.bin: %.elf
79         $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O binary $< $@
80
81 # Every thing below here is used by avr-libc's build system and can be ignored
82 # by the casual user.
83
84 FIG2DEV          = fig2dev
85 EXTRA_CLEAN_FILES       = *.hex *.bin *.srec
86
87 dox: eps png pdf
88
89 eps: $(PRG).eps
90 png: $(PRG).png
91 pdf: $(PRG).pdf
92
93 %.eps: %.fig
94         $(FIG2DEV) -L eps $< $@
95
96 %.pdf: %.fig
97         $(FIG2DEV) -L pdf $< $@
98
99 %.png: %.fig
100         $(FIG2DEV) -L png $< $@