Debian Codegraph @

makefile

raw symbols ◀ ▶
Source reconstructed at patch state 1 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1
2 # !!! FIXME: Make this more robust. MUCH more robust.
3 # !!! FIXME: ...or at least comment the rest of these options...
4
5 BINDIR := ./bin
6 SRCDIR := .
7
8 ifeq ($(WITH_STEAMWORKS),1)
9 steamworks := true
10 endif
11
12 ifeq ($(PANDORA),1)
13 macosx := false
14 CPUARCH := arm
15 CC := gcc
16 CXX := g++
17 LINKER := g++
18 steamworks := false
19 CFLAGS += -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -DPANDORA
20 CLIENTEXE := $(BINDIR)/postal1-arm
21 else ifeq ($(ODROID),1)
22 macosx := false
23 CPUARCH := arm
24 CC := gcc
25 CXX := g++
26 LINKER := g++
27 steamworks := false
28 CFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=hard -ftree-vectorize -ffast-math -DODROID
29 CLIENTEXE := $(BINDIR)/postal1-arm
30 else ifeq ($(linux_x86),1)
31 target := linux_x86
32 CFLAGS += -m32
33 CLIENTEXE := $(BINDIR)/postal1-x86
34 else ifeq ($(macosx_x86),1)
35 target := macosx_x86
36 CLIENTEXE := $(BINDIR)/postal1-x86
37 else
38 target := linux_x86_64
39 CLIENTEXE := $(BINDIR)/postal1-x86_64
40 endif
41
42 # ----------------------------------------------------- ... bleh.
43
44 ifeq ($(strip $(target)),linux_x86)
45 macosx := false
46 CPUARCH := x86
47 CC := gcc
48 CXX := g++
49 LINKER := g++ -m32
50 endif
51 ifeq ($(strip $(target)),linux_x86_64)
52 macosx := false
53 CPUARCH := x86_64
54 CC ?= gcc
55 CXX ?= g++
56 LINKER ?= g++
57 endif
58 ifeq ($(strip $(target)),macosx_x86)
59 macosx := true
60 CPUARCH := x86
61 CC := gcc
62 CXX := g++
63 LINKER := g++
64 endif
65
66 CLEANUP := $(wildcard *.exe) $(wildcard *.obj) \
67 $(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \
68 $(wildcard *~) $(wildcard *.err) \
69 $(wildcard .\#*) core
70
71 SRCS := \
72 AnimThing.cpp \
73 ball.cpp \
74 barrel.cpp \
75 bouy.cpp \
76 character.cpp \
77 chunk.cpp \
78 deathWad.cpp \
79 demon.cpp \
80 dispenser.cpp \
81 doofus.cpp \
82 dude.cpp \
83 explode.cpp \
84 fire.cpp \
85 fireball.cpp \
86 firebomb.cpp \
87 flag.cpp \
88 flagbase.cpp \
89 grenade.cpp \
90 heatseeker.cpp \
91 hood.cpp \
92 item3d.cpp \
93 mine.cpp \
94 napalm.cpp \
95 navnet.cpp \
96 ostrich.cpp \
97 person.cpp \
98 PowerUp.cpp \
99 pylon.cpp \
100 rocket.cpp \
101 sentry.cpp \
102 SndRelay.cpp \
103 SoundThing.cpp \
104 thing.cpp \
105 Thing3d.cpp \
106 trigger.cpp \
107 warp.cpp \
108 weapon.cpp \
109 alphablitforpostal.cpp \
110 Anim3D.cpp \
111 BufQ.cpp \
112 bulletFest.cpp \
113 camera.cpp \
114 crawler.cpp \
115 cutscene.cpp \
116 encrypt.cpp \
117 gameedit.cpp \
118 GameSettings.cpp \
119 grip.cpp \
120 IdBank.cpp \
121 InputSettings.cpp \
122 InputSettingsDlg.cpp \
123 keys.cpp \
124 Log.cpp \
125 logtab.cpp \
126 MemFileFest.cpp \
127 MenuSettings.cpp \
128 MenuTrans.cpp \
129 net.cpp \
130 NetBrowse.cpp \
131 NetClient.cpp \
132 NetDlg.cpp \
133 netmsgr.cpp \
134 NetServer.cpp \
135 organ.cpp \
136 Personatorium.cpp \
137 ProtoBSDIP.cpp \
138 realm.cpp \
139 scene.cpp \
140 score.cpp \
141 settings.cpp \
142 smash.cpp \
143 socket.cpp \
144 StockPile.cpp \
145 TexEdit.cpp \
146 toolbar.cpp \
147 TriggerRegions.cpp \
148 update.cpp \
149 yatime.cpp \
150 aivars.cpp \
151 band.cpp \
152 credits.cpp \
153 game.cpp \
154 input.cpp \
155 localize.cpp \
156 main.cpp \
157 menus.cpp \
158 play.cpp \
159 SampleMaster.cpp \
160 title.cpp
161
162 RSSRCS := \
163 RSPiX/Src/BLUE/unix/Bdebug.cpp \
164 RSPiX/Src/BLUE/unix/Bjoy.cpp \
165 RSPiX/Src/BLUE/unix/Bkey.cpp \
166 RSPiX/Src/BLUE/unix/Bmain.cpp \
167 RSPiX/Src/BLUE/unix/Bmouse.cpp \
168 RSPiX/Src/BLUE/unix/Btime.cpp \
169 RSPiX/Src/BLUE/unix/Bdisp.cpp \
170 RSPiX/Src/BLUE/unix/Bsound.cpp \
171 RSPiX/Src/GREEN/Hot/hot.cpp \
172 RSPiX/Src/GREEN/Image/Image.cpp \
173 RSPiX/Src/GREEN/Image/Imagecon.cpp \
174 RSPiX/Src/GREEN/Image/ImageFile.cpp \
175 RSPiX/Src/GREEN/InputEvent/InputEvent.cpp \
176 RSPiX/Src/GREEN/Mix/mix.cpp \
177 RSPiX/Src/GREEN/Mix/MixBuf.cpp \
178 RSPiX/Src/GREEN/Image/pal.cpp \
179 RSPiX/Src/GREEN/Image/PalFile.cpp \
180 RSPiX/Src/GREEN/Sample/sample.cpp \
181 RSPiX/Src/GREEN/Snd/snd.cpp \
182 RSPiX/Src/GREEN/SndFx/SndFx.cpp \
183 RSPiX/Src/GREEN/Task/task.cpp \
184 RSPiX/Src/GREEN/3D/pipeline.cpp \
185 RSPiX/Src/GREEN/3D/render.cpp \
186 RSPiX/Src/GREEN/3D/types3d.cpp \
187 RSPiX/Src/GREEN/3D/zbuffer.cpp \
188 RSPiX/Src/GREEN/BLiT/alphablit.cpp \
189 RSPiX/Src/GREEN/BLiT/BLIT.cpp \
190 RSPiX/Src/GREEN/BLiT/BLITINIT.cpp \
191 RSPiX/Src/GREEN/BLiT/BLiTT.cpp \
192 RSPiX/Src/GREEN/BLiT/CFNT.cpp \
193 RSPiX/Src/GREEN/BLiT/Fspr1.cpp \
194 RSPiX/Src/GREEN/BLiT/FSPR8.cpp \
195 RSPiX/Src/GREEN/BLiT/line.cpp \
196 RSPiX/Src/GREEN/BLiT/mono.cpp \
197 RSPiX/Src/GREEN/BLiT/Rotate96.cpp \
198 RSPiX/Src/GREEN/BLiT/RPrint.cpp \
199 RSPiX/Src/GREEN/BLiT/ScaleFlat.cpp \
200 RSPiX/Src/ORANGE/GameLib/ANIMSPRT.cpp \
201 RSPiX/Src/ORANGE/Attribute/attribute.cpp \
202 RSPiX/Src/ORANGE/GUI/btn.cpp \
203 RSPiX/Src/ORANGE/Channel/channel.cpp \
204 RSPiX/Src/ORANGE/color/colormatch.cpp \
205 RSPiX/Src/ORANGE/DirtRect/DirtRect.cpp \
206 RSPiX/Src/ORANGE/color/dithermatch.cpp \
207 RSPiX/Src/ORANGE/GUI/dlg.cpp \
208 RSPiX/Src/ORANGE/GUI/edit.cpp \
209 RSPiX/Src/ORANGE/File/file.cpp \
210 RSPiX/Src/ORANGE/QuickMath/FixedPoint.cpp \
211 RSPiX/Src/ORANGE/GUI/guiItem.cpp \
212 RSPiX/Src/ORANGE/IFF/iff.cpp \
213 RSPiX/Src/ORANGE/ImageTools/lasso.cpp \
214 RSPiX/Src/ORANGE/Laymage/laymage.cpp \
215 RSPiX/Src/ORANGE/GUI/ListBox.cpp \
216 RSPiX/Src/ORANGE/GUI/ListContents.cpp \
217 RSPiX/Src/ORANGE/Meter/meter.cpp \
218 RSPiX/Src/ORANGE/MsgBox/MsgBox.cpp \
219 RSPiX/Src/ORANGE/GUI/MultiBtn.cpp \
220 RSPiX/Src/ORANGE/MultiGrid/MultiGrid.cpp \
221 RSPiX/Src/ORANGE/MultiGrid/MultiGridIndirect.cpp \
222 RSPiX/Src/ORANGE/GUI/ProcessGui.cpp \
223 RSPiX/Src/ORANGE/Debug/profile.cpp \
224 RSPiX/Src/ORANGE/GUI/PushBtn.cpp \
225 RSPiX/Src/ORANGE/QuickMath/QuickMath.cpp \
226 RSPiX/Src/ORANGE/GameLib/Region.cpp \
227 RSPiX/Src/ORANGE/RString/rstring.cpp \
228 RSPiX/Src/ORANGE/GUI/scrollbar.cpp \
229 RSPiX/Src/ORANGE/GameLib/SHAPES.cpp \
230 RSPiX/Src/ORANGE/Parse/SimpleBatch.cpp \
231 RSPiX/Src/ORANGE/GameLib/SPRITE.cpp \
232 RSPiX/Src/ORANGE/str/str.cpp \
233 RSPiX/Src/ORANGE/GUI/txt.cpp \
234 RSPiX/Src/CYAN/Unix/uDialog.cpp \
235 RSPiX/Src/CYAN/Unix/uColors.cpp \
236 RSPiX/Src/CYAN/Unix/uPath.cpp
237
238 WSRCS := \
239 WishPiX/Menu/menu.cpp \
240 WishPiX/Prefs/prefline.cpp \
241 WishPiX/Prefs/prefs.cpp \
242 WishPiX/ResourceManager/resmgr.cpp \
243 WishPiX/Spry/spry.cpp
244
245 # wtf is THIS?!
246 #RSPiX/Src/ORANGE/MTask/mtask.cpp \
247
248 SRCS += $(RSSRCS)
249 SRCS += $(WSRCS)
250
251 RSOBJS := $(RSSRCS:.cpp=.o)
252 RSOBJS := $(foreach f,$(RSOBJS),$(BINDIR)/$(f))
253
254 OBJS0 := $(SRCS:.s=.o)
255 OBJS1 := $(OBJS0:.c=.o)
256 OBJS2 := $(OBJS1:.cpp=.o)
257 OBJS3 := $(OBJS2:.nasm=.o)
258 OBJS4 := $(OBJS3:.s=.o)
259 OBJS := $(foreach f,$(OBJS4),$(BINDIR)/$(f))
260 SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f))
261
262 EBINDIR := ./extra
263 ESRCS := \
264 saktool.c
265
266 EOBJS := $(ESRCS:.c=.o)
267 EOBJS := $(foreach f,$(EOBJS),$(EBINDIR)/$(f))
268 ESRCS := $(foreach f,$(ESRCS),$(SRCDIR)/$(f))
269
270 # !!! FIXME: Get -Wall in here, some day.
271 CFLAGS += -fsigned-char -DPLATFORM_UNIX -w
272
273 ifeq ($(strip $(macosx)),true)
274 CFLAGS += -DPLATFORM_MACOSX
275 endif
276
277 # defines the game needs...
278 CFLAGS += -DLOCALE=US -DTARGET=POSTAL_2015
279
280 # includes ...
281 CFLAGS += -I$(SRCDIR)
282 CFLAGS += -I$(SRCDIR)/SDL2/include
283 CFLAGS += -I$(SRCDIR)/RSPiX
284 CFLAGS += -I$(SRCDIR)/RSPiX/Inc
285 CFLAGS += -I$(SRCDIR)/RSPiX/Src
286 CFLAGS += -I$(SRCDIR)/RSPiX/Src/BLUE
287 CFLAGS += -I$(SRCDIR)/RSPiX/Src/BLUE/unix
288 CFLAGS += -I$(SRCDIR)/RSPiX/Src/CYAN
289 CFLAGS += -I$(SRCDIR)/RSPiX/Src/CYAN/Unix
290 CFLAGS += -I$(SRCDIR)/RSPiX/Src/ORANGE
291 CFLAGS += -I$(SRCDIR)/RSPiX/Src/ORANGE/CDT
292 CFLAGS += -I$(SRCDIR)/RSPiX/Src/ORANGE/GameLib
293 CFLAGS += -I$(SRCDIR)/RSPiX/Src/ORANGE/File
294 CFLAGS += -I$(SRCDIR)/RSPiX/Src/ORANGE/Multigrid
295 CFLAGS += -I$(SRCDIR)/RSPiX/Src/GREEN/Image
296 CFLAGS += -I$(SRCDIR)/WishPiX
297 CFLAGS += -I$(SRCDIR)/WishPiX/Spry
298
299 ifeq ($(strip $(expiring_beta)),true)
300 CFLAGS += -DBETAEXPIRE=$(shell date +%s)
301 endif
302
303 ifeq ($(strip $(macosx)),true)
304 CFLAGS += -arch i386 -mmacosx-version-min=10.6
305 LDFLAGS += -arch i386 -mmacosx-version-min=10.6
306 LDFLAGS += -framework CoreFoundation -framework Cocoa
307 LIBS += SDL2/libs/macosx/libSDL2-2.0.0.dylib
308 STEAMLDFLAGS += steamworks/sdk/redistributable_bin/osx32/libsteam_api.dylib
309 else
310 ifeq ($(CPUARCH),arm)
311 LIBS += -lSDL2
312 else
313 ifeq ($(CPUARCH),x86_64)
314 LIBS += -lSDL2
315 else
316 LIBS += SDL2/libs/linux-x86/libSDL2-2.0.so.0
317 LDFLAGS += -Wl,-rpath,\$$ORIGIN
318 STEAMLDFLAGS += steamworks/sdk/redistributable_bin/linux32/libsteam_api.so
319 endif
320 endif
321 endif
322
323 ifeq ($(strip $(steamworks)),true)
324 CFLAGS += -DWITH_STEAMWORKS=1 -Isteamworks/sdk/public
325 LDFLAGS += $(STEAMLDFLAGS)
326 endif
327
328 CFLAGS += -DALLOW_TWINSTICK
329
330 .PHONY: all bindir
331
332
333 all: debugoff $(CLIENTEXE)
334
335
336 debug: debugon $(CLIENTEXE)
337
338 debugon:
339 $(eval CFLAGS += -DDEBUG -D_DEBUG -O0 -g)
340
341 debugoff:
342 $(eval OPTFLAG := -O3)
343 $(eval CFLAGS += -DNDEBUG -D_NDEBUG -O2)
344
345 $(BINDIR)/%.o: $(SRCDIR)/%.s
346 $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
347
348 $(BINDIR)/%.o: $(SRCDIR)/%.cpp
349 $(CXX) -c -o $@ $< $(CFLAGS) -std=c++03
350
351 $(BINDIR)/%.o: $(SRCDIR)/%.c
352 $(CC) -c -o $@ $< $(CFLAGS)
353
354 $(BINDIR)/%.a: $(SRCDIR)/%.a
355 cp $< $@
356 ranlib $@
357
358 $(CLIENTEXE): $(BINDIR) $(OBJS) $(LIBS)
359 $(LINKER) -o $(CLIENTEXE) $(OBJS) $(LDFLAGS) $(LIBS)
360
361 $(BINDIR) :
362 $(MAKE) bindir
363
364 bindir :
365 mkdir -p $(BINDIR)
366 mkdir -p $(BINDIR)/RSPiX/Src/BLUE/unix
367 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/Hot
368 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/Image
369 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/InputEvent
370 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/Mix
371 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/Sample
372 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/Snd
373 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/SndFx
374 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/Task
375 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/3D
376 mkdir -p $(BINDIR)/RSPiX/Src/GREEN/BLiT
377 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/GameLib
378 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/Attribute
379 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/GUI
380 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/Channel
381 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/color
382 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/DirtRect
383 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/File
384 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/QuickMath
385 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/IFF
386 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/ImageTools
387 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/Laymage
388 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/Meter
389 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/MsgBox
390 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/MTask
391 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/MultiGrid
392 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/Debug
393 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/RString
394 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/Parse
395 mkdir -p $(BINDIR)/RSPiX/Src/ORANGE/str
396 mkdir -p $(BINDIR)/RSPiX/Src/CYAN/Unix
397 mkdir -p $(BINDIR)/WishPiX/Menu
398 mkdir -p $(BINDIR)/WishPiX/Prefs
399 mkdir -p $(BINDIR)/WishPiX/ResourceManager
400 mkdir -p $(BINDIR)/WishPiX/Spry
401 mkdir -p $(BINDIR)/libs
402
403 $(EBINDIR)/%.o: $(SRCDIR)/%.c
404 $(CC) -c -g -o $@ $< $(CFLAGS)
405
406 saktool: $(EBINDIR) $(EOBJS) $(ELIBS)
407 $(LINKER) -o saktool $(EOBJS) $(ELDFLAGS) $(ELIBS)
408
409 picon:
410 $(eval CFLAGS += -fPIC -shared)
411
412 RSPiX_wrap.cxx: RSPiX.i
413 swig -c++ -python -IRSPiX/Src RSPiX.i
414 # Idk if there's a way to fix this "properly"
415 sed -i "s/ Node \\*/ RFList< RSprite \\* >::Pointer /g" RSPiX_wrap.cxx
416 sed -i "s/(Node \\*/(RFList< RSprite \\* >::Pointer/g" RSPiX_wrap.cxx
417
418 RSPiX_wrap.o: RSPiX.i RSPiX_wrap.cxx
419 $(CXX) -c RSPiX_wrap.cxx $(CFLAGS) $(shell python2-config --cflags)
420
421 _RSPiX.so: $(BINDIR) picon $(RSOBJS) RSPiX.i RSPiX_wrap.cxx RSPiX_wrap.o $(BINDIR)/WishPiX/Spry/spry.o $(BINDIR)/malphagen.o
422 $(CXX) RSPiX_wrap.o $(RSOBJS) $(BINDIR)/WishPiX/Spry/spry.o $(BINDIR)/malphagen.o -o _RSPiX.so $(LDFLAGS) $(LIBS) $(shell python2-config --libs) $(CFLAGS)
423
424 swig:
425 BINDIR=binpic $(MAKE) -e _RSPiX.so
426
427 $(EBINDIR) :
428 $(MAKE) ebindir
429
430 ebindir :
431 mkdir -p $(EBINDIR)
432
433 distclean: clean
434
435 clean:
436 rm -f $(CLEANUP)
437 rm -rf $(BINDIR)
438 #rm -f $(SRCDIR)/parser/y.tab.c
439 #rm -f $(SRCDIR)/parser/lex.yy.c
440 rm -rf $(EBINDIR)
441 rm -f saktool
442 rm -f RSPiX_wrap.c RSPiX_wrap.cxx RSPiX_wrap.o _RSPiX.so RSPiX.py
443
444 # end of Makefile ...