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