Makefile now can setup the necessary dirs for compiling

This commit is contained in:
infidel 2022-03-27 16:23:43 +07:00
parent cb8f6c63bb
commit 9fdcb7736b
2 changed files with 19 additions and 15 deletions

View File

@ -2,9 +2,9 @@
## References ## References
- ![Implementation 1](http://192.168.2.34/infidel/NTRU_IoT/raw/branch/master/assets/NTRU_IoT_Marcelino.pdf) - ![Implementation 1](https://git.nnag.me/infidel/NTRU_IoT/raw/branch/master/assets/NTRU_IoT_Marcelino.pdf)
- ![Implementation 2](http://192.168.2.34/infidel/NTRU_IoT/raw/branch/master/assets/IEMS_GBS.pdf) - ![Implementation 2](https://git.nnag.me/infidel/NTRU_IoT/raw/branch/master/assets/IEMS_GBS.pdf)
- ![Logic Gate](http://192.168.2.34/infidel/NTRU_IoT/raw/branch/master/assets/ntru.png) - ![Logic Gate](https://git.nnag.me/infidel/NTRU_IoT/raw/branch/master/assets/ntru.png)
## Infidel Code ## Infidel Code
@ -19,4 +19,4 @@
- Weirds Things - Weirds Things
## Future Implementation : esp, atmel ## Future Implementation : esp, atmel
![Runner](http://192.168.2.34/infidel/NTRU_IoT/raw/branch/master/assets/High-speed-NTRU-architecture.png) ![Runner](https://git.nnag.me/infidel/NTRU_IoT/raw/branch/master/assets/High-speed-NTRU-architecture.png)

View File

@ -2,36 +2,40 @@ CC=sccache gcc
CFLAGS=-I include -I test -w CFLAGS=-I include -I test -w
SFLAGS=-shared -fPIC SFLAGS=-shared -fPIC
DEPS:=$(shell cat ./satan.txt) DEPS:=$(shell cat ./satan.txt)
MAKEFLAGS += --silent MAKEFLAGS += --silent
TARGET_DIR = bin
all: enc_593.so dec_593.so enc_401.so dec_401.so test_401_full test_593_full all: enc_593.so dec_593.so enc_401.so dec_401.so test_401_full test_593_full
@echo "Compiled " $@ @echo "Compiled " $@
test_401_full: test_401_full: $(TARGET_DIR)
$(CC) $(DEPS) EES401/URG_Keygen.c -o bin/$@ $(CFLAGS) $(CC) $(DEPS) EES401/URG_Keygen.c -o $(TARGET_DIR)/$@ $(CFLAGS)
@echo "Compiled " $@ @echo "Compiled " $@
test_593_full: test_593_full:
$(CC) $(DEPS) EES593/URG_Keygen.c -o bin/$@ $(CFLAGS) $(CC) $(DEPS) EES593/URG_Keygen.c -o $(TARGET_DIR)/$@ $(CFLAGS)
@echo "Compiled " $@ @echo "Compiled " $@
enc_593.so: enc_593.so: $(TARGET_DIR)
$(CC) $(SFLAGS) $(DEPS) EES593/URG_encrypt.c -o bin/$@ $(CFLAGS) $(CC) $(SFLAGS) $(DEPS) EES593/URG_encrypt.c -o $(TARGET_DIR)/$@ $(CFLAGS)
@echo "Compiled " $@ @echo "Compiled " $@
dec_593.so: dec_593.so:
$(CC) $(SFLAGS) $(DEPS) EES593/URG_decrypt.c -o bin/$@ $(CFLAGS) $(CC) $(SFLAGS) $(DEPS) EES593/URG_decrypt.c -o $(TARGET_DIR)/$@ $(CFLAGS)
@echo "Compiled " $@ @echo "Compiled " $@
enc_401.so: enc_401.so:
$(CC) $(SFLAGS) $(DEPS) EES401/URG_encrypt.c -o bin/$@ $(CFLAGS) $(CC) $(SFLAGS) $(DEPS) EES401/URG_encrypt.c -o $(TARGET_DIR)/$@ $(CFLAGS)
@echo "Compiled " $@ @echo "Compiled " $@
dec_401.so: dec_401.so:
$(CC) $(SFLAGS) $(DEPS) EES401/URG_decrypt.c -o bin/$@ $(CFLAGS) $(CC) $(SFLAGS) $(DEPS) EES401/URG_decrypt.c -o $(TARGET_DIR)/$@ $(CFLAGS)
@echo "Compiled " $@ @echo "Compiled " $@
bin:
test ! -d $(TARGET_DIR) && mkdir $(TARGET_DIR)
clean: clean:
@rm bin/* @rm $(TARGET_DIR)/*
@echo "Bin Cleaned ... " @echo "$(TARGET_DIR) Cleaned ... "