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