forked from ReMinecraftPE/mcpeserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (50 loc) · 1.44 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
# MCPE Server (C) 2023 iProgramInCpp
# Makefile
# Source code paths
SRC_DIR=source
BUILD_DIR=build
THIRDPARTY_DIR=thirdparty
# Binary target
BINARY_TARGET=mcpeserver
INCLUDES = \
-I. \
-Ithirdparty \
-Iplatforms/windows \
-Iplatforms/windows \
-Ithirdparty/raknet \
-Isource \
-Isource/Network \
-Isource/Sound \
-Isource/GameMode \
-Isource/App \
-Isource/Base \
-Isource/GUI \
-Isource/GUI/Screen \
-Isource/Renderer \
-Isource/UserInput \
-Isource/World \
-Isource/World/Generator \
-Isource/World/Item \
-Isource/World/Tile \
-Isource/World/Renderer \
-Isource/World/Entity \
-Isource/World/Entity/Models \
-Isource/World/Particle \
-Isource/World/Storage
CXXFLAGS = $(INCLUDES) -Wall
CPP_FILES = $(shell find $(SRC_DIR) $(THIRDPARTY_DIR) -type f -name '*.cpp')
OBJ_FILES = $(patsubst %, $(BUILD_DIR)/%, $(CPP_FILES:.cpp=.o))
DEP_FILES = $(patsubst %, $(BUILD_DIR)/%, $(CPP_FILES:.cpp=.d))
all: binary
clean:
@echo "Cleaning..."
@rm -rf $(OBJ_FILES) $(DEP_FILES) $(BINARY_TARGET)
binary: $(BINARY_TARGET)
$(BINARY_TARGET): $(OBJ_FILES)
@echo "Linking $@"
@$(CXX) -o $@ $^
-include $(DEP_FILES)
$(BUILD_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@echo "Compiling $<"
@$(CXX) $(CXXFLAGS) -c $< -o $@ -MMD