summaryrefslogtreecommitdiff
blob: 8a66a54a29bd7de28606495c2d7c876d3d47e0f4 (plain)
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
diff --git a/makefile b/makefile
index 60129a707..45ac2639d 100644
--- a/makefile
+++ b/makefile
@@ -226,7 +226,7 @@ CPP = cpp
 #So, -nostdinc will prevent the whole own comment blob of cpp to get generated
 #in the first place, as we never asked for it:
 #CPPFLAGS = -C -P -nostdinc
-CPPFLAGS = -x c -E -Wp,-C,-P,-nostdinc,-Wno-format-overflow
+CPPFLAGS = -x c -E -Wp,-C,-P,-nostdinc,-Wno-format-overflow $(GENTOO_CPPFLAGS)
 
 # gcc variant:
 #CPP = gcc
@@ -237,6 +237,21 @@ CPPFLAGS = -x c -E -Wp,-C,-P,-nostdinc,-Wno-format-overflow
 # For variations with X11
 X11BASE = /usr/X11R6
 
+# Defines
+ifdef USE_SDL
+CFLAGS += -DSOUND_SDL -I/usr/local/include/SDL2 -I/usr/include/SDL2 $(shell sdl-config --cflags)
+SDL_LIBS = $(shell sdl-config --libs) -lSDL2 -lSDL2_mixer
+endif
+
+ifdef USE_X
+CFLAGS += -DUSE_X11
+LIBS += -lX11
+endif
+
+CFLAGS += -Wall
+CFLAGS += -DUSE_GCU -D_XOPEN_SOURCE -D_DEFAULT_SOURCE -DMEXP=19937 -std=c99
+LIBS += $(shell ${PKG_CONFIG} --libs ncurses) -lcrypt -lm ${SDL_LIBS}
+
 
 # Account editor
 ACCEDIT_LIBS = -lncurses -lcrypt
@@ -291,12 +306,10 @@ SERVER_EXTRA_LIBS = -lcrypt
 
 # With SDL2
 #  With sdl2-config
-CFLAGS = -pipe -Wall -DUSE_GCU -D_XOPEN_SOURCE -D_BSD_SOURCE -DMEXP=19937 -std=c99 -D_DEFAULT_SOURCE -DACC32 -fPIE -fsigned-char
 # Note: -fsigned-char is important for ARM64, as there 'char' is by default unsigned, while on x86/AM64 it is by default signed!
 #  With manually set prefix
 #CFLAGS = -pipe -Wall -DUSE_X11 -DUSE_GCU -I${X11BASE}/include -D_XOPEN_SOURCE -D_BSD_SOURCE -DMEXP=19937 -std=c99 -DSOUND_SDL -I/usr/local/include/SDL2 -I/usr/include/SDL2 -D_REENTRANT -D_DEFAULT_SOURCE -DACC32 -fPIE -Wno-format-truncation
 #  With sdl2-config
-LIBS = -L/usr/pkg/lib -lncurses -lm
 #  With manually set prefix
 #LIBS = -L${X11BASE}/lib -L/usr/pkg/lib -lX11 -lncurses -lm -L/usr/local/lib -L/usr/lib -pthread -lSDL2 -lSDL2_mixer