summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkokke <spam@rowdy.dk>2014-05-29 02:21:30 +0200
committerkokke <spam@rowdy.dk>2014-05-29 02:21:30 +0200
commit698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e (patch)
tree6bba7eedbb9106584190ebf1eb38c48a7392db1f
parentCreate aes.h (diff)
downloadtiny-AES-c-698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e.tar
tiny-AES-c-698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e.tar.gz
tiny-AES-c-698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e.tar.bz2
tiny-AES-c-698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e.tar.lz
tiny-AES-c-698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e.tar.xz
tiny-AES-c-698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e.tar.zst
tiny-AES-c-698375cfe6582c1e8f1b90f5ef0e6dfb6d99476e.zip
-rw-r--r--Makefile40
1 files changed, 40 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..55af9bc
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,40 @@
+#CC = avr-gcc
+#CFLAGS = -Wall -mmcu=atmega16 -Os -Wl,-Map,test.map
+#OBJCOPY = avr-objcopy
+CC = gcc
+CFLAGS = -Wall -Os -Wl,-Map,test.map
+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
+
+.SILENT:
+.PHONY: lint clean
+
+
+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
+
+aes.o : aes.h aes.c
+ # compiling aes.c
+ $(CC) $(CFLAGS) -c aes.c -o aes.o
+
+test.out : aes.o test.o
+ # linking object code to binary
+ $(CC) $(CFLAGS) aes.o test.o -o test.out
+
+small: test.out
+ $(OBJCOPY) -j .text -O ihex test.out rom.hex
+
+clean:
+ rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
+
+lint:
+ $(call SPLINT)