initial OS X app building stuff. May be broken.
[xonotic/netradiant.git] / Makefile
1 MAKEFILE_CONF      ?= Makefile.conf
2 -include $(MAKEFILE_CONF)
3
4 ## CONFIGURATION SETTINGS
5 # user customizable stuf
6 # you may override this in Makefile.conf or the environment
7 BUILD              ?= debug
8 # or: release, or: extradebug, or: profile
9 OS                 ?= $(shell uname)
10 # or: Linux, Win32, Darwin
11 LDFLAGS            ?=
12 CFLAGS             ?=
13 CXXFLAGS           ?=
14 CPPFLAGS           ?=
15 LIBS               ?=
16 RADIANT_ABOUTMSG   ?= Custom build
17
18 # warning: this directory may NOT contain any files other than the ones written by this Makefile!
19 # NEVER SET THIS TO A SYSTEM WIDE "bin" DIRECTORY!
20 INSTALLDIR         ?= install
21
22 CC                 ?= gcc
23 CXX                ?= g++
24 RANLIB             ?= ranlib
25 AR                 ?= ar
26 LDD                ?= ldd # nothing on Win32
27 WINDRES            ?= # only used on Win32
28
29 PKGCONFIG          ?= pkg-config
30 PKG_CONFIG_PATH    ?=
31
32 SH                 ?= $(SHELL)
33 ECHO               ?= echo
34 ECHO_NOLF          ?= echo -n
35 CAT                ?= cat
36 MKDIR              ?= mkdir -p
37 CP                 ?= cp
38 CP_R               ?= $(CP) -r
39 RM                 ?= rm
40 RM_R               ?= $(RM) -r
41 TEE_STDERR         ?= | tee /dev/stderr
42 TR                 ?= tr
43 FIND               ?= find
44 DIFF               ?= diff
45 SED                ?= sed
46
47 # optional:
48 SVNVERSION         ?= svnversion
49
50 STDOUT_TO_DEVNULL  ?= >/dev/null
51 STDERR_TO_DEVNULL  ?= 2>/dev/null
52 STDERR_TO_STDOUT   ?= 2>&1
53 TO_DEVNULL         ?= $(STDOUT_TO_DEVNULL) $(STDERR_TO_STDOUT)
54
55 CPPFLAGS_GLIB      ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --cflags $(STDERR_TO_DEVNULL))
56 LIBS_GLIB          ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
57                       $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
58 CPPFLAGS_XML       ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --cflags $(STDERR_TO_DEVNULL))
59 LIBS_XML           ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
60                       $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
61 CPPFLAGS_PNG       ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --cflags $(STDERR_TO_DEVNULL))
62 LIBS_PNG           ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-L $(STDERR_TO_DEVNULL)) \
63                       $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-l $(STDERR_TO_DEVNULL))
64 CPPFLAGS_GTK       ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --cflags $(STDERR_TO_DEVNULL))
65 LIBS_GTK           ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
66                       $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
67 CPPFLAGS_GTKGLEXT  ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --cflags $(STDERR_TO_DEVNULL))
68 LIBS_GTKGLEXT      ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
69                       $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-l $(STDERR_TO_DEVNULL))
70 CPPFLAGS_GL        ?=
71 LIBS_GL            ?= -lGL # -lopengl32 on Win32
72 CPPFLAGS_DL        ?=
73 LIBS_DL            ?= -ldl # nothing on Win32
74 CPPFLAGS_ZLIB      ?=
75 LIBS_ZLIB          ?= -lz
76 DEPEND_ON_MAKEFILE ?= yes
77 DEPENDENCIES_CHECK ?= quiet
78 # or: off, verbose
79
80 # these are used on Win32 only
81 GTKDIR             ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --variable=prefix $(STDERR_TO_DEVNULL))
82 WHICHDLL           ?= which
83
84 # alias mingw32 OSes
85 ifeq ($(OS),MINGW32_NT-6.0)
86         OS = Win32
87 endif
88
89 CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter
90 CPPFLAGS_COMMON =
91 LDFLAGS_COMMON =
92 LIBS_COMMON =
93 CXXFLAGS_COMMON = -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti
94
95 ifeq ($(BUILD),debug)
96 ifeq ($(findstring $(CFLAGS),-g),)
97         CFLAGS_COMMON += -g
98         # only add -g if no -g flag is in $(CFLAGS)
99 endif
100 ifeq ($(findstring $(CFLAGS),-O),)
101         CFLAGS_COMMON += -O
102         # only add -O if no -O flag is in $(CFLAGS)
103 endif
104         CPPFLAGS_COMMON +=
105         LDFLAGS_COMMON +=
106 else
107
108 ifeq ($(BUILD),extradebug)
109 ifeq ($(findstring $(CFLAGS),-g),)
110         CFLAGS_COMMON += -g3
111         # only add -g3 if no -g flag is in $(CFLAGS)
112 endif
113         CPPFLAGS_COMMON += -D_DEBUG
114         LDFLAGS_COMMON +=
115 else
116
117 ifeq ($(BUILD),profile)
118 ifeq ($(findstring $(CFLAGS),-g),)
119         CFLAGS_COMMON += -g
120         # only add -g if no -g flag is in $(CFLAGS)
121 endif
122 ifeq ($(findstring $(CFLAGS),-O),)
123         CFLAGS_COMMON += -O
124         # only add -O if no -O flag is in $(CFLAGS)
125 endif
126         CFLAGS_COMMON += -pg
127         CPPFLAGS_COMMON +=
128         LDFLAGS_COMMON += -pg
129 else
130
131 ifeq ($(BUILD),release)
132 ifeq ($(findstring $(CFLAGS),-O),)
133         CFLAGS_COMMON += -O3
134         # only add -O3 if no -O flag is in $(CFLAGS)
135         # to allow overriding the optimizations
136 endif
137         CPPFLAGS_COMMON +=
138         LDFLAGS_COMMON += -s
139 else
140
141 $(error Unsupported build type: $(BUILD))
142 endif
143 endif
144 endif
145 endif
146
147 ifeq ($(OS),Linux)
148         CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
149         CFLAGS_COMMON += -fPIC
150         LDFLAGS_DLL = -fPIC -ldl
151         LIBS_COMMON = -lpthread
152         EXE = x86
153         A = a
154         DLL = so
155         MWINDOWS =
156 else
157
158 ifeq ($(OS),Win32)
159         CPPFLAGS_COMMON += -DWIN32 -D_WIN32 -D_inline=inline
160         CFLAGS_COMMON += -mms-bitfields
161         LDFLAGS_DLL = --dll -Wl,--add-stdcall-alias
162         LIBS_COMMON = -lws2_32 -luser32 -lgdi32
163         EXE = exe
164         A = a
165         DLL = dll
166         MWINDOWS = -mwindows
167
168         # workaround: we have no "ldd" for Win32, so...
169         LDD =
170         # workaround: OpenGL library for Win32 is called opengl32.dll
171         LIBS_GL = -lopengl32
172         # workaround: no -ldl on Win32
173         LIBS_DL = 
174 else
175
176 ifeq ($(OS),Darwin)
177         CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
178         CFLAGS_COMMON += -fPIC
179         CXXFLAGS_COMMON += -fno-exceptions -fno-rtti
180         CPPFLAGS_COMMON += -I/sw/include -I/usr/X11R6/include
181         LDFLAGS_COMMON += -L/sw/lib -L/usr/lib -L/usr/X11R6/lib
182         LDFLAGS_DLL += -dynamiclib -ldl
183         EXE = ppc
184         A = a
185         DLL = dylib
186         MWINDOWS =
187
188         # workaround: http://developer.apple.com/qa/qa2007/qa1567.html
189         LIBS_GL += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
190         LIBS_GTKGLEXT += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
191         # workaround: we have no "ldd" for OS X, so...
192         LDD =
193
194         INSTALLDIR_BASE := $(INSTALLDIR)
195         INSTALLDIR := $(INSTALLDIR_BASE)/NetRadiant.app/Contents/MacOS/install
196 endif
197
198 else
199
200 $(error Unsupported build OS: $(OS))
201 endif
202 endif
203 endif
204
205 # VERSION!
206 RADIANT_VERSION = 1.5.0
207 RADIANT_MAJOR_VERSION = 5
208 RADIANT_MINOR_VERSION = 0
209
210 SVN_VERSION := $(shell $(SVNVERSION) -n $(STDERR_TO_DEVNULL) | $(SED) 's/M$$//g; s/.*://g;')
211 ifneq ($(SVN_VERSION),)
212         RADIANT_VERSION := $(RADIANT_VERSION)-svn$(SVN_VERSION)
213 endif
214
215 CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\""
216
217 .PHONY: all
218 all: \
219         dependencies-check \
220         binaries \
221         install-data \
222         install-dll \
223
224 .PHONY: dependencies-check
225 ifeq ($(findstring $(DEPENDENCIES_CHECK),off),off)
226 dependencies-check:
227         @$(ECHO) dependencies checking disabled, good luck...
228 else
229 dependencies-check:
230         @$(ECHO)
231         @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; fi; \
232         checkbinary() \
233         { \
234                 $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
235                 $$2 --help $(TO_DEVNULL); \
236                 if [ $$? != 127 ]; then \
237                         $(ECHO) "found."; \
238                 else \
239                         $(ECHO) "not found, please install it or set PATH right!"; \
240                         $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
241                         $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
242                         exit 1; \
243                 fi; \
244         }; \
245         $(ECHO) checking that the build tools exist; \
246         checkbinary "bash (or another shell)" "$(SH)"; \
247         checkbinary coreutils "$(ECHO)"; \
248         checkbinary coreutils "$(ECHO_NOLF)"; \
249         checkbinary coreutils "$(CAT)"; \
250         checkbinary coreutils "$(MKDIR)"; \
251         checkbinary coreutils "$(CP)"; \
252         checkbinary coreutils "$(CP_R)"; \
253         checkbinary coreutils "$(RM)"; \
254         checkbinary coreutils "$(RM_R)"; \
255         checkbinary coreutils "$(ECHO) test $(TEE_STDERR)"; \
256         checkbinary sed "$(SED)"; \
257         checkbinary findutils "$(FIND)"; \
258         checkbinary diff "$(DIFF)"; \
259         checkbinary gcc "$(CC)"; \
260         checkbinary g++ "$(CXX)"; \
261         checkbinary binutils "$(RANLIB)"; \
262         checkbinary binutils "$(AR)"; \
263         checkbinary pkg-config "$(PKGCONFIG)"; \
264         [ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \
265         [ -n "$(lDD)" ] && checkbinary libc6 "$(LDD)"; \
266         $(ECHO) All required tools have been found!
267         @$(ECHO)
268         @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; fi; \
269         checkheader() \
270         { \
271                 $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
272                 if \
273                         $(CXX) conftest.cpp $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS) $(CPPFLAGS_COMMON) $$4 -DCONFTEST_HEADER="<$$2>" -DCONFTEST_SYMBOL="$$3" $(TARGET_ARCH) $(LDFLAGS) -c -o conftest.o $(TO_DEVNULL) && \
274                         $(CXX) conftest.o $(LDFLAGS) $(LDFLAGS_COMMON) $$5 $(LIBS_COMMON) $(LIBS) -o conftest $(TO_DEVNULL); \
275                 then \
276                         $(RM) conftest conftest.o conftest.d; \
277                         $(ECHO) "found."; \
278                 else \
279                         $(RM) conftest conftest.o conftest.d; \
280                         $(ECHO) "not found, please install it or set PKG_CONFIG_PATH right!"; \
281                         $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
282                         $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
283                         exit 1; \
284                 fi; \
285         }; \
286         $(ECHO) checking that the dependencies exist; \
287         checkheader libglib2.0-dev glib/gutils.h g_path_is_absolute "$(CPPFLAGS_GLIB)" "$(LIBS_GLIB)"; \
288         checkheader libxml2-dev libxml/xpath.h xmlXPathInit "$(CPPFLAGS_XML)" "$(LIBS_XML)"; \
289         checkheader libpng12-dev png.h png_create_read_struct "$(CPPFLAGS_PNG)" "$(LIBS_PNG)"; \
290         checkheader "mesa-common-dev (or another OpenGL library)" GL/gl.h glClear "$(CPPFLAGS_GL)" "$(LIBS_GL)"; \
291         checkheader libgtk2.0-dev gtk/gtkdialog.h gtk_dialog_run "$(CPPFLAGS_GTK)" "$(LIBS_GTK)"; \
292         checkheader libgtkglext1-dev gtk/gtkglwidget.h gtk_widget_get_gl_context "$(CPPFLAGS_GTKGLEXT)" "$(LIBS_GTKGLEXT)"; \
293         [ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \
294         checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \
295         $(ECHO) All required libraries have been found!
296         @$(ECHO)
297 endif
298
299 .PHONY: binaries
300 binaries: \
301         $(INSTALLDIR)/heretic2/h2data.$(EXE) \
302         $(INSTALLDIR)/modules/archivepak.$(DLL) \
303         $(INSTALLDIR)/modules/archivewad.$(DLL) \
304         $(INSTALLDIR)/modules/archivezip.$(DLL) \
305         $(INSTALLDIR)/modules/entity.$(DLL) \
306         $(INSTALLDIR)/modules/image.$(DLL) \
307         $(INSTALLDIR)/modules/imagehl.$(DLL) \
308         $(INSTALLDIR)/modules/imagepng.$(DLL) \
309         $(INSTALLDIR)/modules/imageq2.$(DLL) \
310         $(INSTALLDIR)/modules/mapq3.$(DLL) \
311         $(INSTALLDIR)/modules/mapxml.$(DLL) \
312         $(INSTALLDIR)/modules/md3model.$(DLL) \
313         $(INSTALLDIR)/modules/model.$(DLL) \
314         $(INSTALLDIR)/modules/shaders.$(DLL) \
315         $(INSTALLDIR)/modules/vfspk3.$(DLL) \
316         $(INSTALLDIR)/plugins/bobtoolz.$(DLL) \
317         $(INSTALLDIR)/plugins/brushexport.$(DLL) \
318         $(INSTALLDIR)/plugins/prtview.$(DLL) \
319         $(INSTALLDIR)/plugins/shaderplug.$(DLL) \
320         $(INSTALLDIR)/plugins/sunplug.$(DLL) \
321         $(INSTALLDIR)/plugins/ufoaiplug.$(DLL) \
322         $(INSTALLDIR)/q2map.$(EXE) \
323         $(INSTALLDIR)/q3data.$(EXE) \
324         $(INSTALLDIR)/q3map2.$(EXE) \
325         $(INSTALLDIR)/qdata3.$(EXE) \
326         $(INSTALLDIR)/radiant.$(EXE) \
327
328 .PHONY: clean
329 clean:
330         $(RM_R) $(INSTALLDIR)/
331         $(FIND) . \( -name \*.o -o -name \*.d -o -name \*.$(DLL) -o -name \*.$(A) -o -name \*.$(EXE) \) -exec $(RM) {} \;
332         $(RM) icons/*.rc
333
334 %.$(EXE):
335         file=$@; $(MKDIR) $${file%/*}
336         $(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -o $@
337         [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
338
339 %.$(A):
340         $(AR) rc $@ $^
341         $(RANLIB) $@
342
343 %.$(DLL):
344         file=$@; $(MKDIR) $${file%/*}
345         $(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LDFLAGS_DLL) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -shared -o $@
346         [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
347
348 %.rc: %.ico
349         $(ECHO) '1 ICON "$<"' > $@
350
351 ifeq ($(OS),Win32)
352 %.o: %.rc
353         $(WINDRES) $< $@
354 endif
355
356 %.o: %.cpp $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),)
357         $(CXX) $< $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
358
359 %.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),)
360         $(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
361
362 $(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_ZLIB)
363 $(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) -Itools/quake3/common -Ilibs -Iinclude
364 $(INSTALLDIR)/q3map2.$(EXE): \
365         tools/quake3/common/cmdlib.o \
366         tools/quake3/common/imagelib.o \
367         tools/quake3/common/inout.o \
368         tools/quake3/common/md4.o \
369         tools/quake3/common/mutex.o \
370         tools/quake3/common/polylib.o \
371         tools/quake3/common/scriplib.o \
372         tools/quake3/common/threads.o \
373         tools/quake3/common/unzip.o \
374         tools/quake3/common/vfs.o \
375         tools/quake3/q3map2/brush.o \
376         tools/quake3/q3map2/brush_primit.o \
377         tools/quake3/q3map2/bspfile_abstract.o \
378         tools/quake3/q3map2/bspfile_ibsp.o \
379         tools/quake3/q3map2/bspfile_rbsp.o \
380         tools/quake3/q3map2/bsp.o \
381         tools/quake3/q3map2/convert_ase.o \
382         tools/quake3/q3map2/convert_map.o \
383         tools/quake3/q3map2/decals.o \
384         tools/quake3/q3map2/facebsp.o \
385         tools/quake3/q3map2/fog.o \
386         tools/quake3/q3map2/image.o \
387         tools/quake3/q3map2/leakfile.o \
388         tools/quake3/q3map2/light_bounce.o \
389         tools/quake3/q3map2/lightmaps_ydnar.o \
390         tools/quake3/q3map2/light.o \
391         tools/quake3/q3map2/light_trace.o \
392         tools/quake3/q3map2/light_ydnar.o \
393         tools/quake3/q3map2/main.o \
394         tools/quake3/q3map2/map.o \
395         tools/quake3/q3map2/mesh.o \
396         tools/quake3/q3map2/model.o \
397         tools/quake3/q3map2/patch.o \
398         tools/quake3/q3map2/path_init.o \
399         tools/quake3/q3map2/portals.o \
400         tools/quake3/q3map2/prtfile.o \
401         tools/quake3/q3map2/shaders.o \
402         tools/quake3/q3map2/surface_extra.o \
403         tools/quake3/q3map2/surface_foliage.o \
404         tools/quake3/q3map2/surface_fur.o \
405         tools/quake3/q3map2/surface_meta.o \
406         tools/quake3/q3map2/surface.o \
407         tools/quake3/q3map2/tjunction.o \
408         tools/quake3/q3map2/tree.o \
409         tools/quake3/q3map2/visflow.o \
410         tools/quake3/q3map2/vis.o \
411         tools/quake3/q3map2/writebsp.o \
412         libddslib.$(A) \
413         libjpeg6.$(A) \
414         libl_net.$(A) \
415         libmathlib.$(A) \
416         libpicomodel.$(A) \
417         $(if $(findstring $(OS),Win32),icons/q3map2.o,) \
418
419 libmathlib.$(A): CPPFLAGS_EXTRA := -Ilibs
420 libmathlib.$(A): \
421         libs/mathlib/bbox.o \
422         libs/mathlib/line.o \
423         libs/mathlib/m4x4.o \
424         libs/mathlib/mathlib.o \
425         libs/mathlib/ray.o \
426
427 libl_net.$(A): CPPFLAGS_EXTRA := -Ilibs
428 libl_net.$(A): \
429         libs/l_net/l_net.o \
430         $(if $(findstring $(OS),Win32),libs/l_net/l_net_wins.o,libs/l_net/l_net_berkley.o) \
431
432 libjpeg6.$(A): CPPFLAGS_EXTRA := -Ilibs/jpeg6 -Ilibs
433 libjpeg6.$(A): \
434         libs/jpeg6/jcomapi.o \
435         libs/jpeg6/jdapimin.o \
436         libs/jpeg6/jdapistd.o \
437         libs/jpeg6/jdatasrc.o \
438         libs/jpeg6/jdcoefct.o \
439         libs/jpeg6/jdcolor.o \
440         libs/jpeg6/jddctmgr.o \
441         libs/jpeg6/jdhuff.o \
442         libs/jpeg6/jdinput.o \
443         libs/jpeg6/jdmainct.o \
444         libs/jpeg6/jdmarker.o \
445         libs/jpeg6/jdmaster.o \
446         libs/jpeg6/jdpostct.o \
447         libs/jpeg6/jdsample.o \
448         libs/jpeg6/jdtrans.o \
449         libs/jpeg6/jerror.o \
450         libs/jpeg6/jfdctflt.o \
451         libs/jpeg6/jidctflt.o \
452         libs/jpeg6/jmemmgr.o \
453         libs/jpeg6/jmemnobs.o \
454         libs/jpeg6/jpgload.o \
455         libs/jpeg6/jutils.o \
456
457 libpicomodel.$(A): CPPFLAGS_EXTRA := -Ilibs
458 libpicomodel.$(A): \
459         libs/picomodel/lwo/clip.o \
460         libs/picomodel/lwo/envelope.o \
461         libs/picomodel/lwo/list.o \
462         libs/picomodel/lwo/lwio.o \
463         libs/picomodel/lwo/lwo2.o \
464         libs/picomodel/lwo/lwob.o \
465         libs/picomodel/lwo/pntspols.o \
466         libs/picomodel/lwo/surface.o \
467         libs/picomodel/lwo/vecmath.o \
468         libs/picomodel/lwo/vmap.o \
469         libs/picomodel/picointernal.o \
470         libs/picomodel/picomodel.o \
471         libs/picomodel/picomodules.o \
472         libs/picomodel/pm_3ds.o \
473         libs/picomodel/pm_ase.o \
474         libs/picomodel/pm_fm.o \
475         libs/picomodel/pm_lwo.o \
476         libs/picomodel/pm_md2.o \
477         libs/picomodel/pm_md3.o \
478         libs/picomodel/pm_mdc.o \
479         libs/picomodel/pm_ms3d.o \
480         libs/picomodel/pm_obj.o \
481         libs/picomodel/pm_terrain.o \
482
483 libddslib.$(A): CPPFLAGS_EXTRA := -Ilibs
484 libddslib.$(A): \
485         libs/ddslib/ddslib.o \
486
487 $(INSTALLDIR)/q3data.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_ZLIB)
488 $(INSTALLDIR)/q3data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_ZLIB) -Itools/quake3/common -Ilibs -Iinclude
489 $(INSTALLDIR)/q3data.$(EXE): \
490         tools/quake3/common/aselib.o \
491         tools/quake3/common/bspfile.o \
492         tools/quake3/common/cmdlib.o \
493         tools/quake3/common/imagelib.o \
494         tools/quake3/common/inout.o \
495         tools/quake3/common/md4.o \
496         tools/quake3/common/scriplib.o \
497         tools/quake3/common/trilib.o \
498         tools/quake3/common/unzip.o \
499         tools/quake3/common/vfs.o \
500         tools/quake3/q3data/3dslib.o \
501         tools/quake3/q3data/compress.o \
502         tools/quake3/q3data/images.o \
503         tools/quake3/q3data/md3lib.o \
504         tools/quake3/q3data/models.o \
505         tools/quake3/q3data/p3dlib.o \
506         tools/quake3/q3data/polyset.o \
507         tools/quake3/q3data/q3data.o \
508         tools/quake3/q3data/stripper.o \
509         tools/quake3/q3data/video.o \
510         libl_net.$(A) \
511         libmathlib.$(A) \
512         $(if $(findstring $(OS),Win32),icons/q3data.o,) \
513
514 $(INSTALLDIR)/radiant.$(EXE): LDFLAGS_EXTRA := $(MWINDOWS)
515 $(INSTALLDIR)/radiant.$(EXE): LIBS_EXTRA := $(LIBS_GL) $(LIBS_DL) $(LIBS_XML) $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_GTKGLEXT) $(LIBS_ZLIB)
516 $(INSTALLDIR)/radiant.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_GL) $(CPPFLAGS_DL) $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) -Ilibs -Iinclude
517 $(INSTALLDIR)/radiant.$(EXE): \
518         radiant/autosave.o \
519         radiant/brushmanip.o \
520         radiant/brushmodule.o \
521         radiant/brushnode.o \
522         radiant/brush.o \
523         radiant/brush_primit.o \
524         radiant/brushtokens.o \
525         radiant/brushxml.o \
526         radiant/build.o \
527         radiant/camwindow.o \
528         radiant/clippertool.o \
529         radiant/commands.o \
530         radiant/console.o \
531         radiant/csg.o \
532         radiant/dialog.o \
533         radiant/eclass_def.o \
534         radiant/eclass_doom3.o \
535         radiant/eclass_fgd.o \
536         radiant/eclass.o \
537         radiant/eclass_xml.o \
538         radiant/entityinspector.o \
539         radiant/entitylist.o \
540         radiant/entity.o \
541         radiant/environment.o \
542         radiant/error.o \
543         radiant/feedback.o \
544         radiant/filetypes.o \
545         radiant/filters.o \
546         radiant/findtexturedialog.o \
547         radiant/glwidget.o \
548         radiant/grid.o \
549         radiant/groupdialog.o \
550         radiant/gtkdlgs.o \
551         radiant/gtkmisc.o \
552         radiant/help.o \
553         radiant/image.o \
554         radiant/mainframe.o \
555         radiant/main.o \
556         radiant/map.o \
557         $(if $(findstring $(OS),Win32),radiant/multimon.o,) \
558         radiant/mru.o \
559         radiant/nullmodel.o \
560         radiant/parse.o \
561         radiant/patchdialog.o \
562         radiant/patchmanip.o \
563         radiant/patchmodule.o \
564         radiant/patch.o \
565         radiant/pluginapi.o \
566         radiant/pluginmanager.o \
567         radiant/pluginmenu.o \
568         radiant/plugin.o \
569         radiant/plugintoolbar.o \
570         radiant/points.o \
571         radiant/preferencedictionary.o \
572         radiant/preferences.o \
573         radiant/qe3.o \
574         radiant/qgl.o \
575         radiant/referencecache.o \
576         radiant/renderer.o \
577         radiant/renderstate.o \
578         radiant/scenegraph.o \
579         radiant/selection.o \
580         radiant/select.o \
581         radiant/server.o \
582         radiant/shaders.o \
583         radiant/sockets.o \
584         radiant/stacktrace.o \
585         radiant/surfacedialog.o \
586         radiant/texmanip.o \
587         radiant/textures.o \
588         radiant/texwindow.o \
589         radiant/timer.o \
590         radiant/treemodel.o \
591         radiant/undo.o \
592         radiant/url.o \
593         radiant/view.o \
594         radiant/watchbsp.o \
595         radiant/winding.o \
596         radiant/windowobservers.o \
597         radiant/xmlstuff.o \
598         radiant/xywindow.o \
599         libcmdlib.$(A) \
600         libgtkutil.$(A) \
601         libl_net.$(A) \
602         libmathlib.$(A) \
603         libprofile.$(A) \
604         libxmllib.$(A) \
605         $(if $(findstring $(OS),Win32),icons/radiant.o,) \
606
607 libcmdlib.$(A): CPPFLAGS_EXTRA := -Ilibs
608 libcmdlib.$(A): \
609         libs/cmdlib/cmdlib.o \
610
611 libprofile.$(A): CPPFLAGS_EXTRA := -Ilibs -Iinclude
612 libprofile.$(A): \
613         libs/profile/file.o \
614         libs/profile/profile.o \
615
616 libgtkutil.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) -Ilibs -Iinclude
617 libgtkutil.$(A): \
618         libs/gtkutil/accelerator.o \
619         libs/gtkutil/button.o \
620         libs/gtkutil/clipboard.o \
621         libs/gtkutil/closure.o \
622         libs/gtkutil/container.o \
623         libs/gtkutil/cursor.o \
624         libs/gtkutil/dialog.o \
625         libs/gtkutil/entry.o \
626         libs/gtkutil/filechooser.o \
627         libs/gtkutil/frame.o \
628         libs/gtkutil/glfont.o \
629         libs/gtkutil/glwidget.o \
630         libs/gtkutil/idledraw.o \
631         libs/gtkutil/image.o \
632         libs/gtkutil/menu.o \
633         libs/gtkutil/messagebox.o \
634         libs/gtkutil/nonmodal.o \
635         libs/gtkutil/paned.o \
636         libs/gtkutil/pointer.o \
637         libs/gtkutil/toolbar.o \
638         libs/gtkutil/widget.o \
639         libs/gtkutil/window.o \
640         libs/gtkutil/xorrectangle.o \
641
642 libxmllib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
643 libxmllib.$(A): \
644         libs/xml/ixml.o \
645         libs/xml/xmlelement.o \
646         libs/xml/xmlparser.o \
647         libs/xml/xmltextags.o \
648         libs/xml/xmlwriter.o \
649
650 $(INSTALLDIR)/modules/archivezip.$(DLL): LIBS_EXTRA := $(LIBS_ZLIB)
651 $(INSTALLDIR)/modules/archivezip.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_ZLIB) -Ilibs -Iinclude
652 $(INSTALLDIR)/modules/archivezip.$(DLL): \
653         plugins/archivezip/archive.o \
654         plugins/archivezip/pkzip.o \
655         plugins/archivezip/plugin.o \
656         plugins/archivezip/zlibstream.o \
657
658 $(INSTALLDIR)/modules/archivewad.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
659 $(INSTALLDIR)/modules/archivewad.$(DLL): \
660         plugins/archivewad/archive.o \
661         plugins/archivewad/plugin.o \
662         plugins/archivewad/wad.o \
663
664 $(INSTALLDIR)/modules/archivepak.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
665 $(INSTALLDIR)/modules/archivepak.$(DLL): \
666         plugins/archivepak/archive.o \
667         plugins/archivepak/pak.o \
668         plugins/archivepak/plugin.o \
669
670 $(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
671 $(INSTALLDIR)/modules/entity.$(DLL): \
672         plugins/entity/angle.o \
673         plugins/entity/angles.o \
674         plugins/entity/colour.o \
675         plugins/entity/doom3group.o \
676         plugins/entity/eclassmodel.o \
677         plugins/entity/entity.o \
678         plugins/entity/filters.o \
679         plugins/entity/generic.o \
680         plugins/entity/group.o \
681         plugins/entity/light.o \
682         plugins/entity/miscmodel.o \
683         plugins/entity/model.o \
684         plugins/entity/modelskinkey.o \
685         plugins/entity/namedentity.o \
686         plugins/entity/origin.o \
687         plugins/entity/plugin.o \
688         plugins/entity/rotation.o \
689         plugins/entity/scale.o \
690         plugins/entity/skincache.o \
691         plugins/entity/targetable.o \
692
693 $(INSTALLDIR)/modules/image.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
694 $(INSTALLDIR)/modules/image.$(DLL): \
695         plugins/image/bmp.o \
696         plugins/image/dds.o \
697         plugins/image/image.o \
698         plugins/image/jpeg.o \
699         plugins/image/pcx.o \
700         plugins/image/tga.o \
701         libddslib.$(A) \
702         libjpeg6.$(A) \
703
704 $(INSTALLDIR)/modules/imageq2.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
705 $(INSTALLDIR)/modules/imageq2.$(DLL): \
706         plugins/imageq2/imageq2.o \
707         plugins/imageq2/wal32.o \
708         plugins/imageq2/wal.o \
709
710 $(INSTALLDIR)/modules/imagehl.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
711 $(INSTALLDIR)/modules/imagehl.$(DLL): \
712         plugins/imagehl/hlw.o \
713         plugins/imagehl/imagehl.o \
714         plugins/imagehl/mip.o \
715         plugins/imagehl/sprite.o \
716
717 $(INSTALLDIR)/modules/imagepng.$(DLL): LIBS_EXTRA := $(LIBS_PNG)
718 $(INSTALLDIR)/modules/imagepng.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_PNG) -Ilibs -Iinclude
719 $(INSTALLDIR)/modules/imagepng.$(DLL): \
720         plugins/imagepng/plugin.o \
721
722 $(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
723 $(INSTALLDIR)/modules/mapq3.$(DLL): \
724         plugins/mapq3/parse.o \
725         plugins/mapq3/plugin.o \
726         plugins/mapq3/write.o \
727
728 $(INSTALLDIR)/modules/mapxml.$(DLL): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB)
729 $(INSTALLDIR)/modules/mapxml.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
730 $(INSTALLDIR)/modules/mapxml.$(DLL): \
731         plugins/mapxml/plugin.o \
732         plugins/mapxml/xmlparse.o \
733         plugins/mapxml/xmlwrite.o \
734
735 $(INSTALLDIR)/modules/md3model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
736 $(INSTALLDIR)/modules/md3model.$(DLL): \
737         plugins/md3model/md2.o \
738         plugins/md3model/md3.o \
739         plugins/md3model/md5.o \
740         plugins/md3model/mdc.o \
741         plugins/md3model/mdlimage.o \
742         plugins/md3model/mdl.o \
743         plugins/md3model/plugin.o \
744
745 $(INSTALLDIR)/modules/model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
746 $(INSTALLDIR)/modules/model.$(DLL): \
747         plugins/model/model.o \
748         plugins/model/plugin.o \
749         libpicomodel.$(A) \
750
751 $(INSTALLDIR)/modules/shaders.$(DLL): LIBS_EXTRA := $(LIBS_GLIB)
752 $(INSTALLDIR)/modules/shaders.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
753 $(INSTALLDIR)/modules/shaders.$(DLL): \
754         plugins/shaders/plugin.o \
755         plugins/shaders/shaders.o \
756
757 $(INSTALLDIR)/modules/vfspk3.$(DLL): LIBS_EXTRA := $(LIBS_GLIB)
758 $(INSTALLDIR)/modules/vfspk3.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
759 $(INSTALLDIR)/modules/vfspk3.$(DLL): \
760         plugins/vfspk3/archive.o \
761         plugins/vfspk3/vfs.o \
762         plugins/vfspk3/vfspk3.o \
763
764 $(INSTALLDIR)/plugins/bobtoolz.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
765 $(INSTALLDIR)/plugins/bobtoolz.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
766 $(INSTALLDIR)/plugins/bobtoolz.$(DLL): \
767         contrib/bobtoolz/bobToolz-GTK.o \
768         contrib/bobtoolz/bsploader.o \
769         contrib/bobtoolz/cportals.o \
770         contrib/bobtoolz/DBobView.o \
771         contrib/bobtoolz/DBrush.o \
772         contrib/bobtoolz/DEntity.o \
773         contrib/bobtoolz/DEPair.o \
774         contrib/bobtoolz/dialogs/dialogs-gtk.o \
775         contrib/bobtoolz/DMap.o \
776         contrib/bobtoolz/DPatch.o \
777         contrib/bobtoolz/DPlane.o \
778         contrib/bobtoolz/DPoint.o \
779         contrib/bobtoolz/DShape.o \
780         contrib/bobtoolz/DTrainDrawer.o \
781         contrib/bobtoolz/DTreePlanter.o \
782         contrib/bobtoolz/DVisDrawer.o \
783         contrib/bobtoolz/DWinding.o \
784         contrib/bobtoolz/funchandlers-GTK.o \
785         contrib/bobtoolz/lists.o \
786         contrib/bobtoolz/misc.o \
787         contrib/bobtoolz/ScriptParser.o \
788         contrib/bobtoolz/shapes.o \
789         contrib/bobtoolz/visfind.o \
790         libcmdlib.$(A) \
791         libmathlib.$(A) \
792         libprofile.$(A) \
793
794 $(INSTALLDIR)/plugins/brushexport.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
795 $(INSTALLDIR)/plugins/brushexport.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
796 $(INSTALLDIR)/plugins/brushexport.$(DLL): \
797         contrib/brushexport/callbacks.o \
798         contrib/brushexport/export.o \
799         contrib/brushexport/interface.o \
800         contrib/brushexport/plugin.o \
801         contrib/brushexport/support.o \
802
803 $(INSTALLDIR)/plugins/prtview.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
804 $(INSTALLDIR)/plugins/prtview.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
805 $(INSTALLDIR)/plugins/prtview.$(DLL): \
806         contrib/prtview/AboutDialog.o \
807         contrib/prtview/ConfigDialog.o \
808         contrib/prtview/LoadPortalFileDialog.o \
809         contrib/prtview/portals.o \
810         contrib/prtview/prtview.o \
811         libprofile.$(A) \
812
813 $(INSTALLDIR)/plugins/shaderplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_XML)
814 $(INSTALLDIR)/plugins/shaderplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_XML) -Ilibs -Iinclude
815 $(INSTALLDIR)/plugins/shaderplug.$(DLL): \
816         contrib/shaderplug/shaderplug.o \
817         libxmllib.$(A) \
818
819 $(INSTALLDIR)/plugins/sunplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
820 $(INSTALLDIR)/plugins/sunplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
821 $(INSTALLDIR)/plugins/sunplug.$(DLL): \
822         contrib/sunplug/sunplug.o \
823
824 $(INSTALLDIR)/qdata3.$(EXE): LIBS_EXTRA := $(LIBS_XML)
825 $(INSTALLDIR)/qdata3.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
826 $(INSTALLDIR)/qdata3.$(EXE): \
827         tools/quake2/common/bspfile.o \
828         tools/quake2/common/cmdlib.o \
829         tools/quake2/common/inout.o \
830         tools/quake2/common/l3dslib.o \
831         tools/quake2/common/lbmlib.o \
832         tools/quake2/common/mathlib.o \
833         tools/quake2/common/md4.o \
834         tools/quake2/common/path_init.o \
835         tools/quake2/common/polylib.o \
836         tools/quake2/common/scriplib.o \
837         tools/quake2/common/threads.o \
838         tools/quake2/common/trilib.o \
839         tools/quake2/qdata/images.o \
840         tools/quake2/qdata/models.o \
841         tools/quake2/qdata/qdata.o \
842         tools/quake2/qdata/sprites.o \
843         tools/quake2/qdata/tables.o \
844         tools/quake2/qdata/video.o \
845         libl_net.$(A) \
846         $(if $(findstring $(OS),Win32),icons/qdata3.o,) \
847
848 $(INSTALLDIR)/q2map.$(EXE): LIBS_EXTRA := $(LIBS_XML)
849 $(INSTALLDIR)/q2map.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
850 $(INSTALLDIR)/q2map.$(EXE): \
851         tools/quake2/common/bspfile.o \
852         tools/quake2/common/cmdlib.o \
853         tools/quake2/common/inout.o \
854         tools/quake2/common/l3dslib.o \
855         tools/quake2/common/lbmlib.o \
856         tools/quake2/common/mathlib.o \
857         tools/quake2/common/md4.o \
858         tools/quake2/common/path_init.o \
859         tools/quake2/common/polylib.o \
860         tools/quake2/common/scriplib.o \
861         tools/quake2/common/threads.o \
862         tools/quake2/common/trilib.o \
863         tools/quake2/q2map/brushbsp.o \
864         tools/quake2/q2map/csg.o \
865         tools/quake2/q2map/faces.o \
866         tools/quake2/q2map/flow.o \
867         tools/quake2/q2map/glfile.o \
868         tools/quake2/q2map/leakfile.o \
869         tools/quake2/q2map/lightmap.o \
870         tools/quake2/q2map/main.o \
871         tools/quake2/q2map/map.o \
872         tools/quake2/q2map/nodraw.o \
873         tools/quake2/q2map/patches.o \
874         tools/quake2/q2map/portals.o \
875         tools/quake2/q2map/prtfile.o \
876         tools/quake2/q2map/qbsp.o \
877         tools/quake2/q2map/qrad.o \
878         tools/quake2/q2map/qvis.o \
879         tools/quake2/q2map/textures.o \
880         tools/quake2/q2map/trace.o \
881         tools/quake2/q2map/tree.o \
882         tools/quake2/q2map/writebsp.o \
883         libl_net.$(A) \
884         $(if $(findstring $(OS),Win32),icons/q2map.o,) \
885
886 $(INSTALLDIR)/plugins/ufoaiplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
887 $(INSTALLDIR)/plugins/ufoaiplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
888 $(INSTALLDIR)/plugins/ufoaiplug.$(DLL): \
889         contrib/ufoaiplug/ufoai_filters.o \
890         contrib/ufoaiplug/ufoai_gtk.o \
891         contrib/ufoaiplug/ufoai_level.o \
892         contrib/ufoaiplug/ufoai.o \
893
894 #$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
895 #$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
896 #$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): \
897 #       contrib/bkgrnd2d/bkgrnd2d.o \
898 #       contrib/bkgrnd2d/dialog.o \
899 #       contrib/bkgrnd2d/plugin.o \
900
901 $(INSTALLDIR)/heretic2/h2data.$(EXE): LIBS_EXTRA := $(LIBS_XML)
902 $(INSTALLDIR)/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
903 $(INSTALLDIR)/heretic2/h2data.$(EXE): \
904         tools/quake2/qdata_heretic2/common/bspfile.o \
905         tools/quake2/qdata_heretic2/common/cmdlib.o \
906         tools/quake2/qdata_heretic2/common/inout.o \
907         tools/quake2/qdata_heretic2/common/l3dslib.o \
908         tools/quake2/qdata_heretic2/common/lbmlib.o \
909         tools/quake2/qdata_heretic2/common/mathlib.o \
910         tools/quake2/qdata_heretic2/common/md4.o \
911         tools/quake2/qdata_heretic2/common/path_init.o \
912         tools/quake2/qdata_heretic2/common/qfiles.o \
913         tools/quake2/qdata_heretic2/common/scriplib.o \
914         tools/quake2/qdata_heretic2/common/threads.o \
915         tools/quake2/qdata_heretic2/common/token.o \
916         tools/quake2/qdata_heretic2/common/trilib.o \
917         tools/quake2/qdata_heretic2/qcommon/reference.o \
918         tools/quake2/qdata_heretic2/qcommon/resourcemanager.o \
919         tools/quake2/qdata_heretic2/qcommon/skeletons.o \
920         tools/quake2/qdata_heretic2/animcomp.o \
921         tools/quake2/qdata_heretic2/book.o \
922         tools/quake2/qdata_heretic2/fmodels.o \
923         tools/quake2/qdata_heretic2/images.o \
924         tools/quake2/qdata_heretic2/jointed.o \
925         tools/quake2/qdata_heretic2/models.o \
926         tools/quake2/qdata_heretic2/pics.o \
927         tools/quake2/qdata_heretic2/qdata.o \
928         tools/quake2/qdata_heretic2/qd_skeletons.o \
929         tools/quake2/qdata_heretic2/sprites.o \
930         tools/quake2/qdata_heretic2/svdcmp.o \
931         tools/quake2/qdata_heretic2/tables.o \
932         tools/quake2/qdata_heretic2/tmix.o \
933         tools/quake2/qdata_heretic2/video.o \
934         libl_net.$(A) \
935         $(if $(findstring $(OS),Win32),icons/h2data.o,) \
936
937 .PHONY: install-data
938 install-data: binaries
939         $(MKDIR) $(INSTALLDIR)/games
940         $(FIND) $(INSTALLDIR)/ -name .svn -exec $(RM_R) {} \; -prune
941         [ "$(OS)" != "Darwin" ] || $(CP_R) setup/data/osx/NetRadiant.app/* $(INSTALLDIR_BASE)/NetRadiant.app/
942         set -ex; \
943         for GAME in games/*; do \
944                 if [ -d "$$GAME/tools" ]; then \
945                         GAME=$$GAME/tools; \
946                 fi; \
947                 for GAMEFILE in $$GAME/games/*.game; do \
948                         $(CP) "$$GAMEFILE" $(INSTALLDIR)/games/; \
949                 done; \
950                 for GAMEDIR in $$GAME/*.game; do \
951                         $(CP_R) "$$GAMEDIR" $(INSTALLDIR)/; \
952                 done; \
953         done
954         $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
955         $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
956         $(CP_R) setup/data/tools/* $(INSTALLDIR)/
957         $(FIND) $(INSTALLDIR)/ -name .svn -exec $(RM_R) {} \; -prune
958
959 .PHONY: install-dll
960 ifeq ($(OS),Win32)
961 install-dll: binaries
962         MKDIR="$(MKDIR)" CP="$(CP)" CAT="$(CAT)" GTKDIR="$(GTKDIR)" WHICHDLL="$(WHICHDLL)" INSTALLDIR="$(INSTALLDIR)" $(SH) install-dlls.sh
963 else
964 install-dll: binaries
965         @$(ECHO) No DLL inclusion implemented for this target.
966 endif
967
968 -include $(shell find . -name \*.d)