-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (45 loc) · 1.09 KB
/
Makefile
File metadata and controls
53 lines (45 loc) · 1.09 KB
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
DB := lldb
SHELL := zsh
.DEFAULT_GOAL := help
.PHONY: clean run debug help build
BUILD_DIR = ./build
ifndef BIN_NAME
BIN_NAME := wave-function-collapse
endif
ifndef CONFIG
CONFIG=debug
endif
clean:
rm -rf $(BUILD_DIR);\
cd external/vk-engine;\
make clean;\
cd ../..
build:
@cd external/vk-engine;\
make lib CONFIG=$(CONFIG);\
cd ../..;\
premake5 gmake2;\
cd $(BUILD_DIR);\
make config=$(CONFIG);\
cd ..
run: build
ifeq ($(CONFIG), debug)
@./build/bin/Debug/$(BIN_NAME) $(ARGS)
else
@./build/bin/Release/$(BIN_NAME) $(ARGS)
endif
debug:
@premake5 gmake2;\
cd $(BUILD_DIR);\
make config=debug;\
$(DB) ./bin/Debug/$(BIN_NAME);\
cd ..
help:
@echo "Usage: make { clean | run | debug | help }"
@echo " clean - Remove build artifacts"
@echo " build - Compile and link the program"
@echo " run - Compile, link and run the program"
@echo " debug - Compile, link and run the program in the debugger"
@echo " The default debugger is 'lldb', but can be changed"
@echo " by setting 'make debug DB=<your preferred debugger>'"
@echo " help - Show this message"