solo1/Makefile

59 wiersze
1.7 KiB
Makefile
Czysty Zwykły widok Historia

2018-05-07 00:14:52 +00:00
#define uECC_arch_other 0
#define uECC_x86 1
#define uECC_x86_64 2
#define uECC_arm 3
#define uECC_arm_thumb 4
#define uECC_arm_thumb2 5
#define uECC_arm64 6
#define uECC_avr 7
platform=2
src = $(wildcard pc/*.c) $(wildcard fido2/*.c) $(wildcard crypto/sha256/*.c) crypto/tiny-AES-c/aes.c
2018-05-07 00:14:52 +00:00
obj = $(src:.c=.o) uECC.o
2018-04-28 17:40:28 +00:00
LDFLAGS = -Wl,--gc-sections ./tinycbor/lib/libtinycbor.a
CFLAGS = -O2 -fdata-sections -ffunction-sections
INCLUDES = -I./tinycbor/src -I./crypto/sha256 -I./crypto/micro-ecc/ -Icrypto/tiny-AES-c/ -I./fido2/ -I./pc
CFLAGS += $(INCLUDES)
2018-04-28 17:40:28 +00:00
name = main
2018-05-26 15:36:55 +00:00
all: main
cbor:
cd tinycbor/ && $(MAKE) clean && $(MAKE) -j8
2018-05-26 15:36:55 +00:00
test: testgcm
2018-07-03 03:10:23 +00:00
efm8prog:
2018-07-09 02:36:16 +00:00
cd '.\efm8\Keil 8051 v9.53 - Debug' && $(MAKE) all
2018-07-04 16:48:18 +00:00
flashefm8.exe -part EFM8UB10F8G -sn 440105518 -erase
2018-07-03 03:10:23 +00:00
flashefm8.exe -part EFM8UB10F8G -sn 440105518 -upload '.\efm8\Keil 8051 v9.53 - Debug\efm8.hex'
2018-07-14 00:29:14 +00:00
efm32com:
cd '.\efm32\GNU ARM v7.2.1 - Debug' && $(MAKE) all
2018-07-03 03:10:23 +00:00
efm32prog:
2018-07-09 02:36:16 +00:00
cd '.\efm32\GNU ARM v7.2.1 - Debug' && $(MAKE) all
2018-07-03 03:10:23 +00:00
commander flash '.\efm32\GNU ARM v7.2.1 - Debug\EFM32.hex' -s 440121060
2018-07-15 03:03:25 +00:00
efm32bootprog:
cd '.\efm32boot\GNU ARM v7.2.1 - Debug' && $(MAKE) all
commander flash '.\efm32boot\GNU ARM v7.2.1 - Debug\efm32boot.hex' -s 440121060
2018-04-28 17:40:28 +00:00
$(name): $(obj)
$(CC) $(LDFLAGS) -o $@ $(obj) $(LDFLAGS)
2018-05-03 02:52:41 +00:00
2018-05-26 15:36:55 +00:00
testgcm: $(obj)
$(CC) -c main.c $(CFLAGS) -DTEST -o main.o
$(CC) -c crypto/aes_gcm.c $(CFLAGS) -DTEST -o crypto/aes_gcm.o
$(CC) $(LDFLAGS) -o $@ $^ $(LDFLAGS)
2018-05-07 00:14:52 +00:00
uECC.o: ./crypto/micro-ecc/uECC.c
$(CC) -c -o $@ $^ -O2 -fdata-sections -ffunction-sections -DuECC_PLATFORM=$(platform) -I./crypto/micro-ecc/
2018-05-03 02:52:41 +00:00
clean:
2018-05-26 15:36:55 +00:00
rm -f *.o main.exe main crypto/tiny-AES-c/*.o crypto/*.o crypto/micro-ecc/*.o