-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (76 loc) · 4.4 KB
/
Copy pathMakefile
File metadata and controls
81 lines (76 loc) · 4.4 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
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
# Copyright © 2024–2026 rzrn
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
all clean nuke download game chksum depend printenv:
@touch build/prerequisites.mk
@. build/configure.sh && $(MAKE) -f build/prerequisites.mk -f build/flags.mk -f build/rules.mk $@
help:
@echo "Usage: [VAR1=VALUE1] [VAR2=VALUE2] ... make [VAR3=VALUE3] ... [TARGET]"
@echo ""
@echo "Note that ‘make VAR=VALUE [TARGET]’ may produce results you do not expect. Gen-"
@echo "erally, you place variables specified in ‘build/configure.mk’ before the ‘make’"
@echo "command, and variables specified in ‘build/flags.mk’ after it."
@echo ""
@echo "If you have any doubts about what command to use, then ‘TOOLKIT=GLFW make game’"
@echo "is most likely what you need."
@echo ""
@echo "Targets:"
@echo " all Build the game binary only."
@echo " NB: this target DOES NOT prepare the game distribution."
@echo " clean Clean up object files located in the ‘src/’ directory."
@echo " nuke Clean up object files both in ‘src/’ and ‘vendor/’ directories."
@echo " download Download game resources."
@echo " game Prepare the game distribution."
@echo " NB: this target may use your network connection to download game"
@echo " resources."
@echo " chksum Verify checksum using a specified $HASHPROG tool."
@echo " depend Run ‘makedepend’ to generate dependency tree ‘build/prerequisite"
@echo " s.mk’. Useful for developers."
@echo " printenv Print flags exported by the ‘build/configure.sh’ script for your"
@echo " reference."
@echo " help Display this message."
@echo ""
@echo "Variables specified in ‘build/configure.mk’:"
@echo " PLATFORM One of these: NT, Linux, Mac, FreeBSD, Haiku."
@echo " By default, it is chosen based on the output of the ‘uname’ com-"
@echo " mand."
@echo " PROFILE Either ‘RELEASE’ or ‘DEBUG’."
@echo " COMMITHASH A short git commit hash shown in the game interface."
@echo " By default, it is autogenerated but may be overridden for custom"
@echo " builds."
@echo " TOOLKIT One of these: SDL, GLFW, GLUT, Cocoa."
@echo " OPTLEVEL The code optimization level passed to the compiler when the ‘REL"
@echo " EASE’ profile is selected."
@echo " CFLAGS1 Additional CFLAGS for the ‘src/’ subdirectory."
@echo " CFLAGS2 Additional CFLAGS for the ‘vendor/’ subdirectory."
@echo " LDFLAGS Optional LDFLAGS used to link the game binary."
@echo ""
@echo "Variables specified in ‘build/flags.mk’:"
@echo " CC C compiler command."
@echo " LD Linker command."
@echo " RESDIR Directory with game resources other than from $PACKFILE."
@echo " GAMEDIR The game distribution directory."
@echo " EXEFILE Name of the game binary."
@echo " PACKURL URL where game resources are available."
@echo " PACKFILE Path to the file with game resources."
@echo " HASHPROG Command used to verify the hash of the game resources archive."
@echo ""
@echo "To inspect the relevant environment variables generated by the ‘build/configure"
@echo ".sh’ script, use"
@echo " VAR1=VALUE1 <...> make VAR2=VALUE2 <...> printenv"
@echo "Note that CFLAGS passed as ‘CFLAGS1=<...> make <...>’ are appended to the other"
@echo "parameters generated by the ‘build/configure.sh’ script. To override these, you"
@echo "can either pass them like this:"
@echo " make CFLAGS1=<...> <...>,"
@echo "or consider the manual invocation like this:"
@echo " make -f build/prerequisites.mk -f build/flags.mk -f build/rules.mk CFLAGS1=<."
@echo " ..> CFLAGS2=<...> <...>,"
@echo "which you can place in your custom build script."