-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (35 loc) · 1.3 KB
/
Makefile
File metadata and controls
53 lines (35 loc) · 1.3 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
BUILD_DIR := ./build
CMAKE := cmake
GENERATOR := # Uses default generator, which may be "Unix makefiles"
# If found, will use ninja, since it's more performant
ifneq (, $(shell which ninja))
GENERATOR := -G"Ninja"
endif
define build_target
$(eval arg = $1)
endef
LIBS = $(shell echo $(subst Engine/,,$(shell find Engine/ -maxdepth 1 -type d)) | tr A-Z a-z)
PRESET = debug
LIST_PRESETS_TYPE = configure
ALL_EXAMPLES = $(subst examples/,,$(shell find examples/ -maxdepth 1 -type d))
all: libs ## make libs
help: ## Show this help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-10s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
libs: | init_configure ## Build all libraries
@${CMAKE} --preset ${PRESET}
clean: ## Clean build directory
@rm -rf ${BUILD_DIR}
re: clean all ## Clean and build all
init_configure:
@${CMAKE} --preset ${PRESET}
list-presets:
@${CMAKE} --list-presets=${LIST_PRESETS_TYPE}
test: ## Run tests
@${CMAKE} --build --preset=${PRESET}-tests
examples: ## Build all examples (use make `example_name` to run a specific example)
@${CMAKE} --build --preset=${PRESET}-examples
${ALL_EXAMPLES}: examples
./${BUILD_DIR}/${PRESET}/examples/$@/$@
setup-tidy:
@${CMAKE} --preset=setup-tidy
.PHONY: clean all test examples libs setup-tidy