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