-
Notifications
You must be signed in to change notification settings - Fork 21
/
Makefile.MGW
337 lines (275 loc) · 16.8 KB
/
Makefile.MGW
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
ifneq (,$(findstring /cygdrive/,$(PATH)))
OS := win
else
ifneq (,$(findstring WINDOWS,$(PATH)))
OS := win
else
OS := $(shell uname -s)
endif
endif
ifeq (OS,Darwin)
LANL := plugins/nonportable/Darwin/libanl.a
PLANL := nonportable/Darwin/libanl.a
else
LANL := -lanl
PLANL := -lanl
endif
PLIBS := ../libs/libjl777.a ../libs/libminiupnpc.a ../nanomsg/.libs/libnanomsg.a -lpthread -lcurl -lm $(PLANL)
LIBS= libs/libjl777.a nanomsg/.libs/libnanomsg.a libs/libminiupnpc.a -lpthread -lcurl -lm $(LANL)
CC=clang
CFLAGS=-Wall -D INSIDE_MGW -O2 -pedantic -g -fPIC -Iplugins/includes -Inanomsg/src -Inanomsg/src/utils -Iplugins/includes/libtom -Iplugins/includes/miniupnp -I.. -Iplugins/nonportable/$(OS) -Wno-unused-function -fPIC -fvisibility=hidden -fstack-protector-all -Wstack-protector -D_FORTIFY_SOURCE=2 #-Iplugins/utils -Iplugins/nonportable -Iincludes -Iplugins/mgw -Iplugins/InstantDEX -Iplugins/sophia -Iplugins/ramchain -Iplugins/coins -I../includes -I../../includes -I/usr/include -Iplugins#-DADDRINFO_SIZE=256
TARGET = libjl777.a
PICOC = picoc.c table.c lex.c parse.c expression.c heap.c type.c variable.c clibrary.c platform.c include.c \
platform/platform_unix.c platform/library_unix.c cstdlib/stdio.c cstdlib/math.c cstdlib/string.c cstdlib/stdlib.c \
cstdlib/time.c cstdlib/errno.c cstdlib/ctype.c cstdlib/stdbool.c cstdlib/unistd.c
GZIP = gzip/adler32.c gzip/crc32.c gzip/gzclose.c gzip/gzread.c gzip/infback.c gzip/inflate.c gzip/trees.c \
gzip/zutil.c gzip/compress.c gzip/deflate.c gzip/gzlib.c gzip/gzwrite.c gzip/inffast.c gzip/inftrees.c gzip/uncompr.c
LIBTOM = libtom/yarrow.c libtom/aes.c libtom/cast5.c libtom/khazad.c libtom/rc2.c libtom/safer.c libtom/skipjack.c \
libtom/aes_tab.c libtom/crypt_argchk.c libtom/kseed.c libtom/rc5.c libtom/saferp.c libtom/twofish.c \
libtom/anubis.c libtom/des.c libtom/multi2.c libtom/rc6.c libtom/safer_tab.c libtom/twofish_tab.c libgfshare.c \
libtom/blowfish.c libtom/kasumi.c libtom/noekeon.c libtom/rmd160.c libtom/sha256.c libtom/hmac_sha512.c libtom/xtea.c
U = plugins/utils
C = plugins/coins
R = plugins/ramchain
P = plugins/peggy
S = plugins/sophia
I = plugins/InstantDEX
K = plugins/KV
UTILS = $(U)/ramcoder.c $(U)/huffstream.c $(U)/inet.c $(U)/cJSON.c $(U)/bits777.c $(U)/NXT777.c $(U)/files777.c $(U)/utils777.c
#SOPHIA = $(S)/sophia.c $(S)/kv777_main.c $(S)/db777.c $(S)/kv777.c
PEGGY = $(P)/peggy777.c $(P)/quotes777.c #$(P)/serdes777.c $(P)/accts777.c #$(P)/peggytx.c
RAMCHAIN = $(R)/ramchain_main.c $(R)/ramchain.c # $(R)/gen1block.c
KV = $(K)/kv777_main.c $(K)/kv777.c $(K)/ramkv777.c
NONPORTABLE = plugins/nonportable/$(OS)/files.c plugins/nonportable/$(OS)/random.c
COINS = $(C)/cointx.c $(C)/coins777.c $(C)/coins777_main.c $(C)/gen1.c #$(C)/gen1auth.c $(C)/gen1pub.c
CRYPTO = $(U)/sha256.c $(U)/crypt_argchk.c $(U)/hmac_sha512.c $(U)/rmd160.c $(U)/sha512.c $(U)/peer777.c $(U)/user777.c $(U)/node777.c $(U)/SaM.c $(U)/transport777.c $(U)/crypto777.c $(U)/packet777.c $(U)/tom_md5.c
INSTANTDEX = $(I)/InstantDEX_main.c
COMMON = plugins/common/busdata777.c plugins/common/relays777.c plugins/common/console777.c plugins/common/prices777.c plugins/common/cashier777.c plugins/common/txnet777.c plugins/common/teleport777.c plugins/common/opreturn777.c $(C)/bitcoind_RPC.c plugins/common/txind777.c plugins/common/system777.c
MGWSRC = plugins/mgw/MGW_main.c plugins/mgw/old/sophia.c plugins/mgw/old/db777.c
SRCS = SuperNET.c libjl777.c $(MGWSRC) $(CRYPTO) $(UTILS) $(COINS) $(NONPORTABLE) $(RAMCHAIN) $(INSTANTDEX) $(PEGGY) $(KV) $(COMMON)
OBJS := $(SRCS:%.c=%.o)
all: $(TARGET)
$(TARGET): $(OBJS)
#$(CC) $(CFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
ar rcu libs/libjl777.a $(OBJS)
test: all
(cd tests; make test)
clean: doesntexist
rm libs/libjl777.a SuperNET; rm -f libjl777.a libs/libjl777.so $(OBJS) *~
PINCLUDES := -Iincludes -Inonportable/$(OS) -I../nanomsg/src -I../nanomsg/src/utils -Iincludes/libtom -Iincludes/miniupnp #-I. -Iutils -Iramchain -Icoins -Imgw -I -Isophia -I../includes -I../.. -I../coins -I../ramchain -I../sophia -I../utils -I../mgw
_echodemo := rm agents/echodemo; gcc -o agents/echodemo -O2 $(PINCLUDES) echodemo.c $(PLIBS)
_rps := rm agents/rps; gcc -o agents/rps -O2 $(PINCLUDES) rps777.c $(PLIBS)
_api := rm cgi/*; gcc -o cgi/api -O2 $(PINCLUDES) agents/api_main.c ccgi/ccgi.c ccgi/prefork.c coins/bitcoind_RPC.c $(PLIBS); ln cgi/api cgi/nxt; ln cgi/api cgi/nxts; ln cgi/api cgi/port; ln cgi/api cgi/ports; ln cgi/api cgi/InstantDEX; ln cgi/api cgi/init; ln cgi/api cgi/public
_msc := rm agents/msc; gcc -o agents/msc -O2 $(PINCLUDES) two/msc.c $(PLIBS)
_nxt := rm agents/nxt; gcc -o agents/nxt -O2 $(PINCLUDES) two/nxt.c $(PLIBS)
_eth := rm agents/eth; gcc -o agents/eth -O2 $(PINCLUDES) two/eth.c $(PLIBS)
_two := rm agents/two; gcc -o agents/two -O2 $(PINCLUDES) two/two.c $(PLIBS)
_stockfish := cd stockfish; rm stockfish; make build ARCH=x86-64-modern; cp stockfish ../agents; cd ..
agents: plugins/agents/rps plugins/agents/echodemo plugins/agents/stockfish plugins/cgi/api plugins/agents/nxt plugins/agents/two plugins/agents/eth plugins/agents/msc; \
cd plugins; \
$(_echodemo); \
$(_rps); \
$(_api); \
cd ..
rps: plugins/agents/rps; \
cd plugins; $(_rps); cd ..
echodemo: plugins/agents/echodemo; \
cd plugins; $(_echodemo); cd ..
api: plugins/cgi/api; \
cd plugins; $(_api); cd ..
eth: plugins/agents/eth; \
cd plugins; $(_eth); cd ..
msc: plugins/agents/msc; \
cd plugins; $(_msc); cd ..
nxt: plugins/agents/nxt; \
cd plugins; $(_nxt); cd ..
two: plugins/agents/two; \
cd plugins; $(_two); cd ..
install_eth: doesntexist; \
sudo add-apt-repository -y ppa:ethereum/ethereum-dev; \
sudo add-apt-repository -y ppa:ethereum/ethereum; \
sudo apt-get update; \
sudo apt-get install geth;
start_eth: doesntexist; \
geth --rpc --rpcport "8545";
stockfish: lib/stockfish; \
cd plugins; $(_stockfish); cd ..
sophia: lib/sophia; \
cd plugins; $(_sophia); cd ..
SuperNET: $(SRCS) $(TARGET); \
pkill SuperNET; rm SuperNET; clang -o SuperNET $(CFLAGS) -D INSIDE_MGW -D STANDALONE $(SRCS) $(LIBS); mv SuperNET MGW
#-lz -ldl -lutil -lpcre -lexpat
special: /usr/lib/libjl777.so; \
gcc -shared -Wl,-soname,libjl777.so -o libs/libjl777.so $(OBJS) -lstdc++ -lcurl -lm -ldl; \
sudo cp libs/libjl777.so /usr/lib/libjl777.so
btcd: ../src/BitcoinDarkd; \
cd ../src; rm BitcoinDarkd; make -f makefile.unix; strip BitcoinDarkd; cp BitcoinDarkd ../libjl777
btcdmac: ../src/BitcoinDarkd; \
cd ../src; rm BitcoinDarkd; make -f makefile.osx; strip BitcoinDarkd; cp BitcoinDarkd ../libjl777
install: doesntexist; \
sudo add-apt-repository ppa:fkrull/deadsnakes; sudo apt-get update; sudo aptitude install python-software-properties software-properties-common autotools-dev ; add-apt-repository ppa:bitcoin/bitcoin; echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list ; echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list ; apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 ; aptitude update; aptitude install git build-essential libdb++-dev libtool autoconf pkg-config libssl-dev libboost-all-dev libminiupnpc-dev clang libcurl4-gnutls-dev oracle-java8-installer libwebsockets3 libwebsockets-dev cmake qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libdb++-dev libminiupnpc-dev python3-dev libpcre-ocaml-dev #openjdk-7-jdk openjdk-7-jre-lib
getramchain2: doesntexist; \
mkdir /var/www/html/ramchains; mkdir /var/www/html/ramchains/BTCD; \
rsync -rtv guest@209.126.70.159::ramchains/BTCD.blocks /var/www/html/ramchains/BTCD.blocks; \
rsync -rtv guest@209.126.70.159::ramchains/BTCD.addr /var/www/html/ramchains/BTCD/BTCD.addr; \
rsync -rtv guest@209.126.70.159::ramchains/BTCD.txid /var/www/html/ramchains/BTCD/BTCD.txid; \
rsync -rtv guest@209.126.70.159::ramchains/BTCD.script /var/www/html/ramchains/BTCD/BTCD.script
getramchain1: doesntexist; \
mkdir /var/www/html/ramchains/BTCD; rsync -rtv guest@209.126.70.156::ramchains/BTCD.blocks /var/www/html/ramchains/BTCD.blocks; \
rsync -rtv guest@209.126.70.156::ramchains/BTCD.addr /var/www/html/ramchains/BTCD/BTCD.addr; \
rsync -rtv guest@209.126.70.156::ramchains/BTCD.txid /var/www/html/ramchains/BTCD/BTCD.txid; \
rsync -rtv guest@209.126.70.156::ramchains/BTCD.script /var/www/html/ramchains/BTCD/BTCD.script
getramchain0: doesntexist; \
mkdir /var/www/html/ramchains/BTCD; rsync -rtv guest@209.126.70.170::ramchains/BTCD.blocks /var/www/html/ramchains/BTCD.blocks; \
rsync -rtv guest@209.126.70.170::ramchains/BTCD.addr /var/www/html/ramchains/BTCD/BTCD.addr; \
rsync -rtv guest@209.126.70.170::ramchains/BTCD.txid /var/www/html/ramchains/BTCD/BTCD.txid; \
rsync -rtv guest@209.126.70.170::ramchains/BTCD.script /var/www/html/ramchains/BTCD/BTCD.script
chessjs: doesntexist; \
git clone https://github.com/exoticorn/stockfish-js
nanomsg: doesntexist; \
git clone https://github.com/nanomsg/nanomsg; cd nanomsg; ./autogen.sh; ./configure; make -lanl; make check; cp .libs/libnanomsg.a ../libs; cp src/*.h ../includes; cd ..
python: doesntexist; \
tar -xvf Python-3.4.3.tgz; cd Python-3.4.3; ./configure; make all; cp libpython3.so libpython3.4m.a ../libs; cp pyconfig.h Include; ln ./build/lib.linux-x86_64-3.4/_sysconfigdata.py Lib; cd ..;
patch: doesntexist; \
#sudo apt-get install csync-owncloud librsync-dev libsmbclient-dev liblog4c-dev flex libsqlite3-dev bison csync2; \
#git clone http://git.linbit.com/csync2.git; \
#cd csync2; ./autogen.sh; ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc; make; sudo make install; sudo make cert; cd ..; \
#echo "add: csync2 30865/tcp # to /etc/services"; \
#echo "http://oss.linbit.com/csync2/paper.pdf is useful"; \
#git clone git://git.csync.org/projects/csync.git; \
#cd csync; cmake ..; make; \
#echo "neon can be installed from: http://www.linuxfromscratch.org/blfs/view/svn/basicnet/neon.html"; \
sudo apt-get install openjdk-7-jdk openjdk-7-jre-lib; \
sudo apt-get install mercurial; \
sudo apt-get install libpcre-ocaml-dev; \
sudo add-apt-repository ppa:fkrull/deadsnakes; \
sudo apt-get update; \
sudo apt-get install libpython3.4-dev; \
cp /usr/lib/python3.4/config-3.4m-x86_64-linux-gnu/libpython3.4m.a libs; \
cd; git clone https://go.googlesource.com/go; \
cd go; \
git checkout go1.4.1; \
cd src; \
./all.bash; \
export GOPATH=$$HOME/gocode; \
export GOROOT=$$HOME/go; \
PATH="$$PATH:$$GOROOT/bin:$$GOPATH/bin"; \
#echo "export GOPATH=$$HOME/gocode" >> ~/.profile; \
#echo "export GOROOT=$$HOME/go" >> ~/.profile; \
#echo "PATH=\"$$PATH:$$GOPATH/bin:$$GOROOT/bin\"" >> ~/.profile; \
go get golang.org/x/tools/cmd/...; go get golang.org/x/crypto; go get golang.org/x/image; go get golang.org/x/sys; go get golang.org/x/net; go get golang.org/x/text; go get golang.org/x/tools;\
cd ../../gocode/src; cd ~/gocode/src; mkdir github.com; cd github.com; mkdir syncthing; cd syncthing; git clone https://github.com/syncthing/syncthing; cd syncthing; go run build.go; cp bin/syncthing $HOME; \
patch3: doesntexist; \
cd miniupnpc; \
make libminiupnpc.a; \
cp libminiupnpc.a ../libs; \
cd ..;\
ramchains: doesntexist; \
mkdir ramchains; \
cd ramchains; \
unzip ../ramchains.zip; \
cd ..;\
patch1: doesntexist; \
export LIBDIR="/usr/local/BerkeleyDB.6.1/lib"; \
unzip db-6.1.19.zip; \
cd db-6.1.19/build_unix; \
../dist/configure; \
cp ../../env_region.c ../src/env; \
make; \
cp *.h ../../includes; \
cp libdb.a ../../libs;
patch2: doesntexist; \
unzip lws.zip -d libwebsockets; \
cd libwebsockets/lib; \
cmake ..; \
cp libwebsockets.h lws_config.h ../../includes; \
cp libwebsockets-test-server.key.pem ../../SuperNET.key.pem; \
cp libwebsockets-test-server.pem ../../SuperNET.pem; \
make; \
cp lib/* ../../libs; \
cd ../..;
#git clone https://github.com/joewalnes/websocketd;
#git clone https://github.com/nanomsg/nanomsg; \
#unzip lws.zip -d libwebsockets; \
#cd libwebsockets/lib; \
#cmake ..; \
#cp libwebsockets.h lws_config.h ../../includes; \
#cp libwebsockets-test-server.key.pem ../../SuperNET.key.pem; \
#cp libwebsockets-test-server.pem ../../SuperNET.pem; \
#make; \
#cp lib/* ../../libs; \
#cd ../..; \
#unzip db-6.1.19.zip; \
#cd db-6.1.19/build_unix; \
#../dist/configure; \
#cp ../../env_region.c ../src/env; \
#make; \
#cp libdb.a ../../libs; \
#cp *.h ../../includes; \
#cd ../..; \
#cd libuv; \
#sh autogen.sh; \
#./configure; \
#make; \
#cp .libs/libuv.a ../libs; \
#cp .libs/libuv.so ../libs; \
#cd ..; \
dependencies: doesntexist; \
sudo apt-get install make clang-3.4 autoconf libtool libcurl4-gnutls-dev unzip autogen g++ libssl-dev libdb++-dev libminiupnpc-dev libboost-all-dev;
onetime: doesntexist; \
cd nanomsg; ./autogen.sh; ./configure; make -lanl; cd ..; \
cd miniupnpc; make; cp libminiupnpc.a ../libs; cd ..; \
git clone https://github.com/joewalnes/websocketd; cd websocketd; make; cp websocketd ../libs; cd ..; \
#git clone https://go.googlesource.com/go; cd go; git checkout go1.4.1; cd src; ./all.bash; cd ..; mkdir gocode; mkdir gocode/src; cd ..; \
#mkdir go/gocode; mkdir go/gocode/src; export GOPATH=`pwd`/go/gocode; export GOROOT=`pwd`/go; echo $$GOPATH; echo $$GOROOT; \
#go get golang.org/x/tools/cmd; go get golang.org/x/crypto; go get golang.org/x/image; go get golang.org/x/sys; go get golang.org/x/net; go get golang.org/x/text; go get golang.org/x/tools;\
#cd go/gocode/src; mkdir github.com; cd github.com; mkdir joewalnes; cd joewalnes; git clone https://github.com/joewalnes/websocketd; cd websocketd; go build; cp websocketd ../../../../../../libs; cd ../../../../../..;
count:
@echo "Core:"
@cat $(SRCS) *.h | grep -v '^[ ]*/\*' | grep -v '^[ ]*$$' | wc
@echo ""
@echo "Everything:"
@cat $(SRCS) *.h */*.h | wc
.PHONY: libjl777.c
../src/BitcoinDarkd: libjl777.a
#libs/randombytes.o:
libs/libuv.a:
/usr/lib/libjl777.so: libs/libjl777.so
doesntexist:
picoc.o: picoc.c picoc.h
libgfshare.o: libgfshare.c libgfshare.h
libjl777.o: $(SRCS)
table.o: table.c interpreter.h platform.h
lex.o: lex.c interpreter.h platform.h
parse.o: parse.c picoc.h interpreter.h platform.h
expression.o: expression.c interpreter.h platform.h
heap.o: heap.c interpreter.h platform.h
type.o: type.c interpreter.h platform.h
variable.o: variable.c interpreter.h platform.h
clibrary.o: clibrary.c picoc.h interpreter.h platform.h
platform.o: platform.c picoc.h interpreter.h platform.h
include.o: include.c picoc.h interpreter.h platform.h
platform/platform_unix.o: platform/platform_unix.c picoc.h interpreter.h platform.h
platform/library_unix.o: platform/library_unix.c interpreter.h platform.h
cstdlib/stdio.o: cstdlib/stdio.c interpreter.h platform.h
cstdlib/math.o: cstdlib/math.c interpreter.h platform.h
cstdlib/string.o: cstdlib/string.c interpreter.h platform.h
cstdlib/stdlib.o: cstdlib/stdlib.c interpreter.h platform.h
cstdlib/time.o: cstdlib/time.c interpreter.h platform.h
cstdlib/errno.o: cstdlib/errno.c interpreter.h platform.h
cstdlib/ctype.o: cstdlib/ctype.c interpreter.h platform.h
cstdlib/stdbool.o: cstdlib/stdbool.c interpreter.h platform.h
cstdlib/unistd.o: cstdlib/unistd.c interpreter.h platform.h
plugins/agents/stockfish: plugins/stockfish/stockfish.cpp
plugins/agents/sophia: plugins/sophia/sophia.c plugins/sophia/sophia_main.c
plugins/agents/echodemo: plugins/echodemo.c
#plugins/nonportable/$(OS)/files.o: plugins/nonportable/$(OS)/files.c
#plugins/nonportable/$(OS)/random.o: plugins/nonportable/$(OS)/random.c
plugins/agents/rps: plugins/rps777.c
plugins/agents/eth: plugins/two/eth.c
plugins/agents/msc: plugins/two/msc.c
plugins/agents/nxt: plugins/two/nxt.c
plugins/agents/two: plugins/two/two.c
plugins/InstantDEX/InstantDEX_main.o: plugins/InstantDEX/InstantDEX_main.c plugins/InstantDEX/assetids.h plugins/InstantDEX/atomic.h plugins/InstantDEX/bars.h plugins/InstantDEX/exchangepairs.h plugins/InstantDEX/feeds.h plugins/InstantDEX/NXT_tx.h plugins/InstantDEX/orderbooks.h plugins/InstantDEX/quotes.h plugins/InstantDEX/rambooks.h plugins/InstantDEX/signals.h plugins/InstantDEX/tradebot.h plugins/InstantDEX/trades.h plugins/InstantDEX/InstantDEX.h
plugins/cgi/api: plugins/agents/api_main.c plugins/ccgi/ccgi.c plugins/ccgi/prefork.c
lib/MGW: plugins/mgw/mgw.c plugins/mgw/state.c plugins/mgw/huff.c plugins/ramchain/touch plugins/ramchain/blocks.c plugins/ramchain/kv777.c plugins/ramchain/search.c plugins/ramchain/tokens.c plugins/ramchain/init.c plugins/ramchain/ramchain.c plugins/utils/ramcoder.c plugins/utils/huffstream.c plugins/utils/bitcoind.c