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