summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorStoian Ivanov <s.ivanov@teracomm.bg>2017-12-05 13:27:53 +0100
committerStoian Ivanov <s.ivanov@teracomm.bg>2017-12-05 13:29:19 +0100
commit1e86fddb216b05b3de59bb59db5808f0a0861466 (patch)
tree4e4b2ab4ed567b048a65100bfb5ddd94bfa2544c /Makefile
parentmake thead safe via context pram; remove padding as non working; opitmise abit (diff)
downloadtiny-AES-c-1e86fddb216b05b3de59bb59db5808f0a0861466.tar
tiny-AES-c-1e86fddb216b05b3de59bb59db5808f0a0861466.tar.gz
tiny-AES-c-1e86fddb216b05b3de59bb59db5808f0a0861466.tar.bz2
tiny-AES-c-1e86fddb216b05b3de59bb59db5808f0a0861466.tar.lz
tiny-AES-c-1e86fddb216b05b3de59bb59db5808f0a0861466.tar.xz
tiny-AES-c-1e86fddb216b05b3de59bb59db5808f0a0861466.tar.zst
tiny-AES-c-1e86fddb216b05b3de59bb59db5808f0a0861466.zip
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 19 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index 55af9bc..3b875af 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,11 @@
#CFLAGS = -Wall -mmcu=atmega16 -Os -Wl,-Map,test.map
#OBJCOPY = avr-objcopy
CC = gcc
-CFLAGS = -Wall -Os -Wl,-Map,test.map
+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
@@ -10,28 +14,27 @@ 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} $< $@
-rom.hex : test.out
- # copy object-code to new image and format in hex
- $(OBJCOPY) -j .text -O ihex test.out rom.hex
-
-test.o : test.c
- # compiling test.c
- $(CC) $(CFLAGS) -c test.c -o test.o
+test.o : test.c aes.h aes.o
+ echo [CC] $@
+ $(CC) $(CFLAGS) -o $@ $<
-aes.o : aes.h aes.c
- # compiling aes.c
- $(CC) $(CFLAGS) -c aes.c -o aes.o
+aes.o : aes.c aes.h
+ echo [CC] $@
+ $(CC) $(CFLAGS) -o $@ $<
-test.out : aes.o test.o
- # linking object code to binary
- $(CC) $(CFLAGS) aes.o test.o -o test.out
+test.elf : aes.o test.o
+ echo [LD] $@
+ $(LD) $(LDFLAGS) -o $@ $^
-small: test.out
- $(OBJCOPY) -j .text -O ihex test.out rom.hex
clean:
rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map