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