-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
75 lines (51 loc) · 1.36 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
TARGET=crypt
LIB=./lib/
PREFIX=/usr/local/bin/
SOURCES=main.cpp
GCC=$(CFLAGS) g++ -std=c++11 -Wall -Wextra -pedantic -O2 -march=native
HASH=hash_3411
KDF=pbkdf2
ELLIPTIC=elliptic
CIPHER=cipher_3412
MODE=ofbmode
#LIBFILES=$(LIB)lib$(HASH).so $(LIB)lib$(KDF).so \
$(LIB)lib$(ELLIPTIC).so $(LIB)lib$(CIPHER).so $(LIB)lib$(MODE).so
LIBMAKE=$(MAKE) static
#LIBS=-l$(HASH) -l$(KDF) -l$(ELLIPTIC) -l$(CIPHER) -l$(MODE)
LIBS=$(LIB)lib$(HASH).a $(LIB)lib$(KDF).a $(LIB)lib$(ELLIPTIC).a \
$(LIB)lib$(CIPHER).a $(LIB)lib$(MODE).a
#LDFLAGS=-L$(LIB) $(LIBS) -Wl,-rpath,$(LIB)
LDFLAGS=$(LIBS)
TARGETECHO=@echo -e "\033[00;36mBuilding \033[00;32m$@\033[00m"
.PHONY: all clean install uninstall libs
all: $(TARGET)
clean:
rm $(TARGET)
$(TARGET): $(SOURCES) libs
$(TARGETECHO)
$(GCC) $(SOURCES) $(LDFLAGS) -o $(TARGET) -lgmp -lgmpxx
libs: $(LIBS) #$(LIBFILES)
$(LIB)lib$(HASH).a: ./hash/*
$(TARGETECHO)
@cd ./hash && $(LIBMAKE)
@echo
$(LIB)lib$(KDF).a: ./pbkdf2/*
$(TARGETECHO)
@cd ./pbkdf2 && $(LIBMAKE)
@echo
$(LIB)lib$(ELLIPTIC).a: ./elliptic/*
$(TARGETECHO)
@cd ./elliptic && $(LIBMAKE)
@echo
$(LIB)lib$(CIPHER).a: ./kuznyechik/
$(TARGETECHO)
@cd ./kuznyechik && $(LIBMAKE)
@echo
$(LIB)lib$(MODE).a: ./mode/ofb/*
$(TARGETECHO)
@cd ./mode/ofb && $(LIBMAKE)
@echo
install: all
install --mode=0644 -t $(PREFIX) $(TARGET)
uninstall:
-rm $(PREFIX)$(TARGET)