-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.mk
62 lines (46 loc) · 1.92 KB
/
config.mk
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
# Where to install the software.
PREFIX = /usr/local
# How to find the SDL2 headers.
#
# TIP: Use `sdl2-config --cflags` or `pkg-config sdl2 --cflags` to get the
# correct values for your system.
#
# NOTE: Using `-isystem` instead of the usual `-I` flag to consider the SDL2
# header-files as system-files and omit them from listed dependencies.
SDL2_INCS = -isystem /usr/include/SDL2 -D_REENTRANT
# How to link against the SDL2 libraries.
# TIP: Use `sdl2-config --libs` or `pkg-config sdl2 --libs` to get the
# correct values for your system.
SDL2_LIBS = -L/usr/lib -Wl,-rpath,/usr/lib -Wl,--enable-new-dtags -lSDL2
# Which compiler and linker-wrapper to use.
CC = cc
# Which checks to perform on the source-code.
WRN_FLAGS = -std=c99 -Wall -Wextra -Wpedantic
# How much to optimize the generated code.
OPT_FLAGS = -DNDEBUG -O3
# How to instruct the compiler to generate a make-compliant ".d" dependency-
# file as the side-effect of compiling a ".c" file.
#
# WARNING: This only works with GCC and compilers that emulate its flags.
MAK_FLAGS = -MT $(<:.c=.o) -MMD
# Additional flags per source-file useful during development.
DEV_FLAGS = $(MAK_FLAGS) -g1 -Werror -pedantic-errors
# Which flags to pass to the C compiler.
CFLAGS = $(SDL2_INCS) $(WRN_FLAGS) $(OPT_FLAGS)
# Which flags to pass to the linker-wrapper.
LDFLAGS =
# Which extra libraries to include during the linking step.
LDLIBS = $(SDL2_LIBS)
# Gather the automatically-generated dependency-information into a single file.
MK_DEPEND_MK = cat $(DEPS) | sed 's/^[ \t]*$$//' | sed '/^$$/d' > depend.mk
# How to create an object-file from source-code.
.c.o:
$(CC) $(CFLAGS) $(DEV_FLAGS) -c $< -o $@
# How to remove a file without complaining about missing files.
RM_Q = rm -f
# How to copy a file without complaining about existing files.
CP_Q = cp -f
# How to create a directory and intermediate directories as needed.
MKDIR_P = mkdir -p
# How to remove an empty directory.
RMDIR = rmdir