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