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