tiny-AES-c/Makefile

44 lines
872 B
Makefile
Raw Normal View History

2014-05-29 04:21:30 +04:00
#CC = avr-gcc
#CFLAGS = -Wall -mmcu=atmega16 -Os -Wl,-Map,test.map
#OBJCOPY = avr-objcopy
CC = gcc
2017-12-05 15:27:53 +03:00
LD = gcc
CFLAGS = -Wall -Os -c
LDFLAGS = -Wall -Os -Wl,-Map,test.map
OBJCOPYFLAFS = -j .text -O ihex
2014-05-29 04:21:30 +04:00
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
2017-12-05 15:27:53 +03:00
default: test.elf
2014-05-29 04:21:30 +04:00
.SILENT:
.PHONY: lint clean
2017-12-05 15:27:53 +03:00
test.hex : test.elf
echo copy object-code to new image and format in hex
$(OBJCOPY) ${OBJCOPYFLAFS} $< $@
2014-05-29 04:21:30 +04:00
2017-12-05 15:27:53 +03:00
test.o : test.c aes.h aes.o
echo [CC] $@
$(CC) $(CFLAGS) -o $@ $<
2014-05-29 04:21:30 +04:00
2017-12-05 15:27:53 +03:00
aes.o : aes.c aes.h
echo [CC] $@
$(CC) $(CFLAGS) -o $@ $<
2014-05-29 04:21:30 +04:00
2017-12-05 15:27:53 +03:00
test.elf : aes.o test.o
echo [LD] $@
$(LD) $(LDFLAGS) -o $@ $^
2014-05-29 04:21:30 +04:00
clean:
rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
lint:
$(call SPLINT)