blob: f87a364f89965838e90bd52cb02bb728e3eaff64 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
#CC = avr-gcc
#CFLAGS = -Wall -mmcu=atmega16 -Os -Wl,-Map,test.map
#OBJCOPY = avr-objcopy
CC = gcc
LD = gcc
CFLAGS = -Wall -Os -c
LDFLAGS = -Wall -Os -Wl,-Map,test.map
ifdef AES192
CFLAGS += -DAES192=1
endif
ifdef AES256
CFLAGS += -DAES256=1
endif
OBJCOPYFLAFS = -j .text -O ihex
OBJCOPY = objcopy
# include path to AVR library
INCLUDE_PATH = /usr/lib/avr/include
# splint static check
SPLINT = splint test.c aes.c -I$(INCLUDE_PATH) +charindex -unrecog
default: test.elf
.SILENT:
.PHONY: lint clean
test.hex : test.elf
echo copy object-code to new image and format in hex
$(OBJCOPY) ${OBJCOPYFLAFS} $< $@
test.o : test.c aes.h aes.o
echo [CC] $@ $(CFLAGS)
$(CC) $(CFLAGS) -o $@ $<
aes.o : aes.c aes.h
echo [CC] $@ $(CFLAGS)
$(CC) $(CFLAGS) -o $@ $<
test.elf : aes.o test.o
echo [LD] $@
$(LD) $(LDFLAGS) -o $@ $^
clean:
rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
test:
make clean && make && ./test.elf
make clean && make AES192=1 && ./test.elf
make clean && make AES256=1 && ./test.elf
lint:
$(call SPLINT)
|