-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
42 lines (32 loc) · 1.21 KB
/
makefile
File metadata and controls
42 lines (32 loc) · 1.21 KB
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
include .env
export $(shell sed 's/=.*//' .env)
SRC := $(wildcard src/*.c)
OBJ := $(subst .c,.o,$(SRC))
ENGINE := engine
CFLAGS := -Wall -O3
CINCLD := -I../openssl/ -I../openssl/crypto/include -I../openssl/include -I/lib -I/engine
CNF_CFLAGS := -pthread -m64 -Wa,--noexecstack
LIB_CFLAGS := -fPIC $(CNF_CFLAGS) $(CFLAGS) -iquote $(_ROOT)/openssl/include/
$(ENGINE)/engineInterface.o : $(ENGINE)/engine.so $(ENGINE)/engineInterface.cpp
@g++ -o $(ENGINE)/engineInterface.o $(ENGINE)/engineInterface.cpp -L/usr/local/lib/ -lssl -lecvrf -lcrypto
@engine/engineInterface.o
$(ENGINE)/engine.so : $(ENGINE)/engine.o
@gcc -shared -o $@ $^ -lssl -lcrypto
@openssl engine -t -c $(_ROOT)/algo/engine/engine.so
#engine.o : engine.c $(OBJ)
# @gcc $(CINCLD) $(LIB_CFLAGS) -o $@ -c $^ -lssl -lcrypto
$(ENGINE)/engine.o : $(ENGINE)/engine.c $(SRC)
@gcc $(CINCLD) $(LIB_CFLAGS) -o $@ -c engine/engine.c -lssl -lcrypto
#%.o : %.c
# @echo what
# @echo $^
# @gcc $(CINCLD) $(LIB_CFLAGS) -o $@ -c $^ -lssl -lcrypto
#%.o : %../.c
# @gcc $(CINCLD) $(LIB_CFLAGS) -o $*.o -c $*.c -lssl -lcrypto
# @gcc -M $*.c > $*.d
clean:
@rm -f $(ENGINE)/engineInterface.o
@rm -f $(ENGINE)/engine.o
@rm -f $(ENGINE)/engine.so
run:
@$(ENGINE)/engineInterface.o