]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - Makefile
c5b8cc6823abeb56c4370dd424c47d5b9501eb34
[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
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 = -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_VERSION_NUMBER = 1.5.0
245 RADIANT_VERSION = $(RADIANT_VERSION_NUMBER)n
246 RADIANT_MAJOR_VERSION = 5
247 RADIANT_MINOR_VERSION = 0
248 Q3MAP_VERSION = 2.5.17n
249
250 # Executable extension
251 RADIANT_EXECUTABLE := $(EXE)
252
253 GIT_VERSION := $(shell $(GIT) rev-parse --short HEAD $(STDERR_TO_DEVNULL))
254 ifneq ($(GIT_VERSION),)
255         RADIANT_VERSION := $(RADIANT_VERSION)-git-$(GIT_VERSION)
256         Q3MAP_VERSION := $(Q3MAP_VERSION)-git-$(GIT_VERSION)
257 endif
258
259 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)\""
260
261 .PHONY: all
262 all: \
263         dependencies-check \
264         binaries \
265         install-data \
266         install-dll \
267
268 .PHONY: dependencies-check
269 ifeq ($(findstring $(DEPENDENCIES_CHECK),off),off)
270 dependencies-check:
271         @$(ECHO) dependencies checking disabled, good luck...
272 else
273 dependencies-check:
274         @$(ECHO)
275         @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \
276         failed=0; \
277         checkbinary() \
278         { \
279                 $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
280                 $$2 --help >&3 $(STDERR_TO_STDOUT); \
281                 if [ $$? != 127 ]; then \
282                         $(ECHO) "found."; \
283                 else \
284                         $(ECHO) "not found, please install it or set PATH right!"; \
285                         $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
286                         $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
287                         failed=1; \
288                 fi; \
289         }; \
290         $(ECHO) checking that the build tools exist; \
291         checkbinary "bash (or another shell)" "$(SH)"; \
292         checkbinary coreutils "$(ECHO)"; \
293         checkbinary coreutils "$(ECHO_NOLF)"; \
294         checkbinary coreutils "$(CAT)"; \
295         checkbinary coreutils "$(MKDIR)"; \
296         checkbinary coreutils "$(CP)"; \
297         checkbinary coreutils "$(CP_R)"; \
298         checkbinary coreutils "$(RM)"; \
299         checkbinary coreutils "$(RM_R)"; \
300         checkbinary coreutils "$(MV)"; \
301         checkbinary coreutils "$(ECHO) test $(TEE_STDERR)"; \
302         checkbinary sed "$(SED)"; \
303         checkbinary findutils "$(FIND)"; \
304         checkbinary diff "$(DIFF)"; \
305         checkbinary gcc "$(CC)"; \
306         checkbinary g++ "$(CXX)"; \
307         checkbinary binutils "$(RANLIB)"; \
308         checkbinary binutils "$(AR)"; \
309         checkbinary pkg-config "$(PKGCONFIG)"; \
310         checkbinary unzip "$(UNZIPPER)"; \
311         checkbinary git-core "$(GIT)"; \
312         checkbinary subversion "$(SVN)"; \
313         checkbinary wget "$(WGET)"; \
314         [ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \
315         [ -n "$(LDD)" ] && checkbinary libc6 "$(LDD)"; \
316         [ -n "$(OTOOL)" ] && checkbinary xcode "$(OTOOL)"; \
317         [ "$$failed" = "0" ] && $(ECHO) All required tools have been found!
318         @$(ECHO)
319         @if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \
320         failed=0; \
321         checkheader() \
322         { \
323                 $(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
324                 if \
325                         $(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); \
326                 then \
327                         if \
328                                 $(CXX) conftest.o $(LDFLAGS) $(LDFLAGS_COMMON) $$5 $(LIBS_COMMON) $(LIBS) -o conftest >&3 $(STDERR_TO_STDOUT); \
329                         then \
330                                 $(RM) conftest conftest.o conftest.d; \
331                                 $(ECHO) "found and links."; \
332                         else \
333                                 $(RM) conftest.o conftest.d; \
334                                 $(ECHO) "found but does not link, please install it or set PKG_CONFIG_PATH right!"; \
335                                 $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
336                                 $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
337                                 failed=1; \
338                         fi; \
339                 else \
340                         $(RM) conftest conftest.o conftest.d; \
341                         $(ECHO) "not found, please install it or set PKG_CONFIG_PATH right!"; \
342                         $(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
343                         $(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
344                         failed=1; \
345                 fi; \
346         }; \
347         $(ECHO) checking that the dependencies exist; \
348         checkheader libjpeg8-dev jpeglib.h jpeg_set_defaults "$(CPPFLAGS_JPEG)" "$(LIBS_JPEG)"; \
349         checkheader libglib2.0-dev glib.h g_path_is_absolute "$(CPPFLAGS_GLIB)" "$(LIBS_GLIB)"; \
350         checkheader libxml2-dev libxml/xpath.h xmlXPathInit "$(CPPFLAGS_XML)" "$(LIBS_XML)"; \
351         checkheader libpng12-dev png.h png_create_read_struct "$(CPPFLAGS_PNG)" "$(LIBS_PNG)"; \
352         checkheader "mesa-common-dev (or another OpenGL library)" GL/gl.h glClear "$(CPPFLAGS_GL)" "$(LIBS_GL)"; \
353         checkheader libgtk2.0-dev gtk/gtkdialog.h gtk_dialog_run "$(CPPFLAGS_GTK)" "$(LIBS_GTK)"; \
354         checkheader libpango1.0-dev pango/pangoft2.h pango_ft2_font_map_new "$(CPPFLAGS_PANGOFT2)" "$(LIBS_PANGOFT2)"; \
355         checkheader libgtkglext1-dev gtk/gtkglwidget.h gtk_widget_get_gl_context "$(CPPFLAGS_GTKGLEXT)" "$(LIBS_GTKGLEXT)"; \
356         [ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \
357         checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \
358         [ "$$failed" = "0" ] && $(ECHO) All required libraries have been found!
359         @$(ECHO)
360 endif
361
362 .PHONY: binaries
363 binaries: \
364         binaries-tools \
365         binaries-radiant \
366
367 .PHONY: binaries-radiant-all
368 binaries-radiant: \
369         binaries-radiant-modules \
370         binaries-radiant-plugins \
371         binaries-radiant-core \
372
373 .PHONY: binaries-radiant-modules
374 binaries-radiant-modules: \
375         $(INSTALLDIR)/modules/archivepak.$(DLL) \
376         $(INSTALLDIR)/modules/archivewad.$(DLL) \
377         $(INSTALLDIR)/modules/archivezip.$(DLL) \
378         $(INSTALLDIR)/modules/entity.$(DLL) \
379         $(INSTALLDIR)/modules/image.$(DLL) \
380         $(INSTALLDIR)/modules/imagehl.$(DLL) \
381         $(INSTALLDIR)/modules/imagepng.$(DLL) \
382         $(INSTALLDIR)/modules/imageq2.$(DLL) \
383         $(INSTALLDIR)/modules/mapq3.$(DLL) \
384         $(INSTALLDIR)/modules/mapxml.$(DLL) \
385         $(INSTALLDIR)/modules/md3model.$(DLL) \
386         $(INSTALLDIR)/modules/model.$(DLL) \
387         $(INSTALLDIR)/modules/shaders.$(DLL) \
388         $(INSTALLDIR)/modules/vfspk3.$(DLL) \
389
390 .PHONY: binaries-radiant-plugins
391 binaries-radiant-plugins: \
392         $(INSTALLDIR)/plugins/bobtoolz.$(DLL) \
393         $(INSTALLDIR)/plugins/brushexport.$(DLL) \
394         $(INSTALLDIR)/plugins/prtview.$(DLL) \
395         $(INSTALLDIR)/plugins/shaderplug.$(DLL) \
396         $(INSTALLDIR)/plugins/sunplug.$(DLL) \
397         $(INSTALLDIR)/plugins/ufoaiplug.$(DLL) \
398
399 .PHONY: binaries-radiant
400 binaries-radiant-core: \
401         $(INSTALLDIR)/radiant.$(EXE) \
402         $(INSTALLDIR)/radiant \
403
404 .PHONY: binaries-tools
405 binaries-tools: \
406         binaries-tools-quake2 \
407         binaries-tools-quake3 \
408
409 .PHONY: binaries-tools-quake2
410 binaries-tools-quake2: \
411         binaries-q2map \
412         binaries-qdata3 \
413         binaries-h2data \
414
415 .PHONY: binaries-q2map
416 binaries-q2map: \
417         $(INSTALLDIR)/q2map.$(EXE) \
418         $(INSTALLDIR)/q2map \
419
420 .PHONY: binaries-qdata3
421 binaries-qdata3: \
422         $(INSTALLDIR)/qdata3.$(EXE) \
423         $(INSTALLDIR)/qdata3 \
424
425 .PHONY: binaries-h2data
426 binaries-h2data: \
427         $(INSTALLDIR)/heretic2/h2data.$(EXE) \
428         $(INSTALLDIR)/heretic2/h2data \
429
430 .PHONY: binaries-tools-quake3
431 binaries-tools-quake3: \
432         binaries-q3data \
433         binaries-q3map2 \
434
435 .PHONY: binaries-q3data
436 binaries-q3data: \
437         $(INSTALLDIR)/q3data.$(EXE) \
438         $(INSTALLDIR)/q3data \
439
440 .PHONY: binaries-q3map2
441 binaries-q3map2: \
442         $(INSTALLDIR)/q3map2.$(EXE) \
443         $(INSTALLDIR)/q3map2 \
444
445
446 .PHONY: clean
447 clean:
448         $(RM_R) $(INSTALLDIR_BASE)/
449         $(FIND) . \( -name \*.o -o -name \*.d -o -name \*.$(DLL) -o -name \*.$(A) -o -name \*.$(EXE) \) -exec $(RM) {} \;
450         $(RM) icons/*.rc
451
452 %.$(EXE):
453         file=$@; $(MKDIR) $${file%/*}
454         $(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -o $@
455         [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
456
457 $(INSTALLDIR)/%: $(INSTALLDIR)/%.$(EXE)
458         if $(MAKE_EXE_SYMLINK); then o=$<; $(LN_SNF) $${o##*/} $@; else true; fi
459
460 %.$(A):
461         $(AR) rc $@ $^
462         $(RANLIB) $@
463
464 %.$(DLL):
465         file=$@; $(MKDIR) $${file%/*}
466         $(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LDFLAGS_DLL) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -shared -o $@
467         [ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
468
469 %.rc: %.ico
470         $(ECHO) '1 ICON "$<"' > $@
471
472 ifeq ($(OS),Win32)
473 %.o: %.rc
474         $(WINDRES) $< $@
475 endif
476
477 %.o: %.cpp $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check
478         $(CXX) $< $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
479
480 %.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check
481         $(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
482
483
484 $(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_ZLIB)
485 $(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) -Itools/quake3/common -Ilibs -Iinclude
486 $(INSTALLDIR)/q3map2.$(EXE): \
487         tools/quake3/common/cmdlib.o \
488         tools/quake3/common/imagelib.o \
489         tools/quake3/common/inout.o \
490         tools/quake3/common/jpeg.o \
491         tools/quake3/common/md4.o \
492         tools/quake3/common/mutex.o \
493         tools/quake3/common/polylib.o \
494         tools/quake3/common/scriplib.o \
495         tools/quake3/common/threads.o \
496         tools/quake3/common/unzip.o \
497         tools/quake3/common/vfs.o \
498         tools/quake3/q3map2/brush.o \
499         tools/quake3/q3map2/brush_primit.o \
500         tools/quake3/q3map2/bspfile_abstract.o \
501         tools/quake3/q3map2/bspfile_ibsp.o \
502         tools/quake3/q3map2/bspfile_rbsp.o \
503         tools/quake3/q3map2/bsp.o \
504         tools/quake3/q3map2/convert_ase.o \
505         tools/quake3/q3map2/convert_bsp.o \
506         tools/quake3/q3map2/convert_obj.o \
507         tools/quake3/q3map2/convert_map.o \
508         tools/quake3/q3map2/decals.o \
509         tools/quake3/q3map2/facebsp.o \
510         tools/quake3/q3map2/fog.o \
511         tools/quake3/q3map2/help.o \
512         tools/quake3/q3map2/image.o \
513         tools/quake3/q3map2/leakfile.o \
514         tools/quake3/q3map2/light_bounce.o \
515         tools/quake3/q3map2/lightmaps_ydnar.o \
516         tools/quake3/q3map2/light.o \
517         tools/quake3/q3map2/light_trace.o \
518         tools/quake3/q3map2/light_ydnar.o \
519         tools/quake3/q3map2/main.o \
520         tools/quake3/q3map2/map.o \
521         tools/quake3/q3map2/minimap.o \
522         tools/quake3/q3map2/mesh.o \
523         tools/quake3/q3map2/model.o \
524         tools/quake3/q3map2/patch.o \
525         tools/quake3/q3map2/path_init.o \
526         tools/quake3/q3map2/portals.o \
527         tools/quake3/q3map2/prtfile.o \
528         tools/quake3/q3map2/shaders.o \
529         tools/quake3/q3map2/surface_extra.o \
530         tools/quake3/q3map2/surface_foliage.o \
531         tools/quake3/q3map2/surface_fur.o \
532         tools/quake3/q3map2/surface_meta.o \
533         tools/quake3/q3map2/surface.o \
534         tools/quake3/q3map2/tjunction.o \
535         tools/quake3/q3map2/tree.o \
536         tools/quake3/q3map2/visflow.o \
537         tools/quake3/q3map2/vis.o \
538         tools/quake3/q3map2/writebsp.o \
539         libddslib.$(A) \
540         libetclib.$(A) \
541         libfilematch.$(A) \
542         libl_net.$(A) \
543         libmathlib.$(A) \
544         libpicomodel.$(A) \
545         $(if $(findstring $(OS),Win32),icons/q3map2.o,) \
546
547 libmathlib.$(A): CPPFLAGS_EXTRA := -Ilibs
548 libmathlib.$(A): \
549         libs/mathlib/bbox.o \
550         libs/mathlib/line.o \
551         libs/mathlib/m4x4.o \
552         libs/mathlib/mathlib.o \
553         libs/mathlib/ray.o \
554
555 libl_net.$(A): CPPFLAGS_EXTRA := -Ilibs
556 libl_net.$(A): \
557         libs/l_net/l_net.o \
558         $(if $(findstring $(OS),Win32),libs/l_net/l_net_wins.o,libs/l_net/l_net_berkley.o) \
559
560 libpicomodel.$(A): CPPFLAGS_EXTRA := -Ilibs
561 libpicomodel.$(A): \
562         libs/picomodel/lwo/clip.o \
563         libs/picomodel/lwo/envelope.o \
564         libs/picomodel/lwo/list.o \
565         libs/picomodel/lwo/lwio.o \
566         libs/picomodel/lwo/lwo2.o \
567         libs/picomodel/lwo/lwob.o \
568         libs/picomodel/lwo/pntspols.o \
569         libs/picomodel/lwo/surface.o \
570         libs/picomodel/lwo/vecmath.o \
571         libs/picomodel/lwo/vmap.o \
572         libs/picomodel/picointernal.o \
573         libs/picomodel/picomodel.o \
574         libs/picomodel/picomodules.o \
575         libs/picomodel/pm_3ds.o \
576         libs/picomodel/pm_ase.o \
577         libs/picomodel/pm_fm.o \
578         libs/picomodel/pm_lwo.o \
579         libs/picomodel/pm_md2.o \
580         libs/picomodel/pm_md3.o \
581         libs/picomodel/pm_mdc.o \
582         libs/picomodel/pm_ms3d.o \
583         libs/picomodel/pm_obj.o \
584         libs/picomodel/pm_terrain.o \
585
586 libddslib.$(A): CPPFLAGS_EXTRA := -Ilibs
587 libddslib.$(A): \
588         libs/ddslib/ddslib.o \
589
590 libetclib.$(A): CPPFLAGS_EXTRA := -Ilibs
591 libetclib.$(A): \
592         libs/etclib.o \
593
594 $(INSTALLDIR)/q3data.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_ZLIB)
595 $(INSTALLDIR)/q3data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_ZLIB) -Itools/quake3/common -Ilibs -Iinclude
596 $(INSTALLDIR)/q3data.$(EXE): \
597         tools/quake3/common/aselib.o \
598         tools/quake3/common/bspfile.o \
599         tools/quake3/common/cmdlib.o \
600         tools/quake3/common/imagelib.o \
601         tools/quake3/common/inout.o \
602         tools/quake3/common/md4.o \
603         tools/quake3/common/scriplib.o \
604         tools/quake3/common/trilib.o \
605         tools/quake3/common/unzip.o \
606         tools/quake3/common/vfs.o \
607         tools/quake3/q3data/3dslib.o \
608         tools/quake3/q3data/compress.o \
609         tools/quake3/q3data/images.o \
610         tools/quake3/q3data/md3lib.o \
611         tools/quake3/q3data/models.o \
612         tools/quake3/q3data/p3dlib.o \
613         tools/quake3/q3data/polyset.o \
614         tools/quake3/q3data/q3data.o \
615         tools/quake3/q3data/stripper.o \
616         tools/quake3/q3data/video.o \
617         libfilematch.$(A) \
618         libetclib.$(A) \
619         libl_net.$(A) \
620         libmathlib.$(A) \
621         $(if $(findstring $(OS),Win32),icons/q3data.o,) \
622
623 $(INSTALLDIR)/radiant.$(EXE): LDFLAGS_EXTRA := $(MWINDOWS)
624 $(INSTALLDIR)/radiant.$(EXE): LIBS_EXTRA := $(LIBS_GL) $(LIBS_DL) $(LIBS_XML) $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_GTKGLEXT) $(LIBS_ZLIB) $(LIBS_PANGOFT2)
625 $(INSTALLDIR)/radiant.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_GL) $(CPPFLAGS_DL) $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) $(CPPFLAGS_PANGOFT2) -Ilibs -Iinclude
626 $(INSTALLDIR)/radiant.$(EXE): \
627         radiant/autosave.o \
628         radiant/brushmanip.o \
629         radiant/brushmodule.o \
630         radiant/brushnode.o \
631         radiant/brush.o \
632         radiant/brush_primit.o \
633         radiant/brushtokens.o \
634         radiant/brushxml.o \
635         radiant/build.o \
636         radiant/camwindow.o \
637         radiant/clippertool.o \
638         radiant/commands.o \
639         radiant/console.o \
640         radiant/csg.o \
641         radiant/dialog.o \
642         radiant/eclass_def.o \
643         radiant/eclass_doom3.o \
644         radiant/eclass_fgd.o \
645         radiant/eclass.o \
646         radiant/eclass_xml.o \
647         radiant/entityinspector.o \
648         radiant/entitylist.o \
649         radiant/entity.o \
650         radiant/environment.o \
651         radiant/error.o \
652         radiant/feedback.o \
653         radiant/filetypes.o \
654         radiant/filters.o \
655         radiant/findtexturedialog.o \
656         radiant/glwidget.o \
657         radiant/grid.o \
658         radiant/groupdialog.o \
659         radiant/gtkdlgs.o \
660         radiant/gtkmisc.o \
661         radiant/help.o \
662         radiant/image.o \
663         radiant/mainframe.o \
664         radiant/main.o \
665         radiant/map.o \
666         $(if $(findstring $(OS),Win32),radiant/multimon.o,) \
667         radiant/mru.o \
668         radiant/nullmodel.o \
669         radiant/parse.o \
670         radiant/patchdialog.o \
671         radiant/patchmanip.o \
672         radiant/patchmodule.o \
673         radiant/patch.o \
674         radiant/pluginapi.o \
675         radiant/pluginmanager.o \
676         radiant/pluginmenu.o \
677         radiant/plugin.o \
678         radiant/plugintoolbar.o \
679         radiant/points.o \
680         radiant/preferencedictionary.o \
681         radiant/preferences.o \
682         radiant/qe3.o \
683         radiant/qgl.o \
684         radiant/referencecache.o \
685         radiant/renderer.o \
686         radiant/renderstate.o \
687         radiant/scenegraph.o \
688         radiant/selection.o \
689         radiant/select.o \
690         radiant/server.o \
691         radiant/shaders.o \
692         radiant/sockets.o \
693         radiant/stacktrace.o \
694         radiant/surfacedialog.o \
695         radiant/texmanip.o \
696         radiant/textures.o \
697         radiant/texwindow.o \
698         radiant/timer.o \
699         radiant/treemodel.o \
700         radiant/undo.o \
701         radiant/url.o \
702         radiant/view.o \
703         radiant/watchbsp.o \
704         radiant/winding.o \
705         radiant/windowobservers.o \
706         radiant/xmlstuff.o \
707         radiant/xywindow.o \
708         libcmdlib.$(A) \
709         libgtkutil.$(A) \
710         libl_net.$(A) \
711         libmathlib.$(A) \
712         libprofile.$(A) \
713         libxmllib.$(A) \
714         $(if $(findstring $(OS),Win32),icons/radiant.o,) \
715
716 libfilematch.$(A): CPPFLAGS_EXTRA := -Ilibs
717 libfilematch.$(A): \
718         libs/filematch.o \
719
720 libcmdlib.$(A): CPPFLAGS_EXTRA := -Ilibs
721 libcmdlib.$(A): \
722         libs/cmdlib/cmdlib.o \
723
724 libprofile.$(A): CPPFLAGS_EXTRA := -Ilibs -Iinclude
725 libprofile.$(A): \
726         libs/profile/file.o \
727         libs/profile/profile.o \
728
729 libgtkutil.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) $(CPPFLAGS_PANGOFT2) -Ilibs -Iinclude
730 libgtkutil.$(A): \
731         libs/gtkutil/accelerator.o \
732         libs/gtkutil/button.o \
733         libs/gtkutil/clipboard.o \
734         libs/gtkutil/closure.o \
735         libs/gtkutil/container.o \
736         libs/gtkutil/cursor.o \
737         libs/gtkutil/dialog.o \
738         libs/gtkutil/entry.o \
739         libs/gtkutil/filechooser.o \
740         libs/gtkutil/frame.o \
741         libs/gtkutil/glfont.o \
742         libs/gtkutil/glwidget.o \
743         libs/gtkutil/idledraw.o \
744         libs/gtkutil/image.o \
745         libs/gtkutil/menu.o \
746         libs/gtkutil/messagebox.o \
747         libs/gtkutil/nonmodal.o \
748         libs/gtkutil/paned.o \
749         libs/gtkutil/pointer.o \
750         libs/gtkutil/toolbar.o \
751         libs/gtkutil/widget.o \
752         libs/gtkutil/window.o \
753         libs/gtkutil/xorrectangle.o \
754
755 libxmllib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
756 libxmllib.$(A): \
757         libs/xml/ixml.o \
758         libs/xml/xmlelement.o \
759         libs/xml/xmlparser.o \
760         libs/xml/xmltextags.o \
761         libs/xml/xmlwriter.o \
762
763 $(INSTALLDIR)/modules/archivezip.$(DLL): LIBS_EXTRA := $(LIBS_ZLIB)
764 $(INSTALLDIR)/modules/archivezip.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_ZLIB) -Ilibs -Iinclude
765 $(INSTALLDIR)/modules/archivezip.$(DLL): \
766         plugins/archivezip/archive.o \
767         plugins/archivezip/pkzip.o \
768         plugins/archivezip/plugin.o \
769         plugins/archivezip/zlibstream.o \
770
771 $(INSTALLDIR)/modules/archivewad.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
772 $(INSTALLDIR)/modules/archivewad.$(DLL): \
773         plugins/archivewad/archive.o \
774         plugins/archivewad/plugin.o \
775         plugins/archivewad/wad.o \
776
777 $(INSTALLDIR)/modules/archivepak.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
778 $(INSTALLDIR)/modules/archivepak.$(DLL): \
779         plugins/archivepak/archive.o \
780         plugins/archivepak/pak.o \
781         plugins/archivepak/plugin.o \
782
783 $(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
784 $(INSTALLDIR)/modules/entity.$(DLL): \
785         plugins/entity/angle.o \
786         plugins/entity/angles.o \
787         plugins/entity/colour.o \
788         plugins/entity/doom3group.o \
789         plugins/entity/eclassmodel.o \
790         plugins/entity/entity.o \
791         plugins/entity/filters.o \
792         plugins/entity/generic.o \
793         plugins/entity/group.o \
794         plugins/entity/light.o \
795         plugins/entity/miscmodel.o \
796         plugins/entity/model.o \
797         plugins/entity/modelskinkey.o \
798         plugins/entity/namedentity.o \
799         plugins/entity/origin.o \
800         plugins/entity/plugin.o \
801         plugins/entity/rotation.o \
802         plugins/entity/scale.o \
803         plugins/entity/skincache.o \
804         plugins/entity/targetable.o \
805
806 $(INSTALLDIR)/modules/image.$(DLL): LIBS_EXTRA := $(LIBS_JPEG)
807 $(INSTALLDIR)/modules/image.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_JPEG) -Ilibs -Iinclude
808 $(INSTALLDIR)/modules/image.$(DLL): \
809         plugins/image/bmp.o \
810         plugins/image/dds.o \
811         plugins/image/image.o \
812         plugins/image/jpeg.o \
813         plugins/image/ktx.o \
814         plugins/image/pcx.o \
815         plugins/image/tga.o \
816         libddslib.$(A) \
817         libetclib.$(A) \
818
819 $(INSTALLDIR)/modules/imageq2.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
820 $(INSTALLDIR)/modules/imageq2.$(DLL): \
821         plugins/imageq2/imageq2.o \
822         plugins/imageq2/wal32.o \
823         plugins/imageq2/wal.o \
824
825 $(INSTALLDIR)/modules/imagehl.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
826 $(INSTALLDIR)/modules/imagehl.$(DLL): \
827         plugins/imagehl/hlw.o \
828         plugins/imagehl/imagehl.o \
829         plugins/imagehl/mip.o \
830         plugins/imagehl/sprite.o \
831
832 $(INSTALLDIR)/modules/imagepng.$(DLL): LIBS_EXTRA := $(LIBS_PNG)
833 $(INSTALLDIR)/modules/imagepng.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_PNG) -Ilibs -Iinclude
834 $(INSTALLDIR)/modules/imagepng.$(DLL): \
835         plugins/imagepng/plugin.o \
836
837 $(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
838 $(INSTALLDIR)/modules/mapq3.$(DLL): \
839         plugins/mapq3/parse.o \
840         plugins/mapq3/plugin.o \
841         plugins/mapq3/write.o \
842
843 $(INSTALLDIR)/modules/mapxml.$(DLL): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB)
844 $(INSTALLDIR)/modules/mapxml.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
845 $(INSTALLDIR)/modules/mapxml.$(DLL): \
846         plugins/mapxml/plugin.o \
847         plugins/mapxml/xmlparse.o \
848         plugins/mapxml/xmlwrite.o \
849
850 $(INSTALLDIR)/modules/md3model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
851 $(INSTALLDIR)/modules/md3model.$(DLL): \
852         plugins/md3model/md2.o \
853         plugins/md3model/md3.o \
854         plugins/md3model/md5.o \
855         plugins/md3model/mdc.o \
856         plugins/md3model/mdlimage.o \
857         plugins/md3model/mdl.o \
858         plugins/md3model/plugin.o \
859
860 $(INSTALLDIR)/modules/model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
861 $(INSTALLDIR)/modules/model.$(DLL): \
862         plugins/model/model.o \
863         plugins/model/plugin.o \
864         libpicomodel.$(A) \
865
866 $(INSTALLDIR)/modules/shaders.$(DLL): LIBS_EXTRA := $(LIBS_GLIB)
867 $(INSTALLDIR)/modules/shaders.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
868 $(INSTALLDIR)/modules/shaders.$(DLL): \
869         plugins/shaders/plugin.o \
870         plugins/shaders/shaders.o \
871
872 $(INSTALLDIR)/modules/vfspk3.$(DLL): LIBS_EXTRA := $(LIBS_GLIB)
873 $(INSTALLDIR)/modules/vfspk3.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
874 $(INSTALLDIR)/modules/vfspk3.$(DLL): \
875         plugins/vfspk3/archive.o \
876         plugins/vfspk3/vfs.o \
877         plugins/vfspk3/vfspk3.o \
878         libfilematch.$(A) \
879
880 $(INSTALLDIR)/plugins/bobtoolz.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
881 $(INSTALLDIR)/plugins/bobtoolz.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
882 $(INSTALLDIR)/plugins/bobtoolz.$(DLL): \
883         contrib/bobtoolz/bobToolz-GTK.o \
884         contrib/bobtoolz/bsploader.o \
885         contrib/bobtoolz/cportals.o \
886         contrib/bobtoolz/DBobView.o \
887         contrib/bobtoolz/DBrush.o \
888         contrib/bobtoolz/DEntity.o \
889         contrib/bobtoolz/DEPair.o \
890         contrib/bobtoolz/dialogs/dialogs-gtk.o \
891         contrib/bobtoolz/DMap.o \
892         contrib/bobtoolz/DPatch.o \
893         contrib/bobtoolz/DPlane.o \
894         contrib/bobtoolz/DPoint.o \
895         contrib/bobtoolz/DShape.o \
896         contrib/bobtoolz/DTrainDrawer.o \
897         contrib/bobtoolz/DTreePlanter.o \
898         contrib/bobtoolz/DVisDrawer.o \
899         contrib/bobtoolz/DWinding.o \
900         contrib/bobtoolz/funchandlers-GTK.o \
901         contrib/bobtoolz/lists.o \
902         contrib/bobtoolz/misc.o \
903         contrib/bobtoolz/ScriptParser.o \
904         contrib/bobtoolz/shapes.o \
905         contrib/bobtoolz/visfind.o \
906         libcmdlib.$(A) \
907         libmathlib.$(A) \
908         libprofile.$(A) \
909
910 $(INSTALLDIR)/plugins/brushexport.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
911 $(INSTALLDIR)/plugins/brushexport.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
912 $(INSTALLDIR)/plugins/brushexport.$(DLL): \
913         contrib/brushexport/callbacks.o \
914         contrib/brushexport/export.o \
915         contrib/brushexport/interface.o \
916         contrib/brushexport/plugin.o \
917         contrib/brushexport/support.o \
918
919 $(INSTALLDIR)/plugins/prtview.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
920 $(INSTALLDIR)/plugins/prtview.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
921 $(INSTALLDIR)/plugins/prtview.$(DLL): \
922         contrib/prtview/AboutDialog.o \
923         contrib/prtview/ConfigDialog.o \
924         contrib/prtview/LoadPortalFileDialog.o \
925         contrib/prtview/portals.o \
926         contrib/prtview/prtview.o \
927         libprofile.$(A) \
928
929 $(INSTALLDIR)/plugins/shaderplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_XML)
930 $(INSTALLDIR)/plugins/shaderplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_XML) -Ilibs -Iinclude
931 $(INSTALLDIR)/plugins/shaderplug.$(DLL): \
932         contrib/shaderplug/shaderplug.o \
933         libxmllib.$(A) \
934
935 $(INSTALLDIR)/plugins/sunplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
936 $(INSTALLDIR)/plugins/sunplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
937 $(INSTALLDIR)/plugins/sunplug.$(DLL): \
938         contrib/sunplug/sunplug.o \
939
940 $(INSTALLDIR)/qdata3.$(EXE): LIBS_EXTRA := $(LIBS_XML)
941 $(INSTALLDIR)/qdata3.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
942 $(INSTALLDIR)/qdata3.$(EXE): \
943         tools/quake2/common/bspfile.o \
944         tools/quake2/common/cmdlib.o \
945         tools/quake2/common/inout.o \
946         tools/quake2/common/l3dslib.o \
947         tools/quake2/common/lbmlib.o \
948         tools/quake2/common/mathlib.o \
949         tools/quake2/common/md4.o \
950         tools/quake2/common/path_init.o \
951         tools/quake2/common/polylib.o \
952         tools/quake2/common/scriplib.o \
953         tools/quake2/common/threads.o \
954         tools/quake2/common/trilib.o \
955         tools/quake2/qdata/images.o \
956         tools/quake2/qdata/models.o \
957         tools/quake2/qdata/qdata.o \
958         tools/quake2/qdata/sprites.o \
959         tools/quake2/qdata/tables.o \
960         tools/quake2/qdata/video.o \
961         libl_net.$(A) \
962         $(if $(findstring $(OS),Win32),icons/qdata3.o,) \
963
964 $(INSTALLDIR)/q2map.$(EXE): LIBS_EXTRA := $(LIBS_XML)
965 $(INSTALLDIR)/q2map.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
966 $(INSTALLDIR)/q2map.$(EXE): \
967         tools/quake2/common/bspfile.o \
968         tools/quake2/common/cmdlib.o \
969         tools/quake2/common/inout.o \
970         tools/quake2/common/l3dslib.o \
971         tools/quake2/common/lbmlib.o \
972         tools/quake2/common/mathlib.o \
973         tools/quake2/common/md4.o \
974         tools/quake2/common/path_init.o \
975         tools/quake2/common/polylib.o \
976         tools/quake2/common/scriplib.o \
977         tools/quake2/common/threads.o \
978         tools/quake2/common/trilib.o \
979         tools/quake2/q2map/brushbsp.o \
980         tools/quake2/q2map/csg.o \
981         tools/quake2/q2map/faces.o \
982         tools/quake2/q2map/flow.o \
983         tools/quake2/q2map/glfile.o \
984         tools/quake2/q2map/leakfile.o \
985         tools/quake2/q2map/lightmap.o \
986         tools/quake2/q2map/main.o \
987         tools/quake2/q2map/map.o \
988         tools/quake2/q2map/nodraw.o \
989         tools/quake2/q2map/patches.o \
990         tools/quake2/q2map/portals.o \
991         tools/quake2/q2map/prtfile.o \
992         tools/quake2/q2map/qbsp.o \
993         tools/quake2/q2map/qrad.o \
994         tools/quake2/q2map/qvis.o \
995         tools/quake2/q2map/textures.o \
996         tools/quake2/q2map/trace.o \
997         tools/quake2/q2map/tree.o \
998         tools/quake2/q2map/writebsp.o \
999         libl_net.$(A) \
1000         $(if $(findstring $(OS),Win32),icons/q2map.o,) \
1001
1002 $(INSTALLDIR)/plugins/ufoaiplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
1003 $(INSTALLDIR)/plugins/ufoaiplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
1004 $(INSTALLDIR)/plugins/ufoaiplug.$(DLL): \
1005         contrib/ufoaiplug/ufoai_filters.o \
1006         contrib/ufoaiplug/ufoai_gtk.o \
1007         contrib/ufoaiplug/ufoai_level.o \
1008         contrib/ufoaiplug/ufoai.o \
1009
1010 $(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
1011 $(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
1012 $(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): \
1013         contrib/bkgrnd2d/bkgrnd2d.o \
1014         contrib/bkgrnd2d/dialog.o \
1015         contrib/bkgrnd2d/plugin.o \
1016
1017 $(INSTALLDIR)/heretic2/h2data.$(EXE): LIBS_EXTRA := $(LIBS_XML)
1018 $(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
1019 $(INSTALLDIR)/heretic2/h2data.$(EXE): \
1020         tools/quake2/qdata_heretic2/common/bspfile.o \
1021         tools/quake2/qdata_heretic2/common/cmdlib.o \
1022         tools/quake2/qdata_heretic2/common/inout.o \
1023         tools/quake2/qdata_heretic2/common/l3dslib.o \
1024         tools/quake2/qdata_heretic2/common/lbmlib.o \
1025         tools/quake2/qdata_heretic2/common/mathlib.o \
1026         tools/quake2/qdata_heretic2/common/md4.o \
1027         tools/quake2/qdata_heretic2/common/path_init.o \
1028         tools/quake2/qdata_heretic2/common/qfiles.o \
1029         tools/quake2/qdata_heretic2/common/scriplib.o \
1030         tools/quake2/qdata_heretic2/common/threads.o \
1031         tools/quake2/qdata_heretic2/common/token.o \
1032         tools/quake2/qdata_heretic2/common/trilib.o \
1033         tools/quake2/qdata_heretic2/qcommon/reference.o \
1034         tools/quake2/qdata_heretic2/qcommon/resourcemanager.o \
1035         tools/quake2/qdata_heretic2/qcommon/skeletons.o \
1036         tools/quake2/qdata_heretic2/animcomp.o \
1037         tools/quake2/qdata_heretic2/book.o \
1038         tools/quake2/qdata_heretic2/fmodels.o \
1039         tools/quake2/qdata_heretic2/images.o \
1040         tools/quake2/qdata_heretic2/jointed.o \
1041         tools/quake2/qdata_heretic2/models.o \
1042         tools/quake2/qdata_heretic2/pics.o \
1043         tools/quake2/qdata_heretic2/qdata.o \
1044         tools/quake2/qdata_heretic2/qd_skeletons.o \
1045         tools/quake2/qdata_heretic2/sprites.o \
1046         tools/quake2/qdata_heretic2/svdcmp.o \
1047         tools/quake2/qdata_heretic2/tables.o \
1048         tools/quake2/qdata_heretic2/tmix.o \
1049         tools/quake2/qdata_heretic2/video.o \
1050         libl_net.$(A) \
1051         $(if $(findstring $(OS),Win32),icons/h2data.o,) \
1052
1053 .PHONY: install-data
1054 install-data: binaries
1055         $(MKDIR) $(INSTALLDIR)/games
1056         $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
1057         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)"
1058         $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
1059         $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
1060         $(CP_R) setup/data/tools/* $(INSTALLDIR)/
1061         $(MKDIR) $(INSTALLDIR)/docs
1062         $(CP_R) docs/* $(INSTALLDIR)/docs/
1063         $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
1064
1065 .PHONY: install-dll
1066 ifeq ($(OS),Win32)
1067 install-dll: binaries
1068         MKDIR="$(MKDIR)" CP="$(CP)" CAT="$(CAT)" GTKDIR="$(GTKDIR)" WHICHDLL="$(WHICHDLL)" INSTALLDIR="$(INSTALLDIR)" $(SH) $(DLLINSTALL) 
1069 else
1070 install-dll: binaries
1071         @$(ECHO) No DLL inclusion implemented for this target.
1072 endif
1073
1074 # release building... NOT for general users
1075 # these may use tools not in the list that is checked by the build system
1076 release-src: BUILD_DATE := $(shell date +%Y%m%d)
1077 release-src: INSTALLDIR := netradiant-$(RADIANT_VERSION_NUMBER)-$(BUILD_DATE)
1078 release-src:
1079         $(GIT) archive --format=tar --prefix=$(INSTALLDIR)/ HEAD | bzip2 > ../$(INSTALLDIR).tar.bz2
1080
1081 release-win32: BUILD_DATE := $(shell date +%Y%m%d)
1082 release-win32: INSTALLDIR := netradiant-$(RADIANT_VERSION_NUMBER)-$(BUILD_DATE)
1083 release-win32:
1084         $(MAKE) all INSTALLDIR=$(INSTALLDIR) MAKEFILE_CONF=cross-Makefile.conf RADIANT_ABOUTMSG="Official release build" BUILD=release
1085         7za a -sfx../../../../../../../../../../$(HOME)/7z.sfx ../$(INSTALLDIR)-win32-7z.exe $(INSTALLDIR)/
1086         chmod 644 ../$(INSTALLDIR)-win32-7z.exe # 7zip is evil
1087         $(MAKE) clean INSTALLDIR=$(INSTALLDIR) MAKEFILE_CONF=cross-Makefile.conf RADIANT_ABOUTMSG="Official release build" BUILD=release
1088
1089 release-all:
1090         $(GIT) clean -xdf
1091         $(MAKE) release-src
1092         $(MAKE) release-win32
1093
1094 # load dependency files
1095 -include $(shell find . -name \*.d)