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