/
Makefile.64
41 lines (32 loc) · 1.5 KB
/
Makefile.64
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
all: crafti.z64
.PHONY: all
BUILD_DIR = build
include $(N64_INST)/include/n64.mk
DEFINES = -Ingl -I. -In64 -DN64 -Wdouble-promotion -Ofast -fdata-sections -ffunction-sections -fsingle-precision-constant -fno-common -march=vr4300 -mfix4300 -mno-xgot -mno-check-zero-division -mno-fp-exceptions -mframe-header-opt
DEFINES += -DNDEBUG -DLOWEND -D_256
DEFINES += -Wformat=2 -Wformat-truncation -Wundef --param case-values-threshold=15
DEFINES += -finline-limit=42 -fno-unroll-loops -fno-ipa-cp -ffast-math
# this gets you about 20% better execution speed on 32bit arm/mips
DEFINES += -fno-common -fno-stack-protector -fno-guess-branch-probability -fno-caller-saves -fno-tree-loop-if-convert -fno-regmove
N64_CFLAGS += $(DEFINES)
N64_CXXFLAGS += $(DEFINES) -fno-rtti -fno-exceptions
N64_LDFLAGS += -ldragon -ldragonsys --as-needed --gc-sections -s
N64_ROM_SAVETYPE = none
N64_ROM_REGIONFREE = true
N64_ROM_RTC = false
N64_TOOLFLAGS += -l 1M
SRCDIR = ./ ./n64 ./ngl
VPATH = $(SRCDIR)
SRC_C = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.c))
SRC_CP = $(foreach dir, $(SRCDIR), $(wildcard $(dir)/*.cpp))
OBJ_C = $(notdir $(patsubst %.c, %.o, $(SRC_C)))
OBJ_CP = $(notdir $(patsubst %.cpp, %.o, $(SRC_CP)))
OBJS = $(OBJ_C) $(OBJ_CP) n64/n64_memcpy.o n64/n64_memset.o
DEPS = $(SRC_C:%.c=$(BUILD_DIR)/%.d) $(SRC_CPP:%.cpp=$(BUILD_DIR)/%.d)
crafti.z64: N64_ROM_TITLE = "Crafti"
$(BUILD_DIR)/crafti.dfs: $(wildcard filesystem/*)
$(BUILD_DIR)/crafti.elf: $(OBJS)
clean:
rm -rf $(BUILD_DIR) *.z64 *.o *.d
.PHONY: clean
-include $(DEPS)