-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
53 lines (41 loc) · 1.31 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
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
BINFLAGS ?= -I. -L. -L/usr/local/lib -I/usr/local/include
PLATFORMCXXFLAGS ?= -fPIC
INDEXERBIN ?= vtc_indexer
CC = g++
C = gcc
endif
ifeq ($(UNAME), MINGW32_NT-6.2)
BINFLAGS ?= -I. -L.
INDEXERBIN ?= vtc_indexer.exe
CC = g++
C = gcc
endif
ifeq ($(UNAME), Darwin)
BINFLAGS ?= -I. -L.
INDEXERBIN ?= vtc_indexer
CC = clang++
C = clang
endif
ifeq ($(UNAME), Darwin-Cross)
BINFLAGS ?= -I. -L.
INDEXERBIN ?= vtc_indexer
CC = o64-clang++
C = o64-clang
endif
PLATFORMCXXFLAGS += -g -Wall -std=c++14 -O3 -Wl,-E
INDEXERSRC = src/main.cpp src/blockfilewatcher.cpp src/coinparams.cpp src/byte_array_buffer.cpp src/blockscanner.cpp src/scriptsolver.cpp src/httpserver.cpp src/utility.cpp src/blockreader.cpp src/filereader.cpp src/mempoolmonitor.cpp src/blockindexer.cpp src/crypto/ripemd160.cpp src/crypto/bech32.cpp
INDEXEROBJS = $(INDEXERSRC:.cpp=.cpp.o)
INDEXERLDFLAGS = $(BINFLAGS) -lrestbed -lcrypto -ldl -pthread -lleveldb -lssl -lsecp256k1 -ljsonrpccpp-client -ljsonrpccpp-common -ljsoncpp
CXXFLAGS = $(PLATFORMCXXFLAGS)
all: indexer
indexer: $(INDEXERSRC) $(INDEXERBIN)
clean:
$(RM) -r $(INDEXEROBJS)
$(INDEXERBIN): $(INDEXEROBJS)
$(CC) $(INDEXEROBJS) -o $@ $(INDEXERLDFLAGS)
%.c.o: %.c
$(C) $(PLATFORMCXXFLAGS) -O3 -c $< -o $@
%.cpp.o: %.cpp
$(CC) $(CXXFLAGS) -c $< -o $@