add -lpthread to all compiles
[divverent/netradiant.git] / Makefile
1 CFLAGS = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -g3 -fPIC
2 CXXFLAGS = $(CFLAGS) -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti
3 CPPFLAGS_COMMON = -DPOSIX -DXWINDOWS -D_DEBUG -D_LINUX
4 LDFLAGS_COMMON = 
5 #LDFLAGS_DLL = -fPIC -Wl,-fini,fini_stub -static-libgcc -ldl
6 LDFLAGS_DLL = -fPIC -ldl
7 LIBS_COMMON = -lpthread
8
9 EXE = x86
10 A = a
11 DLL = so
12 NETAPI = berkley
13
14 RADIANT_ABOUTMSG = Custom build
15
16 LDD ?= ldd
17 FIND ?= find
18 RANLIB ?= ranlib
19 AR ?= ar
20 MKDIR ?= mkdir -p
21 CP ?= cp
22 CP_R ?= $(CP) -r
23 RM_R ?= $(RM) -r
24
25 TEE_STDERR ?= | tee /dev/stderr
26
27 CPPFLAGS_GLIB = `pkg-config glib-2.0 --cflags`
28 LIBS_GLIB = `pkg-config glib-2.0 --libs-only-l --libs-only-L`
29
30 CPPFLAGS_XML = `xml2-config --cflags`
31 LIBS_XML = `xml2-config --libs`
32
33 CPPFLAGS_PNG = `libpng-config --cflags`
34 LIBS_PNG = `libpng-config --libs`
35
36 CPPFLAGS_GTK = `pkg-config gtk+-2.0 --cflags`
37 LIBS_GTK = `pkg-config gtk+-2.0 --libs-only-l --libs-only-L`
38
39 CPPFLAGS_GTKGLEXT = `pkg-config gtkglext-1.0 --cflags`
40 LIBS_GTKGLEXT = `pkg-config gtkglext-1.0 --libs-only-l --libs-only-L`
41
42 # from qe3.cpp: const char* const EXECUTABLE_TYPE = 
43 # from qe3.cpp: #if defined(__linux__) || defined (__FreeBSD__)
44 # from qe3.cpp: "x86"
45 # from qe3.cpp: #elif defined(__APPLE__)
46 # from qe3.cpp: "ppc"
47 # from qe3.cpp: #elif defined(WIN32)
48 # from qe3.cpp: "exe"
49 # from qe3.cpp: #else
50 # from qe3.cpp: #error "unknown platform"
51 # from qe3.cpp: #endif
52 # from qe3.cpp: ;
53
54
55 .PHONY: all
56 all: \
57         makeversion \
58         install/heretic2/h2data.$(EXE) \
59         install/modules/archivepak.$(DLL) \
60         install/modules/archivewad.$(DLL) \
61         install/modules/archivezip.$(DLL) \
62         install/modules/entity.$(DLL) \
63         install/modules/image.$(DLL) \
64         install/modules/imagehl.$(DLL) \
65         install/modules/imagepng.$(DLL) \
66         install/modules/imageq2.$(DLL) \
67         install/modules/mapq3.$(DLL) \
68         install/modules/mapxml.$(DLL) \
69         install/modules/md3model.$(DLL) \
70         install/modules/model.$(DLL) \
71         install/modules/shaders.$(DLL) \
72         install/modules/vfspk3.$(DLL) \
73         install/plugins/bobtoolz.$(DLL) \
74         install/plugins/brushexport.$(DLL) \
75         install/plugins/prtview.$(DLL) \
76         install/plugins/shaderplug.$(DLL) \
77         install/plugins/sunplug.$(DLL) \
78         install/plugins/ufoaiplug.$(DLL) \
79         install/q2map.$(EXE) \
80         install/q3data.$(EXE) \
81         install/q3map2.$(EXE) \
82         install/qdata3.$(EXE) \
83         install/radiant.$(EXE) \
84         install-data \
85
86 .PHONY: clean
87 clean:
88         $(RM_R) install/
89         $(FIND) . \( -name \*.o -o -name \*.d -o -name \*.$(DLL) -o -name \*.$(A) -o -name \*.$(EXE) \) -exec $(RM) {} \;
90
91 %.$(EXE):
92         dir=$@; $(MKDIR) $${dir%/*}
93         $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS_COMMON) $(LIBS)
94         [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ 2>&1 >/dev/null $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
95
96 %.$(A):
97         $(AR) rc $@ $^
98         $(RANLIB) $@
99
100 %.$(DLL):
101         dir=$@; $(MKDIR) $${dir%/*}
102         $(CXX) -shared -o $@ $^ $(LDFLAGS) $(LDFLAGS_DLL) $(LIBS)
103         [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ 2>&1 >/dev/null $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
104
105 %.o: %.cpp
106         $(CXX) -c -o $@ $< $(CXXFLAGS) $(CPPFLAGS_COMMON) $(CPPFLAGS)
107
108 %.o: %.c
109         $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS_COMMON) $(CPPFLAGS)
110
111 install/q3map2.$(EXE): LIBS := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG)
112 install/q3map2.$(EXE): CPPFLAGS := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) -Itools/quake3/common -Ilibs -Iinclude
113 install/q3map2.$(EXE): \
114         tools/quake3/common/cmdlib.o \
115         tools/quake3/common/imagelib.o \
116         tools/quake3/common/inout.o \
117         tools/quake3/common/md4.o \
118         tools/quake3/common/mutex.o \
119         tools/quake3/common/polylib.o \
120         tools/quake3/common/scriplib.o \
121         tools/quake3/common/threads.o \
122         tools/quake3/common/unzip.o \
123         tools/quake3/common/vfs.o \
124         tools/quake3/q3map2/brush.o \
125         tools/quake3/q3map2/brush_primit.o \
126         tools/quake3/q3map2/bspfile_abstract.o \
127         tools/quake3/q3map2/bspfile_ibsp.o \
128         tools/quake3/q3map2/bspfile_rbsp.o \
129         tools/quake3/q3map2/bsp.o \
130         tools/quake3/q3map2/convert_ase.o \
131         tools/quake3/q3map2/convert_map.o \
132         tools/quake3/q3map2/decals.o \
133         tools/quake3/q3map2/facebsp.o \
134         tools/quake3/q3map2/fog.o \
135         tools/quake3/q3map2/image.o \
136         tools/quake3/q3map2/leakfile.o \
137         tools/quake3/q3map2/light_bounce.o \
138         tools/quake3/q3map2/lightmaps_ydnar.o \
139         tools/quake3/q3map2/light.o \
140         tools/quake3/q3map2/light_trace.o \
141         tools/quake3/q3map2/light_ydnar.o \
142         tools/quake3/q3map2/main.o \
143         tools/quake3/q3map2/map.o \
144         tools/quake3/q3map2/mesh.o \
145         tools/quake3/q3map2/model.o \
146         tools/quake3/q3map2/patch.o \
147         tools/quake3/q3map2/path_init.o \
148         tools/quake3/q3map2/portals.o \
149         tools/quake3/q3map2/prtfile.o \
150         tools/quake3/q3map2/shaders.o \
151         tools/quake3/q3map2/surface_extra.o \
152         tools/quake3/q3map2/surface_foliage.o \
153         tools/quake3/q3map2/surface_fur.o \
154         tools/quake3/q3map2/surface_meta.o \
155         tools/quake3/q3map2/surface.o \
156         tools/quake3/q3map2/tjunction.o \
157         tools/quake3/q3map2/tree.o \
158         tools/quake3/q3map2/visflow.o \
159         tools/quake3/q3map2/vis.o \
160         tools/quake3/q3map2/writebsp.o \
161         libddslib.$(A) \
162         libjpeg6.$(A) \
163         libl_net.$(A) \
164         libmathlib.$(A) \
165         libpicomodel.$(A) \
166
167 libmathlib.$(A): CPPFLAGS := -Ilibs
168 libmathlib.$(A): \
169         libs/mathlib/bbox.o \
170         libs/mathlib/line.o \
171         libs/mathlib/m4x4.o \
172         libs/mathlib/mathlib.o \
173         libs/mathlib/ray.o \
174
175 libl_net.$(A): CPPFLAGS := -Ilibs
176 libl_net.$(A): \
177         libs/l_net/l_net.o \
178         libs/l_net/l_net_$(NETAPI).o \
179
180 libjpeg6.$(A): CPPFLAGS := -Ilibs/jpeg6 -Ilibs
181 libjpeg6.$(A): \
182         libs/jpeg6/jcomapi.o \
183         libs/jpeg6/jdapimin.o \
184         libs/jpeg6/jdapistd.o \
185         libs/jpeg6/jdatasrc.o \
186         libs/jpeg6/jdcoefct.o \
187         libs/jpeg6/jdcolor.o \
188         libs/jpeg6/jddctmgr.o \
189         libs/jpeg6/jdhuff.o \
190         libs/jpeg6/jdinput.o \
191         libs/jpeg6/jdmainct.o \
192         libs/jpeg6/jdmarker.o \
193         libs/jpeg6/jdmaster.o \
194         libs/jpeg6/jdpostct.o \
195         libs/jpeg6/jdsample.o \
196         libs/jpeg6/jdtrans.o \
197         libs/jpeg6/jerror.o \
198         libs/jpeg6/jfdctflt.o \
199         libs/jpeg6/jidctflt.o \
200         libs/jpeg6/jmemmgr.o \
201         libs/jpeg6/jmemnobs.o \
202         libs/jpeg6/jpgload.o \
203         libs/jpeg6/jutils.o \
204
205 libpicomodel.$(A): CPPFLAGS := -Ilibs
206 libpicomodel.$(A): \
207         libs/picomodel/lwo/clip.o \
208         libs/picomodel/lwo/envelope.o \
209         libs/picomodel/lwo/list.o \
210         libs/picomodel/lwo/lwio.o \
211         libs/picomodel/lwo/lwo2.o \
212         libs/picomodel/lwo/lwob.o \
213         libs/picomodel/lwo/pntspols.o \
214         libs/picomodel/lwo/surface.o \
215         libs/picomodel/lwo/vecmath.o \
216         libs/picomodel/lwo/vmap.o \
217         libs/picomodel/picointernal.o \
218         libs/picomodel/picomodel.o \
219         libs/picomodel/picomodules.o \
220         libs/picomodel/pm_3ds.o \
221         libs/picomodel/pm_ase.o \
222         libs/picomodel/pm_fm.o \
223         libs/picomodel/pm_lwo.o \
224         libs/picomodel/pm_md2.o \
225         libs/picomodel/pm_md3.o \
226         libs/picomodel/pm_mdc.o \
227         libs/picomodel/pm_ms3d.o \
228         libs/picomodel/pm_obj.o \
229         libs/picomodel/pm_terrain.o \
230
231 libddslib.$(A): CPPFLAGS := -Ilibs
232 libddslib.$(A): \
233         libs/ddslib/ddslib.o \
234
235 install/q3data.$(EXE): LIBS := $(LIBS_XML) $(LIBS_GLIB)
236 install/q3data.$(EXE): CPPFLAGS := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Itools/quake3/common -Ilibs -Iinclude
237 install/q3data.$(EXE): \
238         tools/quake3/common/aselib.o \
239         tools/quake3/common/bspfile.o \
240         tools/quake3/common/cmdlib.o \
241         tools/quake3/common/imagelib.o \
242         tools/quake3/common/inout.o \
243         tools/quake3/common/md4.o \
244         tools/quake3/common/scriplib.o \
245         tools/quake3/common/trilib.o \
246         tools/quake3/common/unzip.o \
247         tools/quake3/common/vfs.o \
248         tools/quake3/q3data/3dslib.o \
249         tools/quake3/q3data/compress.o \
250         tools/quake3/q3data/images.o \
251         tools/quake3/q3data/md3lib.o \
252         tools/quake3/q3data/models.o \
253         tools/quake3/q3data/p3dlib.o \
254         tools/quake3/q3data/polyset.o \
255         tools/quake3/q3data/q3data.o \
256         tools/quake3/q3data/stripper.o \
257         tools/quake3/q3data/video.o \
258         libl_net.$(A) \
259         libmathlib.$(A) \
260
261 install/radiant.$(EXE): LIBS := -ldl -lGL -static-libgcc $(LIBS_XML) $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_GTKGLEXT)
262 install/radiant.$(EXE): CPPFLAGS := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) -Ilibs -Iinclude
263 install/radiant.$(EXE): \
264         radiant/autosave.o \
265         radiant/brushmanip.o \
266         radiant/brushmodule.o \
267         radiant/brushnode.o \
268         radiant/brush.o \
269         radiant/brush_primit.o \
270         radiant/brushtokens.o \
271         radiant/brushxml.o \
272         radiant/build.o \
273         radiant/camwindow.o \
274         radiant/clippertool.o \
275         radiant/commands.o \
276         radiant/console.o \
277         radiant/csg.o \
278         radiant/dialog.o \
279         radiant/eclass_def.o \
280         radiant/eclass_doom3.o \
281         radiant/eclass_fgd.o \
282         radiant/eclass.o \
283         radiant/eclass_xml.o \
284         radiant/entityinspector.o \
285         radiant/entitylist.o \
286         radiant/entity.o \
287         radiant/environment.o \
288         radiant/error.o \
289         radiant/feedback.o \
290         radiant/filetypes.o \
291         radiant/filters.o \
292         radiant/findtexturedialog.o \
293         radiant/glwidget.o \
294         radiant/grid.o \
295         radiant/groupdialog.o \
296         radiant/gtkdlgs.o \
297         radiant/gtkmisc.o \
298         radiant/help.o \
299         radiant/image.o \
300         radiant/mainframe.o \
301         radiant/main.o \
302         radiant/map.o \
303         radiant/mru.o \
304         radiant/nullmodel.o \
305         radiant/parse.o \
306         radiant/patchdialog.o \
307         radiant/patchmanip.o \
308         radiant/patchmodule.o \
309         radiant/patch.o \
310         radiant/pluginapi.o \
311         radiant/pluginmanager.o \
312         radiant/pluginmenu.o \
313         radiant/plugin.o \
314         radiant/plugintoolbar.o \
315         radiant/points.o \
316         radiant/preferencedictionary.o \
317         radiant/preferences.o \
318         radiant/qe3.o \
319         radiant/qgl.o \
320         radiant/referencecache.o \
321         radiant/renderer.o \
322         radiant/renderstate.o \
323         radiant/scenegraph.o \
324         radiant/selection.o \
325         radiant/select.o \
326         radiant/server.o \
327         radiant/shaders.o \
328         radiant/sockets.o \
329         radiant/stacktrace.o \
330         radiant/surfacedialog.o \
331         radiant/texmanip.o \
332         radiant/textures.o \
333         radiant/texwindow.o \
334         radiant/timer.o \
335         radiant/treemodel.o \
336         radiant/undo.o \
337         radiant/url.o \
338         radiant/view.o \
339         radiant/watchbsp.o \
340         radiant/winding.o \
341         radiant/windowobservers.o \
342         radiant/xmlstuff.o \
343         radiant/xywindow.o \
344         libcmdlib.$(A) \
345         libgtkutil.$(A) \
346         libl_net.$(A) \
347         libmathlib.$(A) \
348         libprofile.$(A) \
349         libxmllib.$(A) \
350
351 libcmdlib.$(A): CPPFLAGS := -Ilibs
352 libcmdlib.$(A): \
353         libs/cmdlib/cmdlib.o \
354
355 libprofile.$(A): CPPFLAGS := -Ilibs -Iinclude
356 libprofile.$(A): \
357         libs/profile/file.o \
358         libs/profile/profile.o \
359
360 libgtkutil.$(A): CPPFLAGS := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) -Ilibs -Iinclude
361 libgtkutil.$(A): \
362         libs/gtkutil/accelerator.o \
363         libs/gtkutil/button.o \
364         libs/gtkutil/clipboard.o \
365         libs/gtkutil/closure.o \
366         libs/gtkutil/container.o \
367         libs/gtkutil/cursor.o \
368         libs/gtkutil/dialog.o \
369         libs/gtkutil/entry.o \
370         libs/gtkutil/filechooser.o \
371         libs/gtkutil/frame.o \
372         libs/gtkutil/glfont.o \
373         libs/gtkutil/glwidget.o \
374         libs/gtkutil/idledraw.o \
375         libs/gtkutil/image.o \
376         libs/gtkutil/menu.o \
377         libs/gtkutil/messagebox.o \
378         libs/gtkutil/nonmodal.o \
379         libs/gtkutil/paned.o \
380         libs/gtkutil/pointer.o \
381         libs/gtkutil/toolbar.o \
382         libs/gtkutil/widget.o \
383         libs/gtkutil/window.o \
384         libs/gtkutil/xorrectangle.o \
385
386 libxmllib.$(A): CPPFLAGS := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
387 libxmllib.$(A): \
388         libs/xml/ixml.o \
389         libs/xml/xmlelement.o \
390         libs/xml/xmlparser.o \
391         libs/xml/xmltextags.o \
392         libs/xml/xmlwriter.o \
393
394 install/modules/archivezip.$(DLL): LIBS := -lz
395 install/modules/archivezip.$(DLL): CPPFLAGS := -Ilibs -Iinclude
396 install/modules/archivezip.$(DLL): \
397         plugins/archivezip/archive.o \
398         plugins/archivezip/pkzip.o \
399         plugins/archivezip/plugin.o \
400         plugins/archivezip/zlibstream.o \
401
402 install/modules/archivewad.$(DLL): CPPFLAGS := -Ilibs -Iinclude
403 install/modules/archivewad.$(DLL): \
404         plugins/archivewad/archive.o \
405         plugins/archivewad/plugin.o \
406         plugins/archivewad/wad.o \
407
408 install/modules/archivepak.$(DLL): CPPFLAGS := -Ilibs -Iinclude
409 install/modules/archivepak.$(DLL): \
410         plugins/archivepak/archive.o \
411         plugins/archivepak/pak.o \
412         plugins/archivepak/plugin.o \
413
414 install/modules/entity.$(DLL): CPPFLAGS := -Ilibs -Iinclude
415 install/modules/entity.$(DLL): \
416         plugins/entity/angle.o \
417         plugins/entity/angles.o \
418         plugins/entity/colour.o \
419         plugins/entity/doom3group.o \
420         plugins/entity/eclassmodel.o \
421         plugins/entity/entity.o \
422         plugins/entity/filters.o \
423         plugins/entity/generic.o \
424         plugins/entity/group.o \
425         plugins/entity/light.o \
426         plugins/entity/miscmodel.o \
427         plugins/entity/model.o \
428         plugins/entity/modelskinkey.o \
429         plugins/entity/namedentity.o \
430         plugins/entity/origin.o \
431         plugins/entity/plugin.o \
432         plugins/entity/rotation.o \
433         plugins/entity/scale.o \
434         plugins/entity/skincache.o \
435         plugins/entity/targetable.o \
436
437 install/modules/image.$(DLL): CPPFLAGS := -Ilibs -Iinclude
438 install/modules/image.$(DLL): \
439         plugins/image/bmp.o \
440         plugins/image/dds.o \
441         plugins/image/image.o \
442         plugins/image/jpeg.o \
443         plugins/image/pcx.o \
444         plugins/image/tga.o \
445         libddslib.$(A) \
446         libjpeg6.$(A) \
447
448 install/modules/imageq2.$(DLL): CPPFLAGS := -Ilibs -Iinclude
449 install/modules/imageq2.$(DLL): \
450         plugins/imageq2/imageq2.o \
451         plugins/imageq2/wal32.o \
452         plugins/imageq2/wal.o \
453
454 install/modules/imagehl.$(DLL): CPPFLAGS := -Ilibs -Iinclude
455 install/modules/imagehl.$(DLL): \
456         plugins/imagehl/hlw.o \
457         plugins/imagehl/imagehl.o \
458         plugins/imagehl/mip.o \
459         plugins/imagehl/sprite.o \
460
461 install/modules/imagepng.$(DLL): LIBS := $(LIBS_PNG)
462 install/modules/imagepng.$(DLL): CPPFLAGS := $(CPPFLAGS_PNG) -Ilibs -Iinclude
463 install/modules/imagepng.$(DLL): \
464         plugins/imagepng/plugin.o \
465
466 install/modules/mapq3.$(DLL): CPPFLAGS := -Ilibs -Iinclude
467 install/modules/mapq3.$(DLL): \
468         plugins/mapq3/parse.o \
469         plugins/mapq3/plugin.o \
470         plugins/mapq3/write.o \
471
472 install/modules/mapxml.$(DLL): LIBS := $(LIBS_XML) $(LIBS_GLIB)
473 install/modules/mapxml.$(DLL): CPPFLAGS := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
474 install/modules/mapxml.$(DLL): \
475         plugins/mapxml/plugin.o \
476         plugins/mapxml/xmlparse.o \
477         plugins/mapxml/xmlwrite.o \
478
479 install/modules/md3model.$(DLL): CPPFLAGS := -Ilibs -Iinclude
480 install/modules/md3model.$(DLL): \
481         plugins/md3model/md2.o \
482         plugins/md3model/md3.o \
483         plugins/md3model/md5.o \
484         plugins/md3model/mdc.o \
485         plugins/md3model/mdlimage.o \
486         plugins/md3model/mdl.o \
487         plugins/md3model/plugin.o \
488
489 install/modules/model.$(DLL): CPPFLAGS := -Ilibs -Iinclude
490 install/modules/model.$(DLL): \
491         plugins/model/model.o \
492         plugins/model/plugin.o \
493         libpicomodel.$(A) \
494
495 install/modules/shaders.$(DLL): LIBS := $(LIBS_GLIB)
496 install/modules/shaders.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
497 install/modules/shaders.$(DLL): \
498         plugins/shaders/plugin.o \
499         plugins/shaders/shaders.o \
500
501 install/modules/vfspk3.$(DLL): LIBS := $(LIBS_GLIB)
502 install/modules/vfspk3.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
503 install/modules/vfspk3.$(DLL): \
504         plugins/vfspk3/archive.o \
505         plugins/vfspk3/vfs.o \
506         plugins/vfspk3/vfspk3.o \
507
508 install/plugins/bobtoolz.$(DLL): LIBS := $(LIBS_GLIB) $(LIBS_GTK)
509 install/plugins/bobtoolz.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
510 install/plugins/bobtoolz.$(DLL): \
511         contrib/bobtoolz/bobToolz-GTK.o \
512         contrib/bobtoolz/bsploader.o \
513         contrib/bobtoolz/cportals.o \
514         contrib/bobtoolz/DBobView.o \
515         contrib/bobtoolz/DBrush.o \
516         contrib/bobtoolz/DEntity.o \
517         contrib/bobtoolz/DEPair.o \
518         contrib/bobtoolz/dialogs/dialogs-gtk.o \
519         contrib/bobtoolz/DMap.o \
520         contrib/bobtoolz/DPatch.o \
521         contrib/bobtoolz/DPlane.o \
522         contrib/bobtoolz/DPoint.o \
523         contrib/bobtoolz/DShape.o \
524         contrib/bobtoolz/DTrainDrawer.o \
525         contrib/bobtoolz/DTreePlanter.o \
526         contrib/bobtoolz/DVisDrawer.o \
527         contrib/bobtoolz/DWinding.o \
528         contrib/bobtoolz/funchandlers-GTK.o \
529         contrib/bobtoolz/lists.o \
530         contrib/bobtoolz/misc.o \
531         contrib/bobtoolz/ScriptParser.o \
532         contrib/bobtoolz/shapes.o \
533         contrib/bobtoolz/visfind.o \
534         libcmdlib.$(A) \
535         libmathlib.$(A) \
536         libprofile.$(A) \
537
538 install/plugins/brushexport.$(DLL): LIBS := $(LIBS_GLIB) $(LIBS_GTK)
539 install/plugins/brushexport.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
540 install/plugins/brushexport.$(DLL): \
541         contrib/brushexport/callbacks.o \
542         contrib/brushexport/export.o \
543         contrib/brushexport/interface.o \
544         contrib/brushexport/plugin.o \
545         contrib/brushexport/support.o \
546
547 install/plugins/prtview.$(DLL): LIBS := $(LIBS_GLIB) $(LIBS_GTK)
548 install/plugins/prtview.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
549 install/plugins/prtview.$(DLL): \
550         contrib/prtview/AboutDialog.o \
551         contrib/prtview/ConfigDialog.o \
552         contrib/prtview/LoadPortalFileDialog.o \
553         contrib/prtview/portals.o \
554         contrib/prtview/prtview.o \
555         libprofile.$(A) \
556
557 install/plugins/shaderplug.$(DLL): LIBS := $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_XML)
558 install/plugins/shaderplug.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_XML) -Ilibs -Iinclude
559 install/plugins/shaderplug.$(DLL): \
560         contrib/shaderplug/shaderplug.o \
561         libxmllib.$(A) \
562
563 install/plugins/sunplug.$(DLL): LIBS := $(LIBS_GLIB) $(LIBS_GTK)
564 install/plugins/sunplug.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
565 install/plugins/sunplug.$(DLL): \
566         contrib/sunplug/sunplug.o \
567
568 install/qdata3.$(EXE): LIBS := $(LIBS_XML)
569 install/qdata3.$(EXE): CPPFLAGS := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
570 install/qdata3.$(EXE): \
571         tools/quake2/common/bspfile.o \
572         tools/quake2/common/cmdlib.o \
573         tools/quake2/common/inout.o \
574         tools/quake2/common/l3dslib.o \
575         tools/quake2/common/lbmlib.o \
576         tools/quake2/common/mathlib.o \
577         tools/quake2/common/md4.o \
578         tools/quake2/common/path_init.o \
579         tools/quake2/common/polylib.o \
580         tools/quake2/common/scriplib.o \
581         tools/quake2/common/threads.o \
582         tools/quake2/common/trilib.o \
583         tools/quake2/qdata/images.o \
584         tools/quake2/qdata/models.o \
585         tools/quake2/qdata/qdata.o \
586         tools/quake2/qdata/sprites.o \
587         tools/quake2/qdata/tables.o \
588         tools/quake2/qdata/video.o \
589         libl_net.$(A) \
590
591 install/q2map.$(EXE): LIBS := $(LIBS_XML)
592 install/q2map.$(EXE): CPPFLAGS := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
593 install/q2map.$(EXE): \
594         tools/quake2/common/bspfile.o \
595         tools/quake2/common/cmdlib.o \
596         tools/quake2/common/inout.o \
597         tools/quake2/common/l3dslib.o \
598         tools/quake2/common/lbmlib.o \
599         tools/quake2/common/mathlib.o \
600         tools/quake2/common/md4.o \
601         tools/quake2/common/path_init.o \
602         tools/quake2/common/polylib.o \
603         tools/quake2/common/scriplib.o \
604         tools/quake2/common/threads.o \
605         tools/quake2/common/trilib.o \
606         tools/quake2/q2map/brushbsp.o \
607         tools/quake2/q2map/csg.o \
608         tools/quake2/q2map/faces.o \
609         tools/quake2/q2map/flow.o \
610         tools/quake2/q2map/glfile.o \
611         tools/quake2/q2map/leakfile.o \
612         tools/quake2/q2map/lightmap.o \
613         tools/quake2/q2map/main.o \
614         tools/quake2/q2map/map.o \
615         tools/quake2/q2map/nodraw.o \
616         tools/quake2/q2map/patches.o \
617         tools/quake2/q2map/portals.o \
618         tools/quake2/q2map/prtfile.o \
619         tools/quake2/q2map/qbsp.o \
620         tools/quake2/q2map/qrad.o \
621         tools/quake2/q2map/qvis.o \
622         tools/quake2/q2map/textures.o \
623         tools/quake2/q2map/trace.o \
624         tools/quake2/q2map/tree.o \
625         tools/quake2/q2map/writebsp.o \
626         libl_net.$(A) \
627
628 install/plugins/ufoaiplug.$(DLL): LIBS := $(LIBS_GLIB) $(LIBS_GTK)
629 install/plugins/ufoaiplug.$(DLL): CPPFLAGS := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
630 install/plugins/ufoaiplug.$(DLL): \
631         contrib/ufoaiplug/ufoai_filters.o \
632         contrib/ufoaiplug/ufoai_gtk.o \
633         contrib/ufoaiplug/ufoai_level.o \
634         contrib/ufoaiplug/ufoai.o \
635
636 install/heretic2/h2data.$(EXE): LIBS := $(LIBS_XML)
637 install/heretic2/h2data.$(EXE): CPPFLAGS := $(CPPFLAGS_XML) -Itools/quake2/qdata_heretic2/common -Itools/quake2/qdata_heretic2/qcommon -Itools/quake2/qdata_heretic2 -Itools/quake2/common -Ilibs -Iinclude
638 install/heretic2/h2data.$(EXE): \
639         tools/quake2/qdata_heretic2/common/bspfile.o \
640         tools/quake2/qdata_heretic2/common/cmdlib.o \
641         tools/quake2/qdata_heretic2/common/inout.o \
642         tools/quake2/qdata_heretic2/common/l3dslib.o \
643         tools/quake2/qdata_heretic2/common/lbmlib.o \
644         tools/quake2/qdata_heretic2/common/mathlib.o \
645         tools/quake2/qdata_heretic2/common/md4.o \
646         tools/quake2/qdata_heretic2/common/path_init.o \
647         tools/quake2/qdata_heretic2/common/qfiles.o \
648         tools/quake2/qdata_heretic2/common/scriplib.o \
649         tools/quake2/qdata_heretic2/common/threads.o \
650         tools/quake2/qdata_heretic2/common/token.o \
651         tools/quake2/qdata_heretic2/common/trilib.o \
652         tools/quake2/qdata_heretic2/qcommon/reference.o \
653         tools/quake2/qdata_heretic2/qcommon/resourcemanager.o \
654         tools/quake2/qdata_heretic2/qcommon/skeletons.o \
655         tools/quake2/qdata_heretic2/animcomp.o \
656         tools/quake2/qdata_heretic2/book.o \
657         tools/quake2/qdata_heretic2/fmodels.o \
658         tools/quake2/qdata_heretic2/images.o \
659         tools/quake2/qdata_heretic2/jointed.o \
660         tools/quake2/qdata_heretic2/models.o \
661         tools/quake2/qdata_heretic2/pics.o \
662         tools/quake2/qdata_heretic2/qdata.o \
663         tools/quake2/qdata_heretic2/qd_skeletons.o \
664         tools/quake2/qdata_heretic2/sprites.o \
665         tools/quake2/qdata_heretic2/svdcmp.o \
666         tools/quake2/qdata_heretic2/tables.o \
667         tools/quake2/qdata_heretic2/tmix.o \
668         tools/quake2/qdata_heretic2/video.o \
669         libl_net.$(A) \
670
671 .PHONY: makeversion
672 makeversion:
673         set -ex; \
674         ver=`cat include/version.default`; \
675         major=`echo $$ver | cut -d . -f 2`; \
676         minor=`echo $$ver | cut -d . -f 3 | cut -d - -f 1`; \
677         echo "// generated header, see Makefile" > include/version.h; \
678         echo "#define RADIANT_VERSION \"$$ver\"" >> include/version.h; \
679         echo "#define RADIANT_MAJOR_VERSION \"$$major\"" >> include/version.h; \
680         echo "#define RADIANT_MINOR_VERSION \"$$minor\"" >> include/version.h; \
681         echo "$$major" > include/RADIANT_MAJOR; \
682         echo "$$minor" > include/RADIANT_MINOR; \
683         echo "$$ver" > include/version; \
684         echo "// generated header, see Makefile" > include/aboutmsg.h; \
685         echo "#define RADIANT_ABOUTMSG \"$(RADIANT_ABOUTMSG)\"" >> include/aboutmsg.h; \
686
687 .PHONY: install-data
688 install-data:
689         $(MKDIR) install/games
690         set -ex; \
691         for GAME in games/*; do \
692                 for GAMEFILE in $$GAME/games/*.game; do \
693                         $(CP) "$$GAMEFILE" install/games/; \
694                 done; \
695                 for GAMEDIR in $$GAME/*.game; do \
696                         $(CP_R) "$$GAMEDIR" install/; \
697                 done; \
698         done
699         $(CP) include/RADIANT_MAJOR install/
700         $(CP) include/RADIANT_MINOR install/
701         $(CP_R) setup/data/tools/* install/
702         $(FIND) install/ -name .svn -exec $(RM_R) {} \; -prune; \
703
704 -include $(shell `find . -name \*.d`)