This repository has been archived by the owner on May 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
134 lines (102 loc) · 4.11 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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
###############################################################################
#
# SPQF Makefile
#
# Author:
# COPYRIGHT (C) Jason Volk 2016
#
# This file is free and available under the GNU GPL terms specified in COPYING.
#
# The production build process should work by simply typing `make`. libircbot
# is built recursively and may require a second `make` command to complete
# linking.
#
# For developers, export SPQF_DEVELOPER=1 which adjusts the CCFLAGS for non-
# production debug builds.
#
###############################################################################
###############################################################################
#
# SPQF options
#
SPQF_CC := g++
SPQF_VERSTR := $(shell git describe --tags)
SPQF_CCFLAGS := -std=c++14 -Iircbot/stldb -DSPQF_VERSION=\"$(SPQF_VERSTR)\" -fstack-protector
SPQF_LDFLAGS += -fuse-ld=gold -Wl,--no-gnu-unique -Lircbot/
SPQF_WFLAGS += -pedantic \
-Wall \
-Wextra \
-Wcomment \
-Waddress \
-Winit-self \
-Wuninitialized \
-Wunreachable-code \
-Wvolatile-register-var \
-Wvariadic-macros \
-Woverloaded-virtual \
-Wpointer-arith \
-Wlogical-op \
-Wcast-align \
-Wcast-qual \
-Wstrict-aliasing=2 \
-Wstrict-overflow \
-Wwrite-strings \
-Wformat-y2k \
-Wformat-security \
-Wformat-nonliteral \
-Wfloat-equal \
-Wdisabled-optimization \
-Wno-missing-field-initializers \
-Wmissing-format-attribute \
-Wno-unused-parameter \
-Wno-unused-label \
-Wno-unused-variable \
-Wsuggest-attribute=format
###############################################################################
#
# Composition of SPQF options and user environment options
#
ifdef SPQF_DEVELOPER
SPQF_CCFLAGS += -ggdb -O0
export IRCBOT_DEVELOPER := 1
else
SPQF_CCFLAGS += -DNDEBUG -D_FORTIFY_SOURCE=1 -O3
endif
SPQF_CCFLAGS += $(SPQF_WFLAGS) $(CCFLAGS)
SPQF_LDFLAGS += $(LDFLAGS)
###############################################################################
#
# Final build targets composition
#
SPQF_LIBRARIES := libircbot
SPQF_TARGETS := spqf respub cfgedit
all: $(SPQF_LIBRARIES) $(SPQF_TARGETS)
clean:
$(MAKE) -C ircbot clean
rm -f *.o *.so $(SPQF_TARGETS)
libircbot:
$(MAKE) -C ircbot
respub: respub.o voting.o votes.o praetor.o vdb.o vote.o log.o
$(SPQF_CC) -o [email protected] $(SPQF_CCFLAGS) -shared $(SPQF_LDFLAGS) $^
spqf: spqf.o
$(SPQF_CC) -o $@ $(SPQF_CCFLAGS) -rdynamic $(SPQF_LDFLAGS) $^ -lircbot -lleveldb -lboost_system -lpthread -ldl
cfgedit: cfgedit.o
$(SPQF_CC) -o $@ $(SPQF_CCFLAGS) $(SPQF_LDFLAGS) $^ -lircbot -lleveldb -lboost_system -lpthread
spqf.o: spqf.cpp
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) $<
respub.o: respub.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) -fPIC $<
voting.o: voting.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) -fPIC $<
votes.o: votes.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) -fPIC $<
praetor.o: praetor.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) -fPIC $<
vdb.o: vdb.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) -fPIC $<
vote.o: vote.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) -fPIC $<
log.o: log.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) -fPIC $<
cfgedit.o: cfgedit.cpp *.h
$(SPQF_CC) -c -o $@ $(SPQF_CCFLAGS) $<