-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
123 lines (99 loc) · 2.24 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
sinclude config.mk
OPENSSL_PREFIX?= /usr
OPENSSL_SRC?=
OPENSSL_INC?= $(OPENSSL_PREFIX)/include
OPENSSL_LIB?= $(OPENSSL_PREFIX)/lib
# Mute clang color-based warnings.
#CFLAGS+= -fno-color-diagnostics
CFLAGS+= -Wall -g -O0 -I$(OPENSSL_INC)
CFLAGS+= -std=c99
LDLIBS+= -lcrypto -lssl
LDFLAGS= -L$(OPENSSL_LIB) -L$(OPENSSL_LIB)/ossl-modules
LDFLAGS+= -Wl,-rpath,$(OPENSSL_LIB) -Wl,-rpath,$(OPENSSL_LIB)/ossl-modules
RM?= rm -f
CPP_FILES+= asn1.i
CPP_FILES+= err.i
PROGS+= array-overflow
PROGS+= asn1
PROGS+= basic
PROGS+= bignum
PROGS+= bio
PROGS+= bio_in_mem
PROGS+= bio_in_mem_nodejs
PROGS+= bio_read_file
PROGS+= bio_ssl
PROGS+= decoder
# XXX: dh segfaults with 3.0.9.
#PROGS+= dh
PROGS+= dh_1_1_1
PROGS+= distribution
PROGS+= digest
PROGS+= dsa
PROGS+= ec
PROGS+= ec-keygen
PROGS+= err
ifneq ($(OPENSSL_SRC),)
# XXX: requires internal headers; doesn't compile with prebuilt binary packages.
PROGS+= evp-pkey
endif
# XXX: does not compile/link (bad symbols).
PROGS+= fips-provider
PROGS+= generator
PROGS+= hash
PROGS+= hmac
PROGS+= is_fips_enabled
PROGS+= keymgmt
PROGS+= pem_key_read
PROGS+= private
PROGS+= provider
PROGS+= rand
PROGS+= rand_status
PROGS+= rsa
PROGS+= rsa_data_too_large
PROGS+= rsa_pss
PROGS+= rsa_sign
PROGS+= store
PROGS+= x509
PROGS+= random_bytes
PROGS+= socket
PROGS+= sign
PROGS+= ssl
PROGS+= wrong-tag
PROGS+= wrong-tag2
LIBS+= libcprovider.so
LIBS+= libengine.so
asn1.i: asn1.c
WNO_ERROR_DEPRECATED= -Wno-error=deprecated
array-overflow.o: src/array-overflow.c
$(COMPILE.c) $<
dh: CFLAGS+= $(WNO_ERROR_DEPRECATED)
ec: CFLAGS+= $(WNO_ERROR_DEPRECATED)
ec-keygen: LDLIBS+= -lpthread
engine.o: CFLAGS+= -fPIC
libengine.so: engine.o
$(CC) -shared -fPIC $(CFLAGS) $(LDFLAGS) -o $@ $^
err.i: err.c
%.i: %.c
$(CC) -E $(CFLAGS) $(OUTPUT_OPTION) $<
%.i: %.cc
$(CXX) -E $(CXXFLAGS) $(OUTPUT_OPTION) $<
evp-pkey: CFLAGS+= $(WNO_ERROR_DEPRECATED)
keymgmt: LDLIBS+= -lpthread
cprovider.o: CFLAGS+= -fPIC -I.
libcprovider.so: cprovider.o
$(CC) -shared -fPIC $(CFLAGS) $(LDFLAGS) -o $@ $^
.DEFAULT: all
all: $(CPP_FILES) $(LIBS) $(PROGS)
.PHONY: run
run: $(PROGS)
for prog in $(PROGS); do \
printf "%s ...\n" "$$prog"; \
./$$prog; \
done; \
./test_engine.sh
.PHONY: clean
clean:
$(RM) $(CPP_FILES)
$(RM) $(LIBS)
$(RM) $(PROGS)
$(RM) *.o