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