Makefile 896 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #CC = avr-gcc
  2. #CFLAGS = -Wall -mmcu=atmega16 -Os -Wl,-Map,test.map
  3. #OBJCOPY = avr-objcopy
  4. CC = gcc
  5. CFLAGS = -Wall -Os -Wl,-Map,test.map
  6. OBJCOPY = objcopy
  7. # include path to AVR library
  8. INCLUDE_PATH = /usr/lib/avr/include
  9. # splint static check
  10. SPLINT = splint test.c aes.c -I$(INCLUDE_PATH) +charindex -unrecog
  11. .SILENT:
  12. .PHONY: lint clean
  13. rom.hex : test.out
  14. # copy object-code to new image and format in hex
  15. $(OBJCOPY) -j .text -O ihex test.out rom.hex
  16. test.o : test.c
  17. # compiling test.c
  18. $(CC) $(CFLAGS) -c test.c -o test.o
  19. aes.o : aes.h aes.c
  20. # compiling aes.c
  21. $(CC) $(CFLAGS) -c aes.c -o aes.o
  22. test.out : aes.o test.o
  23. # linking object code to binary
  24. $(CC) $(CFLAGS) aes.o test.o -o test.out
  25. small: test.out
  26. $(OBJCOPY) -j .text -O ihex test.out rom.hex
  27. clean:
  28. rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
  29. lint:
  30. $(call SPLINT)