-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
80 lines (64 loc) · 1.93 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
##################################################
## Computer Science 434 - Networking ##
## University of Saskatchewan ##
## 2020 ##
##----------------------------------------------##
## Kale Yuzik ##
## [email protected] ##
##----------------------------------------------##
## Jason Goertzen ##
## [email protected] ##
##----------------------------------------------##
## Ben Haubrich ##
## [email protected] ##
##################################################
CC = g++
# Disable warnings about future GCC abi changes
OS=$(shell uname -s)
CFLAGS = -Wno-psabi
CPPFLAGS = -std=gnu++17 -Wall -Wextra -pedantic -g3 -D_GNU_SOURCE -D_DEFAULT_SOURCE
#Text User Interface is currently not supported on MacOS
ifeq ($(OS), Darwin)
LDFLAGS = -lconfig++ \
-lpthread \
-lboost_system
DARWIN=-DDARWIN
else
LDFLAGS = -lconfig++ \
-lpthread \
-lmenuw \
-lncursesw \
-ltinfo \
-lboost_system
endif
JSONINC = ./json/include
LIBCONFIGINC = ./libconfig/lib
INCLUDE = -I . \
-I ./include \
-I $(JSONINC) \
-I $(LIBCONFIGINC)
ARCH = $(shell uname -s)$(shell uname -m)
BUILD = ./build
BIN = $(BUILD)/bin/$(ARCH)
OBJ = $(BUILD)/obj/$(ARCH)
.PHONY: all mkdirs debug clean
all: mkdirs $(BIN)/client
mkdirs:
mkdir -p $(BIN) $(OBJ)
debug: debug_flag all
debug_flag:
$(eval DEBUG = -D_DEBUG)
clean:
rm -rf ./build ./client
OBJECTS := $(OBJ)/eth_interface.o \
$(OBJ)/game_interface.o \
$(OBJ)/event_wait_mgr.o \
$(OBJ)/ethabi.o \
$(OBJ)/misc.o \
$(OBJ)/client.o
$(OBJ)/%.o: %.cpp
$(CC) $(DARWIN) $(CFLAGS) $(CPPFLAGS) -c $(DEBUG) -o $@ $(INCLUDE) $<
$(BIN)/client: $(OBJECTS)
$(CC) $(CPPFLAGS) -o $@ \
${LDFLAGS} $^
ln -fs $@ ./client