forked from mycroft/chainstate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (28 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
CPP=g++
CPPFLAGSWARN=-pedantic -Wall -Wextra -Wold-style-cast -Woverloaded-virtual -Wfloat-equal -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align \
-Wconversion -Wshadow -Weffc++ -Wredundant-decls -Wdouble-promotion -Winit-self -Wswitch-default \
-Wswitch-enum -Wundef -Wlogical-op -Winline
CPPFLAGS=-Wall -Wextra $(CPPFLAGSWARN) -I. -Ilibbase58 -Isecp256k1/include -Ibech32/ref/c -std=c++0x
LDFLAGS=-Lsecp256k1/.libs -lsecp256k1 -lcrypto -lleveldb -Llibbase58/.libs -lbase58 -Lbech32/ref/c -lbech32
SRCS=chainstate.cc hex.cc varint.cc pubkey.cc
OBJS=$(SRCS:.cc=.o)
BINARY=chainstate
all: libbase58/.libs/libbase58.a secp256k1/.libs/libsecp256k1.a bech32/ref/c/libbech32.a clean $(BINARY)
$(BINARY): $(OBJS)
$(CPP) -o $(BINARY) $(OBJS) $(LDFLAGS)
%.o: %.cc
$(CPP) $(CPPFLAGS) -c -o $@ $<
libbase58/.libs/libbase58.a:
cd libbase58 && ./autogen.sh && ./configure --enable-static --enable-shared=no && make
secp256k1/.libs/libsecp256k1.a:
cd secp256k1 && ./autogen.sh && ./configure --enable-static --enable-shared=no --with-bignum=no && make
bech32/ref/c/libbech32.a:
cd bech32/ref/c && $(CPP) -c -o segwit_addr.o segwit_addr.c && ar rcs libbech32.a segwit_addr.o
run:
./$(BINARY) > /tmp/all.output 2> /tmp/all.errors
clean:
rm -f $(BINARY) $(OBJS)
distclean: clean
-cd libbase58 && make distclean
-cd secp256k1 && make distclean
-cd bech32/ref/c/ && rm -f *.o *.a