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