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