-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (28 loc) · 1.05 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
sources = $(wildcard *.cpp)
headers = $(wildcard *.h)
objects = $(sources:%.cpp=%.o)
deps = $(sources:%.cpp=%.d)
CFLAGS += -g
CXXFLAGS += -g
LDLIBS = -L/usr/local/Cellar/boost/1.55.0
#Uncomment this line to get a boatload of debug output.
#CPPFLAGS = -DSHOW_NETWORK
#override CPPFLAGS += -DSHOW_WARNINGS
override CPPFLAGS += -Isexp
all: client
submit: client
@echo "$(shell cd ..;sh submit.sh c)"
.PHONY: clean all subdirs
libclient_%.o: override CXXFLAGS += -fPIC
libclient_%.o: %.cpp *$(headers)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $<
clean:
rm -f $(objects) client libclient_network.o libclient_game.o libclient_getters.o libclient_util.o libclient.so
$(MAKE) -C sexp clean
client: $(objects) sexp/sexp.a
$(CXX) $(LDFLAGS) $(LOADLIBES) $(LDLIBS) $^ -g -o client
libclient.so: libclient_network.o libclient_game.o libclient_getters.o libclient_util.o sexp/libclient_sexp.a
$(CXX) -shared -Wl,-soname,libclient.so $(LDFLAGS) $(LOADLIBES) $(LDLIBS) $^ -o libclient.so
sexp/sexp.a sexp/libclient_sexp.a:
$(MAKE) -C $(dir $@) $(notdir $@)
-include $(deps)