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