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