]> git.cryptolib.org Git - avr-crypto-lib.git/blob - Makefile
+nessie tests for serpent
[avr-crypto-lib.git] / Makefile
1 PRG        = serpent-test
2 #PRG        = tdes-test
3 # camellia
4 # cryptotest
5 SERPENT_OBJ     = main-serpent-test.o debug.o uart.o serial-tools.o serpent.o nessie_bc_test.o
6 CAMELLIA_OBJ    = main-camellia-test.o debug.o uart.o serial-tools.o camellia.o camellia-asm.o
7 SKIPJACK_OBJ    = main-skipjack-test.o debug.o uart.o serial-tools.o skipjack.o
8 SHA1_OBJ                = main-sha1-test.o debug.o uart.o serial-tools.o sha1-asm.o
9 MD5_OBJ                 = main-md5-test.o debug.o uart.o serial-tools.o md5.o
10 CAST5_OBJ               = main-cast5-test.o debug.o uart.o serial-tools.o cast5.o
11 RC6_OBJ                 = main-rc6-test.o debug.o uart.o serial-tools.o rc6.o
12 Multi_OBJ               = main.o debug.o uart.o serial-tools.o sha256-asm.o xtea-asm.o arcfour-asm.o prng.o cast5.o
13 DES_OBJ                 = main-des-test.o debug.o uart.o serial-tools.o des.o
14 TDES_OBJ            = main-tdes-test.o debug.o uart.o serial-tools.o des.o
15 SEED_OBJ            = main-seed-test.o debug.o uart.o serial-tools.o seed.o seed-asm.o
16 SHABEA_OBJ          = main-shabea-test.o debug.o uart.o serial-tools.o shabea.o sha256-asm.o
17
18 OBJ = $(SERPENT_OBJ)
19 MCU_TARGET     = atmega32
20 OPTIMIZE       = -Os
21
22 FLASHCMD       = avrdude -p $(MCU_TARGET) -P /dev/ttyUSB0 -c avr911 -U flash:w:$(PRG).hex
23 #  -U eeprom:w:$(PRG)_eeprom.hex
24 #uisp -dprog=bsd -dlpt=/dev/parport1 --upload if=$(PRG).hex
25 ERASECMD       = 
26
27 DEFS       =
28 LIBS       =
29
30 # You should not have to change anything below here.
31
32 CC           = avr-gcc
33
34 # Override is only needed by avr-lib build system.
35
36 override CFLAGS = -pedantic -std=c99 -Wall -Wstrict-prototypes  $(OPTIMIZE) -mmcu=$(MCU_TARGET) 
37 $(DEFS)
38 override LDFLAGS       = -Wl,-Map,$(PRG).map
39 override ASFLAGS           = -mmcu=$(MCU_TARGET)
40
41 OBJCOPY = avr-objcopy
42 OBJDUMP = avr-objdump
43
44 all: $(PRG).elf lst text eeprom
45
46 $(PRG).elf: $(OBJ)
47         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
48
49 #rc6-test: 
50
51 clean:
52         rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak 
53         rm -rf *.lst *.map $(EXTRA_CLEAN_FILES)
54
55 flash:
56         $(ERASECMD)
57         $(FLASHCMD)
58         
59 lst:  $(PRG).lst
60
61 %.lst: %.elf
62         $(OBJDUMP) -h -S $< > $@
63
64 # Rules for building the .text rom images
65
66 text: hex bin srec
67
68 hex:  $(PRG).hex
69 bin:  $(PRG).bin
70 srec: $(PRG).srec
71
72 %.hex: %.elf
73         $(OBJCOPY) -j .text -j .data -O ihex $< $@
74
75 %.srec: %.elf
76         $(OBJCOPY) -j .text -j .data -O srec $< $@
77
78 %.bin: %.elf
79         $(OBJCOPY) -j .text -j .data -O binary $< $@
80
81 # Rules for building the .eeprom rom images
82
83 eeprom: ehex ebin esrec
84
85 ehex:  $(PRG)_eeprom.hex
86 ebin:  $(PRG)_eeprom.bin
87 esrec: $(PRG)_eeprom.srec
88
89 %_eeprom.hex: %.elf
90         $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@
91
92 %_eeprom.srec: %.elf
93         $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O srec $< $@
94
95 %_eeprom.bin: %.elf
96         $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O binary $< $@
97
98 # Every thing below here is used by avr-libc's build system and can be ignored
99 # by the casual user.
100
101 FIG2DEV          = fig2dev
102 EXTRA_CLEAN_FILES       = *.hex *.bin *.srec
103
104 dox: eps png pdf
105
106 eps: $(PRG).eps
107 png: $(PRG).png
108 pdf: $(PRG).pdf
109
110 %.eps: %.fig
111         $(FIG2DEV) -L eps $< $@
112
113 %.pdf: %.fig
114         $(FIG2DEV) -L pdf $< $@
115
116 %.png: %.fig
117         $(FIG2DEV) -L png $< $@