-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
109 lines (84 loc) · 2.8 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
STDFLAGS:=-std=c++17
PREFIX:=/usr/local
DEBUGFLAGS:=-g -O0 ${STDFLAGS} -DDEBUG
RELEASEFLAGS:=-O3 ${STDFLAGS} -DNDEBUG
#dev
CXXFLAGS:=${DEBUGFLAGS}
#-g -O0 -DDEBUG ${STDFLAGS}
#distr
#CXXFLAGS:=${STDFLAGS}
#export CXXFLAGS
all: export CXXFLAGS:=${DEBUGFLAGS}
all: targets
debug: export CXXFLAGS:=${DEBUGFLAGS}
debug: targets
release: export CXXFLAGS:=${RELEASEFLAGS}
release: targets
cryptos-debug: export CXXFLAGS:=${DEBUGFLAGS} -DCRYPTOS
cryptos-debug: targets
cryptos-release: export CXXFLAGS:=${RELEASEFLAGS} -DCRYPTOS
cryptos-release: targets
targets: gov/libusgov.so wallet/libuswallet.so govx/us-gov walletx/us-wallet
wallet-debug: export CXXFLAGS:=${DEBUGFLAGS}
wallet-debug: wallet
wallet-release: export CXXFLAGS:=${RELEASEFLAGS}
wallet-release: wallet
gov: govx/us-gov
wallet: walletx/us-wallet
install: release
install gov/libusgov.so ${PREFIX}/lib
install wallet/libuswallet.so ${PREFIX}/lib
install govx/us-gov ${PREFIX}/bin
install walletx/us-wallet ${PREFIX}/bin
ifeq ($(NOFCGI),1)
install etc/init.d/us-wallet /etc/init.d/
else
cat etc/init.d/us-wallet | sed "s/\(^DAEMON_ARGS=\".*\)\" *#A; INSTALLER.*/\1 -fcgi -json \"/" >/tmp/usgif
cat /tmp/usgif | sed "s@^\(DAEMON=\"\).*\" *#D; INSTALLER.*@\1/usr/bin/spawn-fcgi -p 9000 -n /usr/local/bin/us-wallet -- \"@" >/tmp/us-wallet
install /tmp/us-wallet /etc/init.d/
rm /tmp/usgif
rm /tmp/us-wallet
endif
install etc/init.d/us-gov /etc/init.d/
ldconfig
systemctl daemon-reload
cryptos-install: cryptos-release
install gov/libusgov.so ${PREFIX}/lib
install wallet/libuswallet.so ${PREFIX}/lib
install govx/us-gov ${PREFIX}/bin
install walletx/us-wallet ${PREFIX}/bin
install cryptos/etc/init.d/us-wallet /etc/init.d/
install cryptos/etc/init.d/us-gov /etc/init.d/
ldconfig /usr/local/lib
install-nginx:
install etc/nginx/sites_available/us-wallet-api.conf /etc/nginx/sites-available
install etc/nginx/snippets/snakeoil.conf /etc/nginx/snippets/
install etc/ssl/certs/ssl-cert-snakeoil.pem /etc/ssl/certs/
install etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/private/
install var/www/html/index.html /var/www/html/
gov/libusgov.so: api/apitool_generated__*
$(MAKE) CXXFLAGS="${CXXFLAGS} -fPIC" -C gov;
govx/us-gov: gov/libusgov.so
$(MAKE) CXXFLAGS="${CXXFLAGS}" -C govx;
wallet/libuswallet.so: gov/libusgov.so api/apitool_generated__*
$(MAKE) CXXFLAGS="${CXXFLAGS} -fPIC" -C wallet;
walletx/us-wallet: wallet/libuswallet.so
ifeq ($(NOFCGI),1)
$(MAKE) CXXFLAGS="${CXXFLAGS}" -C walletx ;
else
$(MAKE) CXXFLAGS="${CXXFLAGS}" FCGI=1 -C walletx ;
endif
api/apitool_generated__*: api/apitool
api/apitool:
$(MAKE) CXXFLAGS="${CXXFLAGS}" -C api ;
.PHONY: all
.PHONY: wallet
.PHONY: gov
.PHONY: debug
.PHONY: release
clean:
$(MAKE) clean -C gov; \
$(MAKE) clean -C govx; \
$(MAKE) clean -C wallet; \
$(MAKE) clean -C walletx; \
$(MAKE) clean -C api;