mirror of
https://github.com/kokke/tiny-AES-c.git
synced 2025-01-08 12:36:19 +08:00
new target for building static library: make lib
This commit is contained in:
parent
f56dbc05ab
commit
3a28fc9a87
13
Makefile
13
Makefile
@ -3,6 +3,8 @@
|
|||||||
#OBJCOPY = avr-objcopy
|
#OBJCOPY = avr-objcopy
|
||||||
CC = gcc
|
CC = gcc
|
||||||
LD = gcc
|
LD = gcc
|
||||||
|
AR = ar
|
||||||
|
ARFLAGS = rcs
|
||||||
CFLAGS = -Wall -Os -c
|
CFLAGS = -Wall -Os -c
|
||||||
LDFLAGS = -Wall -Os -Wl,-Map,test.map
|
LDFLAGS = -Wall -Os -Wl,-Map,test.map
|
||||||
ifdef AES192
|
ifdef AES192
|
||||||
@ -12,7 +14,7 @@ ifdef AES256
|
|||||||
CFLAGS += -DAES256=1
|
CFLAGS += -DAES256=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJCOPYFLAFS = -j .text -O ihex
|
OBJCOPYFLAGS = -j .text -O ihex
|
||||||
OBJCOPY = objcopy
|
OBJCOPY = objcopy
|
||||||
|
|
||||||
# include path to AVR library
|
# include path to AVR library
|
||||||
@ -27,7 +29,7 @@ default: test.elf
|
|||||||
|
|
||||||
test.hex : test.elf
|
test.hex : test.elf
|
||||||
echo copy object-code to new image and format in hex
|
echo copy object-code to new image and format in hex
|
||||||
$(OBJCOPY) ${OBJCOPYFLAFS} $< $@
|
$(OBJCOPY) ${OBJCOPYFLAGS} $< $@
|
||||||
|
|
||||||
test.o : test.c aes.h aes.o
|
test.o : test.c aes.h aes.o
|
||||||
echo [CC] $@ $(CFLAGS)
|
echo [CC] $@ $(CFLAGS)
|
||||||
@ -41,9 +43,14 @@ test.elf : aes.o test.o
|
|||||||
echo [LD] $@
|
echo [LD] $@
|
||||||
$(LD) $(LDFLAGS) -o $@ $^
|
$(LD) $(LDFLAGS) -o $@ $^
|
||||||
|
|
||||||
|
aes.a : aes.o
|
||||||
|
echo [AR] $@
|
||||||
|
$(AR) $(ARFLAGS) $@ $^
|
||||||
|
|
||||||
|
lib : aes.a
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map
|
rm -f *.OBJ *.LST *.o *.gch *.out *.hex *.map *.elf *.a
|
||||||
|
|
||||||
test:
|
test:
|
||||||
make clean && make && ./test.elf
|
make clean && make && ./test.elf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user