-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (46 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
62
V=1
SOURCE_DIR=src
BUILD_DIR=build
EXTERNAL_DIR=external
include $(N64_INST)/include/n64.mk
BOX_PATH=$(EXTERNAL_DIR)/box2d
BOX_INCLUDE=$(BOX_PATH)/include
BOX_LIB=$(BOX_PATH)/build/bin/libbox2d.a
# TODO: simplify these; compiles the box stuff
$(BOX_PATH)/src/collision/%.o: $(BOX_PATH)/src/collision/%.cpp
@mkdir -p $(dir $@)
@echo " [CXX] $<"
$(CXX) -c $(CXXFLAGS) -o $@ $<
$(BOX_PATH)/src/common/%.o: $(BOX_PATH)/src/common/%.cpp
@mkdir -p $(dir $@)
@echo " [CXX] $<"
$(CXX) -c $(CXXFLAGS) -o $@ $<
$(BOX_PATH)/src/dynamics/%.o: $(BOX_PATH)/src/dynamics/%.cpp
@mkdir -p $(dir $@)
@echo " [CXX] $<"
$(CXX) -c $(CXXFLAGS) -o $@ $<
$(BOX_PATH)/src/rope/%.o: $(BOX_PATH)/src/rope/%.cpp
@mkdir -p $(dir $@)
@echo " [CXX] $<"
$(CXX) -c $(CXXFLAGS) -o $@ $<
BOX_SRC=$(wildcard $(BOX_PATH)/src/collision/*.cpp) \
$(wildcard $(BOX_PATH)/src/common/*.cpp) \
$(wildcard $(BOX_PATH)/src/dynamics/*.cpp) \
$(wildcard $(BOX_PATH)/src/rope/*.cpp)
N64_CXXFLAGS += -std=c++17
N64_CXXFLAGS += -g
N64_CXXFLAGS += -I$(BOX_PATH)/include -I$(BOX_PATH)/src
N64_CXXFLAGS += -l$(BOX_LIB)
all: $(BOX_LIB) hello.z64
.PHONY: all
OBJS = $(BOX_SRC:%.cpp=%.o) \
$(BUILD_DIR)/guy.o \
$(BUILD_DIR)/main.o \
hello.z64: N64_ROM_TITLE="Physics!"
hello.z64: $(BUILD_DIR)/hello.dfs
$(BUILD_DIR)/hello.dfs: $(wildcard filesystem/*)
$(BUILD_DIR)/hello.elf: $(OBJS)
clean:
rm -f $(BUILD_DIR)/* *.z64
.PHONY: clean
-include $(wildcard $(BUILD_DIR)/*.d)