diff options
Diffstat (limited to 'test/monniaux/tiny-AES-c/Makefile')
-rw-r--r-- | test/monniaux/tiny-AES-c/Makefile | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/monniaux/tiny-AES-c/Makefile b/test/monniaux/tiny-AES-c/Makefile new file mode 100644 index 00000000..e9d821b3 --- /dev/null +++ b/test/monniaux/tiny-AES-c/Makefile @@ -0,0 +1,61 @@ +#CC = avr-gcc +#CFLAGS = -Wall -mmcu=atmega16 -Os -Wl,-Map,test.map +#OBJCOPY = avr-objcopy +CC = ../../../ccomp +LD = ../../../ccomp +AR = ar +ARFLAGS = rcs +CFLAGS = -Wall -Wno-c11-extensions -O3 -c +LDFLAGS = -Wall -O3 # -Wl,-Map,test.map +ifdef AES192 +CFLAGS += -DAES192=1 +endif +ifdef AES256 +CFLAGS += -DAES256=1 +endif + +OBJCOPYFLAGS = -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) ${OBJCOPYFLAGS} $< $@ + +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 $@ $^ + +aes.a : aes.o + echo [AR] $@ + $(AR) $(ARFLAGS) $@ $^ + +lib : aes.a + +clean: + rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map *.elf *.a + +test: + make clean && make && ./test.elf + make clean && make AES192=1 && ./test.elf + make clean && make AES256=1 && ./test.elf + +lint: + $(call SPLINT) |