-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile.old
404 lines (339 loc) · 8.63 KB
/
makefile.old
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
macosx := false
use_devil := false
use_fmod := false
ifeq ($(strip $(shell uname -s)),Darwin)
macosx := true
endif
#OPT += -O0
OPT += -O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno
#OPT += -Os -fno-strict-aliasing
BINDIR := bin
RUNDIR := .
SRCDIR := Source
SDLDIR := Dependencies/SDL12
LIBPNGDIR := Dependencies/libpng
JPEGLIBDIR := Dependencies/libjpeg
ZLIBDIR := Dependencies/zlib
OPENALDIR := Dependencies/OpenAL
GLUDIR := Dependencies/GLU
LIBOGGDIR := Dependencies/libogg
LIBVORBISDIR := Dependencies/libvorbis
ifeq ($(strip $(macosx)),true)
CXX := g++-4.0
CC := gcc-4.0
LD := g++-4.0
ifeq ($(strip $(use_devil)),true)
$(error DEVIL isn't supported in the Mac OS X builds right now.)
endif
ifeq ($(strip $(use_fmod)),true)
$(error FMOD isn't supported in the Mac OS X builds right now.)
endif
ifeq ($(strip $(XCODE_DIR)),)
XCODE_DIR := /Developer
endif
ifeq ($(strip $(macosx_arch)),)
macosx_arch := $(shell uname -m)
endif
ifeq ($(strip $(macosx_arch)),ppc)
macosx_arch_okay := true
macosx_version_min := 10.4
macosx_version_min_required := 1040
macosx_sdk_dir := MacOSX10.4u.sdk
macosx_gcc_dir := powerpc-apple-darwin10/4.0.1
macosx_gcc_libdir := $(macosx_gcc_dir)
macosx_cxx_dir := powerpc-apple-darwin8
endif
ifeq ($(strip $(macosx_arch)),i386)
macosx_arch_okay := true
macosx_version_min := 10.4
macosx_version_min_required := 1040
macosx_sdk_dir := MacOSX10.4u.sdk
macosx_gcc_dir := i686-apple-darwin10/4.0.1
macosx_gcc_libdir := $(macosx_gcc_dir)
macosx_cxx_dir := i686-apple-darwin8
endif
ifeq ($(strip $(macosx_arch)),x86_64)
macosx_arch_okay := true
macosx_version_min := 10.6
macosx_version_min_required := 1060
macosx_sdk_dir := MacOSX10.6.sdk
macosx_gcc_dir := i686-apple-darwin10/4.0.1
macosx_gcc_libdir := $(macosx_gcc_dir)/x86_64
macosx_cxx_dir := x86_64-apple-darwin8
endif
ifneq ($(strip $(macosx_arch_okay)),true)
$(error Unknown Mac OS X architecture. Please update the makefile.)
endif
EXEEXT := $(macosx_arch)
CFLAGS += -arch $(macosx_arch)
CFLAGS += -mmacosx-version-min=$(macosx_version_min)
CFLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=$(macosx_version_min_required)
CFLAGS += -nostdinc
CFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks
CFLAGS += -I$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_dir)/include
CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include
CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0
CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)
CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/$(macosx_cxx_dir)/bits
CFLAGS += -isystem $(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/include/c++/4.0.0/backward
CFLAGS += -mdynamic-no-pic
LDFLAGS += -arch $(macosx_arch)
LDFLAGS += -mmacosx-version-min=$(macosx_version_min)
LDFLAGS += -F$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/System/Library/Frameworks
LDFLAGS += -L$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)/usr/lib/gcc/$(macosx_gcc_libdir)
LDFLAGS += -Wl,-syslibroot,$(XCODE_DIR)/SDKs/$(macosx_sdk_dir)
LDFLAGS += -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework Carbon -framework OpenAL
LDFLAGS += ./Dependencies/SDL12/lib/macosx/libSDL-1.2.0.dylib ./Dependencies/SDL12/lib/macosx/libSDLmain-osx.a
INCLUDES += -IDependencies/OpenAL/include/AL
INCLUDES += -IDependencies/SDL12/include
else
CXX := g++
CC := gcc
LD := g++
CFLAGS += -DPLATFORM_LINUX=1
LDFLAGS += `pkg-config --libs sdl`
INCLUDES += `pkg-config --cflags sdl`
# Don't use bundled headers
SDLDIR := /dummy
ifeq ($(strip $(use_devil)),true)
LDFLAGS += ./libIL.so.1 ./libILU.so.1 ./libILUT.so.1
endif
ifeq ($(strip $(use_fmod)),true)
POSTLDFLAGS += -lpthread ./libfmod-linux-x86.a
else
LDFLAGS += `pkg-config --libs openal`
INCLUDES += `pkg-config --cflags openal`
# Don't use bundled headers
OPENALDIR := /dummy
endif
endif
DEFINES += \
-DPLATFORM_UNIX=1 \
-DUSE_SDL=1 \
-DTRUE=1 \
-DFALSE=0 \
-Dstricmp=strcasecmp \
-DBinIO_STDINT_HEADER="<stdint.h>" \
INCLUDES += \
-I$(SRCDIR) \
-I$(SDLDIR)/include \
-I./Dependencies/OpenGL/ \
-I./Dependencies/OpenGL/GL \
ifeq ($(strip $(use_devil)),true)
DEFINES += -DUSE_DEVIL=1
INCLUDES += -I$(SRCDIR)/devil/include
else
DEFINES += -DZ_PREFIX=1
INCLUDES += -I$(ZLIBDIR) -I$(LIBPNGDIR) -I$(JPEGLIBDIR)
endif
ifeq ($(strip $(use_fmod)),false)
DEFINES += -DUSE_OPENAL=1
INCLUDES += -I$(OPENALDIR)/include -I$(LIBOGGDIR)/include -I$(LIBVORBISDIR)/include
endif
CFLAGS += -g -c $(OPT) $(INCLUDES) $(DEFINES) -fsigned-char -pipe -w
ifeq ($(strip $(EXEEXT)),)
EXEEXT := bin
endif
EXE := $(RUNDIR)/lugaru-$(EXEEXT)
CXXFLAGS := $(CFLAGS)
SRCS := \
Frustum.cpp \
GameDraw.cpp \
GameInitDispose.cpp \
GameTick.cpp \
Globals.cpp \
Lights.cpp \
Models.cpp \
Objects.cpp \
pack.c \
pack_private.c \
Person.cpp \
private.c \
Quaternions.cpp \
Random.c \
Skeleton.cpp \
Skybox.cpp \
Sprites.cpp \
Terrain.cpp \
Text.cpp \
TGALoader.cpp \
unpack.c \
unpack_private.c \
Weapons.cpp \
MacCompatibility.cpp \
WinInput.cpp \
OpenGL_Windows.cpp \
openal_wrapper.cpp \
SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f))
UNUSED_SRCS := \
DRIVER.CC \
MD5.CC \
# pnggccrd.c \
# pngvcrd.c \
PNGSRCS := \
png.c \
pngerror.c \
pngget.c \
pngmem.c \
pngpread.c \
pngread.c \
pngrio.c \
pngrtran.c \
pngrutil.c \
pngset.c \
pngtrans.c \
pngwio.c \
pngwrite.c \
pngwtran.c \
pngwutil.c \
PNGSRCS := $(foreach f,$(PNGSRCS),$(LIBPNGDIR)/$(f))
# jdphuff.c \
# jidctred.c \
# jcphuff.c \
JPEGSRCS := \
jdapistd.c \
jdmaster.c \
jdapimin.c \
jcapimin.c \
jdmerge.c \
jdatasrc.c \
jdatadst.c \
jdcoefct.c \
jdcolor.c \
jddctmgr.c \
jdhuff.c \
jdinput.c \
jdmainct.c \
jdmarker.c \
jdpostct.c \
jdsample.c \
jdtrans.c \
jerror.c \
jidctflt.c \
jidctfst.c \
jidctint.c \
jmemmgr.c \
jutils.c \
jmemnobs.c \
jquant1.c \
jquant2.c \
jcomapi.c \
jcmarker.c \
jcapistd.c \
jcparam.c \
jcinit.c \
jcdctmgr.c \
jccoefct.c \
jcmainct.c \
jfdctflt.c \
jfdctint.c \
jfdctfst.c \
jchuff.c \
jcsample.c \
jcmaster.c \
jccolor.c \
jcprepct.c \
jcarith.c \
jdarith.c \
jaricom.c \
JPEGSRCS := $(foreach f,$(JPEGSRCS),$(JPEGLIBDIR)/$(f))
# gzio.c \
ZLIBSRCS = \
adler32.c \
compress.c \
crc32.c \
deflate.c \
infback.c \
inffast.c \
inflate.c \
inftrees.c \
trees.c \
uncompr.c \
zutil.c \
ZLIBSRCS := $(foreach f,$(ZLIBSRCS),$(ZLIBDIR)/$(f))
GLUSRCS := \
dict.c \
geom.c \
memalloc.c \
mesh.c \
mipmap.c \
normal.c \
priorityq.c \
render.c \
sweep.c \
tess.c \
tessmono.c \
util.c \
GLUSRCS := $(foreach f,$(GLUSRCS),$(GLUDIR)/$(f))
OGGSRCS := \
bitwise.o \
framing.o
OGGSRCS := $(foreach f,$(OGGSRCS),$(LIBOGGDIR)/src/$(f))
VORBISSRCS := \
analysis.o \
bitrate.o \
block.o \
codebook.o \
envelope.o \
floor0.o \
floor1.o \
info.o \
lpc.o \
lsp.o \
mapping0.o \
mdct.o \
psy.o \
registry.o \
res0.o \
sharedbook.o \
smallft.o \
synthesis.o \
vorbisfile.o \
window.o
VORBISSRCS := $(foreach f,$(VORBISSRCS),$(LIBVORBISDIR)/lib/$(f))
ifeq ($(strip $(macosx)),false)
SRCS += $(GLUSRCS)
endif
ifeq ($(strip $(use_devil)),false)
SRCS += $(PNGSRCS) $(JPEGSRCS) $(ZLIBSRCS)
endif
ifeq ($(strip $(use_fmod)),false)
SRCS += $(OGGSRCS) $(VORBISSRCS)
endif
OBJS := $(SRCS:.CC=.o)
OBJS := $(OBJS:.cc=.o)
OBJS := $(OBJS:.cpp=.o)
OBJS := $(OBJS:.c=.o)
OBJS := $(OBJS:.m=.o)
OBJS := $(foreach f,$(OBJS),$(BINDIR)/$(f))
.PHONY: clean all
all : $(EXE)
$(BINDIR)/%.o : %.cpp
@mkdir -p $(dir $@)
$(CXX) -o $@ $(CXXFLAGS) $<
$(BINDIR)/%.o : %.CC
@mkdir -p $(dir $@)
$(CXX) -x c++ -o $@ $(CXXFLAGS) $<
$(BINDIR)/%.o : %.cc
@mkdir -p $(dir $@)
$(CXX) -o $@ $(CXXFLAGS) $<
$(BINDIR)/%.o : %.m
@mkdir -p $(dir $@)
$(CC) -o $@ $(CFLAGS) $<
$(BINDIR)/%.o : %.c
@mkdir -p $(dir $@)
$(CC) -o $@ $(CFLAGS) $<
$(EXE) : $(OBJS) $(APPOBJS)
@mkdir -p $(dir $@)
$(LD) -o $@ $(LDFLAGS) $(OBJS) $(APPOBJS) $(POSTLDFLAGS)
clean:
rm -f $(BINDIR)/*.o
rm -f $(BINDIR)/$(SRCDIR)/*.o
rm -f $(BINDIR)/$(GLUDIR)/*.o
rm -f $(BINDIR)/$(LIBPNGDIR)/*.o
rm -f $(BINDIR)/$(JPEGLIBDIR)/*.o
rm -f $(BINDIR)/$(ZLIBDIR)/*.o
rm -f $(BINDIR)/$(LIBOGGDIR)/src/*.o
rm -f $(BINDIR)/$(LIBVORBISDIR)/lib/*.o
rm -f $(EXE)
# end of makefile ...