-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (35 loc) · 817 Bytes
/
Copy pathMakefile
File metadata and controls
42 lines (35 loc) · 817 Bytes
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
CXX = g++
CXXFLAGS = -std=c++17 -O3
TARGET = nets_engine.exe
# OS and Shell Detection
ifeq ($(OS),Windows_NT)
# Windows Detect (CMD vs Sh)
# In CMD, echo "check" returns "check". In Sh, it returns check.
ifeq ($(shell echo "check"),"check")
# Standard Windows CMD
RM = del /f /q
MVN = mvn.cmd
SEP = &
else
# Windows with a Unix-like shell (Git Bash, MSYS2, etc.)
RM = rm -f
MVN = mvn
SEP = &&
endif
else
# Linux / Mac
RM = rm -f
MVN = mvn
SEP = &&
endif
.PHONY: all build clean game
all: $(TARGET)
$(TARGET): nets_engine.cpp
$(CXX) $(CXXFLAGS) $< -o $@
build: $(TARGET)
cd netgame $(SEP) $(MVN) compile
game: build
cd netgame $(SEP) $(MVN) javafx:run
clean:
$(RM) $(TARGET)
cd netgame $(SEP) $(MVN) clean