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