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