mirror of
https://github.com/kokke/tiny-AES-c
synced 2024-11-25 06:49:37 +03:00
44 lines
872 B
Makefile
44 lines
872 B
Makefile
#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
|
|
|
|
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] $@
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
aes.o : aes.c aes.h
|
|
echo [CC] $@
|
|
$(CC) $(CFLAGS) -o $@ $<
|
|
|
|
test.elf : aes.o test.o
|
|
echo [LD] $@
|
|
$(LD) $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
clean:
|
|
rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
|
|
|
|
lint:
|
|
$(call SPLINT)
|