forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ja2-stracciatella-0.12.1_p7072-makefile.patch
179 lines (152 loc) · 3.58 KB
/
ja2-stracciatella-0.12.1_p7072-makefile.patch
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
From: Julian Ospald <[email protected]>
Date: Tue May 8 19:16:08 UTC 2012
Subject: build system
--- Makefile
+++ Makefile
@@ -16,106 +16,94 @@
MANPREFIX ?= $(PREFIX)
INSTALL ?= install
-INSTALL_PROGRAM ?= $(INSTALL) -m 555 -s
-INSTALL_MAN ?= $(INSTALL) -m 444
-INSTALL_DATA ?= $(INSTALL) -m 444
+INSTALL_PROGRAM ?= $(INSTALL) -m 755
+INSTALL_MAN ?= $(INSTALL) -m 644
+INSTALL_DATA ?= $(INSTALL) -m 644
+# compiler CFLAGS
+CFLAGS += -std=gnu99
+# sdl-flags
SDL_CONFIG ?= sdl-config
ifndef CFLAGS_SDL
CFLAGS_SDL := $(shell $(SDL_CONFIG) --cflags)
endif
ifndef LDFLAGS_SDL
-LDFLAGS_SDL := $(shell $(SDL_CONFIG) --libs)
+LIBS_SDL := $(shell $(SDL_CONFIG) --libs)
endif
+# LIBS
+LIBS += $(LIBS_SDL)
+LIBS += -lm
+
+ifdef WITH_ZLIB
+LIBS += -lz
+endif
-CFLAGS += $(CFLAGS_SDL)
-CFLAGS += -I Build
-CFLAGS += -I Build/Tactical
-CFLAGS += -I Build/Strategic
-CFLAGS += -I Build/Editor
-CFLAGS += -I Build/Res
-CFLAGS += -I Build/Laptop
-CFLAGS += -I Build/Utils
-CFLAGS += -I Build/TileEngine
-CFLAGS += -I Build/TacticalAI
-CFLAGS += -I sgp
-
-#CFLAGS += -Wall
-#CFLAGS += -W
-CFLAGS += -Wpointer-arith
-CFLAGS += -Wreturn-type
-CFLAGS += -Wunused-label
-CFLAGS += -Wunused-variable
-CFLAGS += -Wwrite-strings
-CFLAGS += -DJA2
+# preprocessor flags
+CPPFLAGS += $(CFLAGS_SDL)
+CPPFLAGS += -I Build
+CPPFLAGS += -I Build/Tactical
+CPPFLAGS += -I Build/Strategic
+CPPFLAGS += -I Build/Editor
+CPPFLAGS += -I Build/Res
+CPPFLAGS += -I Build/Laptop
+CPPFLAGS += -I Build/Utils
+CPPFLAGS += -I Build/TileEngine
+CPPFLAGS += -I Build/TacticalAI
+CPPFLAGS += -I sgp
+CPPFLAGS += -DJA2
ifdef WITH_DEMO
- CFLAGS += -DJA2DEMO
+ CPPFLAGS += -DJA2DEMO
endif
ifdef WITH_DEMO_ADS
ifndef WITH_DEMO
$(error WITH_DEMO_ADS needs WITH_DEMO)
endif
- CFLAGS += -DJA2DEMOADS
+ CPPFLAGS += -DJA2DEMOADS
endif
ifdef WITH_FIXMES
- CFLAGS += -DWITH_FIXMES
+ CPPFLAGS += -DWITH_FIXMES
endif
ifdef WITH_MAEMO
- CFLAGS += -DWITH_MAEMO
+ CPPFLAGS += -DWITH_MAEMO
endif
ifdef WITH_SOUND_DEBUG
- CFLAGS += -DWITH_SOUND_DEBUG
+ CPPFLAGS += -DWITH_SOUND_DEBUG
endif
ifdef _DEBUG
- CFLAGS += -D_DEBUG
+ CPPFLAGS += -D_DEBUG
ifndef JA2TESTVERSION
JA2TESTVERSION := yes
endif
endif
ifdef JA2TESTVERSION
- CFLAGS += -DJA2TESTVERSION
+ CPPFLAGS += -DJA2TESTVERSION
ifndef JA2BETAVERSION
JA2BETAVERSION := yes
endif
endif
ifdef JA2BETAVERSION
-CFLAGS += -DJA2BETAVERSION -DSGP_DEBUG -DFORCE_ASSERTS_ON -DSGP_VIDEO_DEBUGGING
+CPPFLAGS += -DJA2BETAVERSION -DSGP_DEBUG -DFORCE_ASSERTS_ON -DSGP_VIDEO_DEBUGGING
endif
ifdef JA2EDITOR
-CFLAGS += -DJA2EDITOR
+CPPFLAGS += -DJA2EDITOR
endif
-CFLAGS += -D$(LNG)
-
-CFLAGS += -DSGPDATADIR=\"$(SGPDATADIR)\"
-
-CCFLAGS += $(CFLAGS)
-CCFLAGS += -std=gnu99
-CCFLAGS += -Werror-implicit-function-declaration
-CCFLAGS += -Wimplicit-int
-CCFLAGS += -Wmissing-prototypes
+CPPFLAGS += -D$(LNG)
+CPPFLAGS += -DSGPDATADIR=\"$(SGPDATADIR)\"
-CXXFLAGS += $(CFLAGS)
-
-LDFLAGS += $(LDFLAGS_SDL)
-LDFLAGS += -lm
-
-ifdef WITH_ZLIB
-LDFLAGS += -lz
-endif
SRCS :=
SRCS += Build/AniViewScreen.cc
@@ -468,7 +456,7 @@
.SUFFIXES:
.SUFFIXES: .c .cc .d .o
-Q ?= @
+Q =
all: $(BINARY)
@@ -476,15 +464,15 @@
$(BINARY): $(OBJS)
@echo '===> LD $@'
- $(Q)$(CXX) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $@
+ $(Q)$(CXX) $(CXXFLAGS) $(OBJS) $(LDFLAGS) -o $@ $(LIBS)
.c.o:
@echo '===> CC $<'
- $(Q)$(CC) $(CCFLAGS) -c -MMD -o $@ $<
+ $(Q)$(CC) $(CFLAGS) $(CPPFLAGS) -c -MMD -o $@ $<
.cc.o:
@echo '===> CXX $<'
- $(Q)$(CXX) $(CXXFLAGS) -c -MMD -o $@ $<
+ $(Q)$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -MMD -o $@ $<
clean distclean:
@echo '===> CLEAN'