-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
100 lines (82 loc) · 2.34 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Alternative GNU Make workspace makefile autogenerated by Premake
ifndef config
config=debug
endif
ifndef verbose
SILENT = @
endif
ifeq ($(config),debug)
ImGui_config = debug
GLFW_config = debug
Glad_config = debug
Walnut_config = debug
WalnutApp_config = debug
else ifeq ($(config),release)
ImGui_config = release
GLFW_config = release
Glad_config = release
Walnut_config = release
WalnutApp_config = release
else ifeq ($(config),dist)
ImGui_config = dist
GLFW_config = dist
Glad_config = dist
Walnut_config = dist
WalnutApp_config = dist
else
$(error "invalid configuration $(config)")
endif
PROJECTS := ImGui GLFW Glad Walnut WalnutApp
.PHONY: all clean help $(PROJECTS) Core Dependencies
all: $(PROJECTS)
Core: Walnut
Dependencies: GLFW Glad ImGui
ImGui:
ifneq (,$(ImGui_config))
@echo "==== Building ImGui ($(ImGui_config)) ===="
@${MAKE} --no-print-directory -C vendor/imgui -f Makefile config=$(ImGui_config)
endif
GLFW:
ifneq (,$(GLFW_config))
@echo "==== Building GLFW ($(GLFW_config)) ===="
@${MAKE} --no-print-directory -C vendor/glfw -f Makefile config=$(GLFW_config)
endif
Glad:
ifneq (,$(Glad_config))
@echo "==== Building Glad ($(Glad_config)) ===="
@${MAKE} --no-print-directory -C vendor/glad -f Makefile config=$(Glad_config)
endif
Walnut: ImGui GLFW
ifneq (,$(Walnut_config))
@echo "==== Building Walnut ($(Walnut_config)) ===="
@${MAKE} --no-print-directory -C Walnut -f Makefile config=$(Walnut_config)
endif
WalnutApp: Walnut
ifneq (,$(WalnutApp_config))
@echo "==== Building WalnutApp ($(WalnutApp_config)) ===="
@${MAKE} --no-print-directory -C WalnutApp -f Makefile config=$(WalnutApp_config)
endif
clean:
@${MAKE} --no-print-directory -C vendor/imgui -f Makefile clean
@${MAKE} --no-print-directory -C vendor/glfw -f Makefile clean
@${MAKE} --no-print-directory -C vendor/glad -f Makefile clean
@${MAKE} --no-print-directory -C Walnut -f Makefile clean
@${MAKE} --no-print-directory -C WalnutApp -f Makefile clean
help:
@echo "Usage: make [config=name] [target]"
@echo ""
@echo "CONFIGURATIONS:"
@echo " debug"
@echo " release"
@echo " dist"
@echo ""
@echo "TARGETS:"
@echo " all (default)"
@echo " clean"
@echo " ImGui"
@echo " GLFW"
@echo " Glad"
@echo " Walnut"
@echo " WalnutApp"
@echo ""
@echo "For more information, see https://github.com/premake/premake-core/wiki"