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