2021-04-30 21:23:22 +00:00
|
|
|
OPTIMIZATION_ON ?= 1
|
|
|
|
|
2021-01-02 04:24:29 +00:00
|
|
|
CC := g++
|
2021-04-30 21:23:22 +00:00
|
|
|
INC := -I ZAPD -I lib/assimp/include -I lib/elfio -I lib/json/include -I lib/stb -I lib/tinygltf -I lib/libgfxd -I lib/tinyxml2
|
|
|
|
|
|
|
|
CFLAGS := -g3 -fpic -Wl,-export-dynamic -std=c++17 -rdynamic -Wall
|
|
|
|
ifeq ($(OPTIMIZATION_ON),1)
|
|
|
|
CFLAGS += -O2
|
|
|
|
else
|
|
|
|
CFLAGS += -O0
|
|
|
|
endif
|
|
|
|
|
|
|
|
LDFLAGS := -ldl
|
2021-01-09 00:38:28 +00:00
|
|
|
UNAME := $(shell uname)
|
|
|
|
|
|
|
|
FS_INC =
|
|
|
|
ifneq ($(UNAME), Darwin)
|
|
|
|
FS_INC += -lstdc++fs
|
|
|
|
endif
|
2021-01-02 04:24:29 +00:00
|
|
|
|
|
|
|
SRC_DIRS := ZAPD ZAPD/ZRoom ZAPD/ZRoom/Commands ZAPD/Overlays ZAPD/HighLevel ZAPD/OpenFBX
|
|
|
|
|
|
|
|
CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp))
|
2021-01-09 00:38:28 +00:00
|
|
|
CPP_FILES += lib/tinyxml2/tinyxml2.cpp
|
2021-01-02 04:24:29 +00:00
|
|
|
O_FILES := $(CPP_FILES:.cpp=.o)
|
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
all: ZAPD.out copycheck
|
2021-03-14 15:40:25 +00:00
|
|
|
|
|
|
|
genbuildinfo:
|
|
|
|
python3 ZAPD/genbuildinfo.py
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
copycheck: ZAPD.out
|
|
|
|
python3 copycheck.py
|
|
|
|
|
2021-01-09 00:38:28 +00:00
|
|
|
clean:
|
2021-01-02 04:24:29 +00:00
|
|
|
rm -f $(O_FILES) ZAPD.out
|
2021-03-20 16:02:12 +00:00
|
|
|
$(MAKE) -C lib/libgfxd clean
|
2021-01-02 04:24:29 +00:00
|
|
|
|
|
|
|
rebuild: clean all
|
|
|
|
|
2021-04-30 21:23:22 +00:00
|
|
|
%.o: %.cpp
|
|
|
|
$(CC) $(CFLAGS) $(INC) -c $< -o $@ $(LDFLAGS)
|
|
|
|
|
|
|
|
ZAPD/Main.o: genbuildinfo ZAPD/Main.cpp
|
|
|
|
$(CC) $(CFLAGS) $(INC) -c ZAPD/Main.cpp -o $@ $(LDFLAGS)
|
2021-01-02 04:24:29 +00:00
|
|
|
|
2021-03-20 16:02:12 +00:00
|
|
|
lib/libgfxd/libgfxd.a:
|
|
|
|
$(MAKE) -C lib/libgfxd -j
|
|
|
|
|
|
|
|
ZAPD.out: $(O_FILES) lib/libgfxd/libgfxd.a
|
2021-04-30 21:23:22 +00:00
|
|
|
$(CC) $(CFLAGS) $(INC) $(O_FILES) lib/libgfxd/libgfxd.a -o $@ $(FS_INC) $(LDFLAGS)
|