-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
26 lines (20 loc) · 820 Bytes
/
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
source_files := $(shell find src/ -name *.cpp)
object_files := $(patsubst src/%.cpp, build/%.o, $(source_files))
target := build/btcprice
compiler_flags := -std=c++11 -Wall -pedantic -O2 -DCURL_STATICLIB -Ijsoncpp/include -Ljsoncpp/build/debug/lib
.PHONY: build clean jsoncpp
build: $(target) $(object_files)
clean:
rm -rf build/
jsoncpp:
cd jsoncpp/ && \
mkdir -p build/debug && \
cd build/debug && \
cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../.. && \
make
$(target): $(object_files) jsoncpp
g++ $(compiler_flags) -o $(target) $(object_files) -lncurses -ljsoncpp -lcurl
$(object_files): build/%.o : src/%.cpp jsoncpp
mkdir -p $(dir $@) && \
g++ $(compiler_flags) -c $(patsubst build/%.o, src/%.cpp, $@) && \
mv *.o build/