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