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