-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
72 lines (54 loc) · 1.41 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# debug: block.o main.o sha256.o blockchain.o
# g++ -g block.o main.o sha256.o blockchain.o -o debug
# sha256.o: src/sha256.cpp src/sha256.hpp
# g++ -c src/sha256.cpp
# block.o: src/block.cpp src/block.hpp
# g++ -c src/block.cpp
# blockchain.o: src/blockchain.cpp src/blockchain.hpp
# g++ -c src/blockchain.cpp
# main.o: src/main.cpp
# g++ -c src/main.cpp
# clean:
# rm *.o
# clean_all:
# rm *.o debug
CC = g++
ifeq (%{mode}, release)
FLAGS = -O3 -march=native -std=c++17
else
mode = debug
FLAGS = -O0 -g -std=c++17
endif
INCLUDES =
LIB_FLAGS =
OBJS = block.o blockchain.o sha256.o miner.o wallet.o
PROJECT_NAME = mining_simulator
ifeq (${mode}, debug)
PROJECT = ${PROJECT_NAME}_debug
else
PROJECT = ${PROJECT_NAME}
endif
${PROJECT}: ${OBJS} main.o clean_emacs_files
@echo "Building on "${mode}" mode"
@echo ".........................."
${CC} ${INCLUDES} ${FLAGS} ${OBJS} main.o -o $@
-make clean
main.o:
${CC} ${INCLUDES} ${FLAGS} -c src/main.cpp -o $@
blockchain.o:
${CC} ${INCLUDES} -c src/blockchain.cpp -o $@
sha256.o:
${CC} ${INCLUDES} -c src/sha256.cpp -o $@
block.o:
${CC} ${INCLUDES} -c src/block.cpp -o $@
miner.o:
${CC} ${INCLUDES} -c src/miner.cpp -o $@
wallet.o:
${CC} ${INCLUDES} -c src/wallet.cpp -o $@
.PHONEY: clean clean_emacs_files clean_all
clean:
-rm -rf ${OBJS} main.o
clean_emacs_files:
-rm -rf *~
clean_all: clean clean_emacs_files
-rm -rf ${PROJECT_NAME} ${PROJECT_NAME}_debug