-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.79 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
#---------------------------------------------------------------------------
# NOTE: This makefile assumes that quickBlocks is installed at default path:
# /usr/local/qblocks
# Update the variable QBLOCKS_INSTALL_PATH otherwise
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
# Quickblocks stuff
#---------------------------------------------------------------------------
QBLOCKS_INSTALL_PATH=/usr/local/qblocks
QBLOCKS_INCLUDE_PATH=$(QBLOCKS_INSTALL_PATH)/include
QBLOCKS_LIB_PATH=$(QBLOCKS_INSTALL_PATH)/lib
QBLOCKS_STATIC_LIBS=-lwallet -ltoken -lacct -lether -lutil
QBLOCKS_LDFLAGS=-L$(QBLOCKS_LIB_PATH) $(QBLOCKS_STATIC_LIBS)
#---------------------------------------------------------------------------
# Compiler/linker flags
#---------------------------------------------------------------------------
CXX=g++
CFLAGS=-std=c++11 -Werror -Wall -O2 -I. -I$(QBLOCKS_INCLUDE_PATH)
LDFLAGS=$(QBLOCKS_LDFLAGS) -lcurl
#---------------------------------------------------------------------------
# Program sources and name
#---------------------------------------------------------------------------
SRCS=simple.cpp
OBJS_PATH=objs
OBJS=$(patsubst %.cpp,$(OBJS_PATH)/%.o,$(SRCS))
EXE_NAME=simple
EXE_PATH=bin
#---------------------------------------------------------------------------
# Rules
#---------------------------------------------------------------------------
# Compilation
$(OBJS_PATH)/%.o: %.cpp
@mkdir -p $(OBJS_PATH)
$(CXX) $(CFLAGS) -c $< -o $@
# Link
all: $(EXE_NAME)
$(EXE_NAME): $(OBJS)
$(CXX) -o $(EXE_NAME) $(OBJS) $(LDFLAGS)
@mkdir -p $(EXE_PATH)
mv $(EXE_NAME) $(EXE_PATH)
# Clean
clean:
$(RM) -rf $(OBJS_PATH) $(EXE_PATH)