-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmakefile
More file actions
103 lines (75 loc) · 2.21 KB
/
makefile
File metadata and controls
103 lines (75 loc) · 2.21 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Copyright 2022
# This file is part of QUANTAS. QUANTAS is free software: you can
# redistribute it and/or modify it under the terms of the GNU General
# Public License as published by the Free Software Foundation, either
# version 3 of the License, or (at your option) any later version.
# QUANTAS is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details. You should have received a
# copy of the GNU General Public License along with QUANTAS. If not,
# see <https://www.gnu.org/licenses/>.
PROJECT_DIR := quantas
################
#
# configure this for the specific algorithm and input file
#
INPUTFILE := $(PROJECT_DIR)/ExampleInput.json
ALG := EXAMPLE_PEER
ALGFILE := ExamplePeer
# ALG := BITCOIN_PEER
# ALGFILE := BitcoinPeer
# ALG := ETHEREUM_PEER
# ALGFILE := EthereumPeer
# ALG := PBFT_PEER
# ALGFILE := PBFTPeer
# ALG := RAFT_PEER
# ALGFILE := RaftPeer
# ALG := SMARTSHARDS_PEER
# ALGFILE := SmartShardsPeer
# ALG := LINEARCHORD_PEER
# ALGFILE := LinearChordPeer
# ALG := KADEMLIA_PEER
# ALGFILE := KademliaPeer
# ALG := ALTBIT_PEER
# ALGFILE := AltBitPeer
# ALG := STABLEDATALINK_PEER
# ALGFILE := StableDataLinkPeer
# ALG := CHANGROBERTS_PEER
# ALGFILE := ChangRobertsPeer
####### end algorithm configuration
CPPFLAGS := -Iinclude -MMD -MP
CXXFLAGS = -pthread -D$(ALG)
CXX := g++
EXE := quantas.exe
OBJS := $(PROJECT_DIR)/main.o $(PROJECT_DIR)/$(ALGFILE).o
# extra debug and release flags
release: CXXFLAGS += -O2 -s
debug: CXXFLAGS += -O0 -g -D_GLIBCXX_DEBUG
clang: CXX := clang++
clang: CXXFLAGS += -std=c++14
.PHONY: all clean run release debug
all: debug
release: $(EXE)
debug: $(EXE)
clang: $(EXE)
$(EXE): $(OBJS)
$(CXX) $(CXXFLAGS) $^ -o $(EXE)
$(PROJECT_DIR)/%.o: $(PROJECT_DIR)/%.c
$(CXX) $(CXXFLAGS) -c $< -o $@
run: all
./$(EXE) $(INPUTFILE)
clean:
$(RM) $(EXE)
$(RM) *.out
$(RM) *.o
$(RM) -r *.dSYM
$(RM) $(PROJECT_DIR)/*.gch
$(RM) $(PROJECT_DIR)/*.tmp
$(RM) $(PROJECT_DIR)/*.o
$(RM) $(PROJECT_DIR)/*.d
$(RM) quantas_test/*.gch
$(RM) quantas_test/*.tmp
$(RM) quantas_test/*.o
$(RM) quantas_test/*.d
-include $(OBJS:.o=.d)