Start some cleanup
- add an editorconfig - fix requirements.txt and the UTF-8 issue (lost in pull/47) - two clean environments - make black usable - two test targets (wink2/wink3)
This commit is contained in:
38
Makefile
38
Makefile
@@ -7,7 +7,7 @@
|
||||
#define uECC_arm64 6
|
||||
#define uECC_avr 7
|
||||
|
||||
platform=2
|
||||
ecc_platform=2
|
||||
|
||||
EFM32_DEBUGGER= -s 440083537 --device EFM32JG1B200F128GM32
|
||||
#EFM32_DEBUGGER= -s 440121060 #dev board
|
||||
@@ -29,7 +29,7 @@ INCLUDES = -I./tinycbor/src -I./crypto/sha256 -I./crypto/micro-ecc/ -Icrypto/tin
|
||||
|
||||
CFLAGS += $(INCLUDES)
|
||||
# for crypto/tiny-AES-c
|
||||
CFLAGS += -DAES256=1 -DAPP_CONFIG=\"app.h\"
|
||||
CFLAGS += -DAES256=1 -DAPP_CONFIG=\"app.h\"
|
||||
|
||||
name = main
|
||||
|
||||
@@ -68,29 +68,33 @@ $(name): $(obj) $(LIBCBOR)
|
||||
$(CC) $(LDFLAGS) -o $@ $(obj) $(LDFLAGS)
|
||||
|
||||
uECC.o: ./crypto/micro-ecc/uECC.c
|
||||
$(CC) -c -o $@ $^ -O2 -fdata-sections -ffunction-sections -DuECC_PLATFORM=$(platform) -I./crypto/micro-ecc/
|
||||
$(CC) -c -o $@ $^ -O2 -fdata-sections -ffunction-sections -DuECC_PLATFORM=$(ecc_platform) -I./crypto/micro-ecc/
|
||||
|
||||
env2:
|
||||
virtualenv env2
|
||||
env2/bin/pip install -r tools/requirements.txt
|
||||
|
||||
# python virtualenv
|
||||
env3:
|
||||
python3 -m venv env3
|
||||
env3/bin/pip install -r tools/requirements.txt
|
||||
env3/bin/pip install black
|
||||
|
||||
venv:
|
||||
@if ! which virtualenv >/dev/null ; then \
|
||||
echo "ERR: Sorry, no python virtualenv found. Please consider installing " ;\
|
||||
echo " it via something like:" ;\
|
||||
echo " sudo apt install python-virtualenv" ;\
|
||||
echo " or maybe:" ;\
|
||||
echo " pip install virtualenv" ;\
|
||||
fi
|
||||
virtualenv venv
|
||||
./venv/bin/pip install wheel
|
||||
# selectively reformat our own code
|
||||
black: env3
|
||||
env3/bin/black -S tools/
|
||||
|
||||
wink2: env2
|
||||
env2/bin/python tools/solotool.py solo --wink
|
||||
|
||||
.PHONY: fido2-test
|
||||
fido2-test:
|
||||
./venv/bin/python tools/ctap_test.py
|
||||
wink3: env3
|
||||
env3/bin/python tools/solotool.py solo --wink
|
||||
|
||||
fido2-test: env3
|
||||
env3/bin/python tools/ctap_test.py
|
||||
|
||||
clean:
|
||||
rm -f *.o main.exe main $(obj)
|
||||
rm -rf env2 env3
|
||||
for f in crypto/tiny-AES-c/Makefile tinycbor/Makefile ; do \
|
||||
if [ -f "$$f" ]; then \
|
||||
(cd `dirname $$f` ; git checkout -- .) ;\
|
||||
|
Reference in New Issue
Block a user