| Rev | Line | |
|---|
| [1] | 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 |
|
|---|
| 8 | # include path to AVR library
|
|---|
| 9 | INCLUDE_PATH = /usr/lib/avr/include
|
|---|
| 10 | # splint static check
|
|---|
| 11 | SPLINT = splint test.c aes.c -I$(INCLUDE_PATH) +charindex -unrecog
|
|---|
| 12 |
|
|---|
| 13 | .SILENT:
|
|---|
| 14 | .PHONY: lint clean
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | rom.hex : test.out
|
|---|
| 18 | # copy object-code to new image and format in hex
|
|---|
| 19 | $(OBJCOPY) -j .text -O ihex test.out rom.hex
|
|---|
| 20 |
|
|---|
| 21 | test.o : test.c
|
|---|
| 22 | # compiling test.c
|
|---|
| 23 | $(CC) $(CFLAGS) -c test.c -o test.o
|
|---|
| 24 |
|
|---|
| 25 | aes.o : aes.h aes.c
|
|---|
| 26 | # compiling aes.c
|
|---|
| 27 | $(CC) $(CFLAGS) -c aes.c -o aes.o
|
|---|
| 28 |
|
|---|
| 29 | test.out : aes.o test.o
|
|---|
| 30 | # linking object code to binary
|
|---|
| 31 | $(CC) $(CFLAGS) aes.o test.o -o test.out
|
|---|
| 32 |
|
|---|
| 33 | small: test.out
|
|---|
| 34 | $(OBJCOPY) -j .text -O ihex test.out rom.hex
|
|---|
| 35 |
|
|---|
| 36 | clean:
|
|---|
| 37 | rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
|
|---|
| 38 |
|
|---|
| 39 | lint:
|
|---|
| 40 | $(call SPLINT)
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.