Makefile 37.2 KB
Newer Older
1 2
MAKEFILE_CONF      ?= Makefile.conf
-include $(MAKEFILE_CONF)
3 4 5 6 7

## CONFIGURATION SETTINGS
# user customizable stuf
# you may override this in Makefile.conf or the environment
BUILD              ?= debug
8
# or: release, or: extradebug, or: profile
9 10
OS                 ?= $(shell uname)
# or: Linux, Win32, Darwin
rpolzer's avatar
rpolzer committed
11
LDFLAGS            ?=
12 13 14 15 16
CFLAGS             ?=
CXXFLAGS           ?=
CPPFLAGS           ?=
LIBS               ?=
RADIANT_ABOUTMSG   ?= Custom build
17
RADIANT_NAME       ?= NetRadiant
Thomas Debesse's avatar
Thomas Debesse committed
18
RADIANT_BASENAME   ?= netradiant
rpolzer's avatar
rpolzer committed
19

divverent's avatar
divverent committed
20 21 22
# warning: this directory may NOT contain any files other than the ones written by this Makefile!
# NEVER SET THIS TO A SYSTEM WIDE "bin" DIRECTORY!
INSTALLDIR         ?= install
23
DOWNLOADDIR        ?= build/download
divverent's avatar
divverent committed
24

25 26 27 28
CC                 ?= gcc
CXX                ?= g++
RANLIB             ?= ranlib
AR                 ?= ar
rpolzer's avatar
rpolzer committed
29
LDD                ?= ldd # nothing on Win32
30
OTOOL              ?= # only used on OS X
31
WINDRES            ?= windres # only used on Win32
rpolzer's avatar
rpolzer committed
32

rpolzer's avatar
rpolzer committed
33 34 35
PKGCONFIG          ?= pkg-config
PKG_CONFIG_PATH    ?=

rpolzer's avatar
rpolzer committed
36
SH                 ?= $(SHELL)
37
ECHO               ?= echo
38
ECHO_NOLF          ?= echo -n
rpolzer's avatar
rpolzer committed
39 40 41
CAT                ?= cat
MKDIR              ?= mkdir -p
CP                 ?= cp
42
CP_R               ?= $(CP) -r --preserve=timestamps
43 44
LN                 ?= ln
LN_SNF             ?= $(LN) -snf
rpolzer's avatar
rpolzer committed
45
RM                 ?= rm
46 47
RM_R               ?= $(RM) -r
TEE_STDERR         ?= | tee /dev/stderr
rpolzer's avatar
rpolzer committed
48
TR                 ?= tr
rpolzer's avatar
rpolzer committed
49 50
FIND               ?= find
DIFF               ?= diff
51
SED                ?= sed
52
GIT                ?= git
53 54 55
SVN                ?= svn
WGET               ?= wget
MV                 ?= mv
56
UNZIPPER           ?= unzip
rpolzer's avatar
rpolzer committed
57

58 59 60
FD_TO_DEVNULL      ?= >/dev/null
STDOUT_TO_DEVNULL  ?= 1$(FD_TO_DEVNULL)
STDERR_TO_DEVNULL  ?= 2$(FD_TO_DEVNULL)
61 62 63 64 65 66 67 68 69 70 71 72
STDERR_TO_STDOUT   ?= 2>&1
TO_DEVNULL         ?= $(STDOUT_TO_DEVNULL) $(STDERR_TO_STDOUT)

CPPFLAGS_GLIB      ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --cflags $(STDERR_TO_DEVNULL))
LIBS_GLIB          ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
                      $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) glib-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
CPPFLAGS_XML       ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --cflags $(STDERR_TO_DEVNULL))
LIBS_XML           ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
                      $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libxml-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
CPPFLAGS_PNG       ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --cflags $(STDERR_TO_DEVNULL))
LIBS_PNG           ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-L $(STDERR_TO_DEVNULL)) \
                      $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libpng --libs-only-l $(STDERR_TO_DEVNULL))
73 74 75
CPPFLAGS_WEBP      ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libwebp --cflags $(STDERR_TO_DEVNULL))
LIBS_WEBP          ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libwebp --libs-only-L $(STDERR_TO_DEVNULL)) \
                      $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) libwebp --libs-only-l $(STDERR_TO_DEVNULL))
76 77 78
CPPFLAGS_GTK       ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --cflags $(STDERR_TO_DEVNULL))
LIBS_GTK           ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
                      $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --libs-only-l $(STDERR_TO_DEVNULL))
79 80 81
CPPFLAGS_PANGOFT2  ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --cflags $(STDERR_TO_DEVNULL))
LIBS_PANGOFT2      ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --libs-only-L $(STDERR_TO_DEVNULL)) \
                      $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) pangoft2 --libs-only-l $(STDERR_TO_DEVNULL))
82 83 84
CPPFLAGS_GTKGLEXT  ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --cflags $(STDERR_TO_DEVNULL))
LIBS_GTKGLEXT      ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-L $(STDERR_TO_DEVNULL)) \
                      $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtkglext-1.0 --libs-only-l $(STDERR_TO_DEVNULL))
85 86 87 88 89
CPPFLAGS_GL        ?=
LIBS_GL            ?= -lGL # -lopengl32 on Win32
CPPFLAGS_DL        ?=
LIBS_DL            ?= -ldl # nothing on Win32
CPPFLAGS_ZLIB      ?=
TimePath's avatar
TimePath committed
90
LIBS_ZLIB          ?= -lz -lminizip
91 92
CPPFLAGS_JPEG      ?=
LIBS_JPEG          ?= -ljpeg
93
DEPEND_ON_MAKEFILE ?= yes
94 95
DOWNLOAD_GAMEPACKS ?= yes
# set to no to disable gamepack, set to all to even download undistributable gamepacks
96 97 98 99 100

# Support CHECK_DEPENDENCIES with DOWNLOAD_GAMEPACKS semantics
ifneq ($(CHECK_DEPENDENCIES),)
DEPENDENCIES_CHECK = $(patsubst yes,quiet,$(patsubst no,off,$(CHECK_DEPENDENCIES)))
else
rpolzer's avatar
rpolzer committed
101
DEPENDENCIES_CHECK ?= quiet
rpolzer's avatar
rpolzer committed
102
# or: off, verbose
103
endif
104

105
# these are used on Win32 only
106
GTKDIR             ?= $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) $(PKGCONFIG) gtk+-2.0 --variable=prefix $(STDERR_TO_DEVNULL))
107
WHICHDLL           ?= which
108
DLLINSTALL         ?= install-dlls.sh
109

110
# alias mingw32 OSes
111 112 113
ifeq ($(OS),MINGW32_NT-6.0)
	OS = Win32
endif
divverent's avatar
divverent committed
114 115 116
ifeq ($(OS),Windows_NT)
	OS = Win32
endif
117

divverent's avatar
divverent committed
118
CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fno-strict-aliasing
119 120 121
CPPFLAGS_COMMON =
LDFLAGS_COMMON =
LIBS_COMMON =
TimePath's avatar
TimePath committed
122
CXXFLAGS_COMMON = -std=c++11 -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti
rpolzer's avatar
rpolzer committed
123 124

ifeq ($(BUILD),debug)
125 126 127 128 129 130 131 132 133 134
ifeq ($(findstring $(CFLAGS),-g),)
	CFLAGS_COMMON += -g
	# only add -g if no -g flag is in $(CFLAGS)
endif
ifeq ($(findstring $(CFLAGS),-O),)
	CFLAGS_COMMON += -O
	# only add -O if no -O flag is in $(CFLAGS)
endif
	CPPFLAGS_COMMON +=
	LDFLAGS_COMMON +=
divverent's avatar
divverent committed
135 136 137
else

ifeq ($(BUILD),extradebug)
138
ifeq ($(findstring $(CFLAGS),-g),)
139
	CFLAGS_COMMON += -g3
140 141
	# only add -g3 if no -g flag is in $(CFLAGS)
endif
142 143
	CPPFLAGS_COMMON += -D_DEBUG
	LDFLAGS_COMMON +=
divverent's avatar
divverent committed
144
else
divverent's avatar
divverent committed
145

divverent's avatar
divverent committed
146
ifeq ($(BUILD),profile)
147 148 149 150
ifeq ($(findstring $(CFLAGS),-g),)
	CFLAGS_COMMON += -g
	# only add -g if no -g flag is in $(CFLAGS)
endif
151 152
ifeq ($(findstring $(CFLAGS),-O),)
	CFLAGS_COMMON += -O
153
	# only add -O if no -O flag is in $(CFLAGS)
154 155 156 157
endif
	CFLAGS_COMMON += -pg
	CPPFLAGS_COMMON +=
	LDFLAGS_COMMON += -pg
divverent's avatar
divverent committed
158
else
divverent's avatar
divverent committed
159

divverent's avatar
divverent committed
160
ifeq ($(BUILD),release)
rpolzer's avatar
rpolzer committed
161
ifeq ($(findstring $(CFLAGS),-O),)
162
	CFLAGS_COMMON += -O3
rpolzer's avatar
rpolzer committed
163 164
	# only add -O3 if no -O flag is in $(CFLAGS)
endif
165 166
	CPPFLAGS_COMMON +=
	LDFLAGS_COMMON += -s
rpolzer's avatar
rpolzer committed
167
else
divverent's avatar
divverent committed
168

Rudolf Polzer's avatar
Rudolf Polzer committed
169 170 171 172 173
ifeq ($(BUILD),native)
ifeq ($(findstring $(CFLAGS),-O),)
	CFLAGS_COMMON += -O3
	# only add -O3 if no -O flag is in $(CFLAGS)
endif
174
	CFLAGS_COMMON += -march=native -mtune=native
Rudolf Polzer's avatar
Rudolf Polzer committed
175 176 177 178
	CPPFLAGS_COMMON +=
	LDFLAGS_COMMON += -s
else

179
$(error Unsupported build type: $(BUILD))
rpolzer's avatar
rpolzer committed
180
endif
divverent's avatar
divverent committed
181 182 183
endif
endif
endif
Rudolf Polzer's avatar
Rudolf Polzer committed
184
endif
rpolzer's avatar
rpolzer committed
185

divverent's avatar
divverent committed
186 187
INSTALLDIR_BASE := $(INSTALLDIR)

188 189
MAKE_EXE_SYMLINK = false

rpolzer's avatar
rpolzer committed
190
ifeq ($(OS),Linux)
divverent's avatar
divverent committed
191
	CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
192
	CFLAGS_COMMON += -fPIC
rpolzer's avatar
rpolzer committed
193
	LDFLAGS_DLL = -fPIC -ldl
194
	LIBS_COMMON = -lpthread
195
	EXE ?= $(shell uname -m)
196
	MAKE_EXE_SYMLINK = true
rpolzer's avatar
rpolzer committed
197 198
	A = a
	DLL = so
rpolzer's avatar
rpolzer committed
199
	MWINDOWS =
divverent's avatar
divverent committed
200 201 202
else

ifeq ($(OS),Win32)
203
	CPPFLAGS_COMMON += -DWIN32 -D_WIN32 -D_inline=inline -DWORKAROUND_WINDOWS_GTK2_GLWIDGET=1
204
	CFLAGS_COMMON += -mms-bitfields
205
	LDFLAGS_DLL = -Wl,--add-stdcall-alias
Rudolf Polzer's avatar
Rudolf Polzer committed
206
	LIBS_COMMON = -lws2_32 -luser32 -lgdi32 -lole32
207
	EXE ?= exe
208 209
	A = a
	DLL = dll
rpolzer's avatar
rpolzer committed
210
	MWINDOWS = -mwindows
211 212

	# workaround: we have no "ldd" for Win32, so...
rpolzer's avatar
rpolzer committed
213
	LDD =
214
	# workaround: OpenGL library for Win32 is called opengl32.dll
rpolzer's avatar
rpolzer committed
215
	LIBS_GL = -lopengl32
216
	# workaround: no -ldl on Win32
rpolzer's avatar
rpolzer committed
217
	LIBS_DL = 
divverent's avatar
divverent committed
218 219 220
else

ifeq ($(OS),Darwin)
divverent's avatar
divverent committed
221
	CPPFLAGS_COMMON += -DPOSIX -DXWINDOWS
222
	CFLAGS_COMMON += -fPIC
223
	CXXFLAGS_COMMON += -fno-exceptions -fno-rtti
224 225 226
	MACLIBDIR ?= /opt/local/lib
	CPPFLAGS_COMMON += -I$(MACLIBDIR)/../include -I/usr/X11R6/include
	LDFLAGS_COMMON += -L$(MACLIBDIR) -L/usr/X11R6/lib
227
	LDFLAGS_DLL += -dynamiclib -ldl
228 229
	EXE ?= $(shell uname -m)
	MAKE_EXE_SYMLINK = true
divverent's avatar
divverent committed
230 231 232
	A = a
	DLL = dylib
	MWINDOWS =
divverent's avatar
divverent committed
233 234 235
	# workaround for weird prints
	ECHO_NOLF = /bin/echo -n

divverent's avatar
divverent committed
236
	# workaround: http://developer.apple.com/qa/qa2007/qa1567.html
divverent's avatar
divverent committed
237 238
	LIBS_GL += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
	LIBS_GTKGLEXT += -lX11 -dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
divverent's avatar
divverent committed
239 240
	# workaround: we have no "ldd" for OS X, so...
	LDD =
241
	OTOOL = otool
rpolzer's avatar
rpolzer committed
242
else
divverent's avatar
divverent committed
243

244
$(error Unsupported build OS: $(OS))
rpolzer's avatar
rpolzer committed
245
endif
divverent's avatar
divverent committed
246 247
endif
endif
248

rpolzer's avatar
rpolzer committed
249
# VERSION!
Thomas Debesse's avatar
Thomas Debesse committed
250 251 252 253
RADIANT_MAJOR_VERSION = 1
RADIANT_MINOR_VERSION = 5
RADIANT_PATCH_VERSION = 0
RADIANT_VERSION_NUMBER = $(RADIANT_MAJOR_VERSION).$(RADIANT_MINOR_VERSION).$(RADIANT_PATCH_VERSION)
Rudolf Polzer's avatar
Rudolf Polzer committed
254
RADIANT_VERSION = $(RADIANT_VERSION_NUMBER)n
255
Q3MAP_VERSION = 2.5.17n
rpolzer's avatar
rpolzer committed
256

257 258 259
# Executable extension
RADIANT_EXECUTABLE := $(EXE)

260 261 262 263
GIT_VERSION := $(shell $(GIT) rev-parse --short HEAD $(STDERR_TO_DEVNULL))
ifneq ($(GIT_VERSION),)
	RADIANT_VERSION := $(RADIANT_VERSION)-git-$(GIT_VERSION)
	Q3MAP_VERSION := $(Q3MAP_VERSION)-git-$(GIT_VERSION)
rpolzer's avatar
rpolzer committed
264 265
endif

266
CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_VERSION_STRING="\"$(RADIANT_VERSION_STRING)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DRADIANT_NAME="\"${RADIANT_NAME}\"" -DRADIANT_BASENAME="\"${RADIANT_BASENAME}\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\""
TimePath's avatar
TimePath committed
267
CPPFLAGS += -DGTK_TARGET=2
rpolzer's avatar
rpolzer committed
268

269
.PHONY: all
rpolzer's avatar
rpolzer committed
270
all: \
Rudolf Polzer's avatar
Rudolf Polzer committed
271
	dependencies-check \
rpolzer's avatar
rpolzer committed
272 273 274 275
	binaries \
	install-data \
	install-dll \

276
.PHONY: dependencies-check
rpolzer's avatar
rpolzer committed
277 278 279 280
ifeq ($(findstring $(DEPENDENCIES_CHECK),off),off)
dependencies-check:
	@$(ECHO) dependencies checking disabled, good luck...
else
281 282
dependencies-check:
	@$(ECHO)
283
	@if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \
divverent's avatar
divverent committed
284
	failed=0; \
rpolzer's avatar
rpolzer committed
285 286 287
	checkbinary() \
	{ \
		$(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
288
		$$2 --help >&3 $(STDERR_TO_STDOUT); \
rpolzer's avatar
rpolzer committed
289 290 291 292 293 294
		if [ $$? != 127 ]; then \
			$(ECHO) "found."; \
		else \
			$(ECHO) "not found, please install it or set PATH right!"; \
			$(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
			$(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
divverent's avatar
divverent committed
295
			failed=1; \
rpolzer's avatar
rpolzer committed
296 297 298 299 300 301 302 303 304 305 306 307
		fi; \
	}; \
	$(ECHO) checking that the build tools exist; \
	checkbinary "bash (or another shell)" "$(SH)"; \
	checkbinary coreutils "$(ECHO)"; \
	checkbinary coreutils "$(ECHO_NOLF)"; \
	checkbinary coreutils "$(CAT)"; \
	checkbinary coreutils "$(MKDIR)"; \
	checkbinary coreutils "$(CP)"; \
	checkbinary coreutils "$(CP_R)"; \
	checkbinary coreutils "$(RM)"; \
	checkbinary coreutils "$(RM_R)"; \
308
	checkbinary coreutils "$(MV)"; \
rpolzer's avatar
rpolzer committed
309
	checkbinary coreutils "$(ECHO) test $(TEE_STDERR)"; \
310
	checkbinary sed "$(SED)"; \
rpolzer's avatar
rpolzer committed
311 312 313 314 315 316
	checkbinary findutils "$(FIND)"; \
	checkbinary diff "$(DIFF)"; \
	checkbinary gcc "$(CC)"; \
	checkbinary g++ "$(CXX)"; \
	checkbinary binutils "$(RANLIB)"; \
	checkbinary binutils "$(AR)"; \
divverent's avatar
divverent committed
317
	checkbinary pkg-config "$(PKGCONFIG)"; \
318
	checkbinary unzip "$(UNZIPPER)"; \
319 320 321
	checkbinary git-core "$(GIT)"; \
	checkbinary subversion "$(SVN)"; \
	checkbinary wget "$(WGET)"; \
rpolzer's avatar
rpolzer committed
322
	[ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \
323 324
	[ -n "$(LDD)" ] && checkbinary libc6 "$(LDD)"; \
	[ -n "$(OTOOL)" ] && checkbinary xcode "$(OTOOL)"; \
divverent's avatar
divverent committed
325
	[ "$$failed" = "0" ] && $(ECHO) All required tools have been found!
326
	@$(ECHO)
327
	@if [ x"$(DEPENDENCIES_CHECK)" = x"verbose" ]; then set -x; exec 3>&2; else exec 3$(FD_TO_DEVNULL); fi; \
divverent's avatar
divverent committed
328
	failed=0; \
329 330
	checkheader() \
	{ \
rpolzer's avatar
rpolzer committed
331
		$(ECHO_NOLF) "Checking for $$2 ($$1)... "; \
332
		if \
333
			$(CXX) conftest.cpp $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS) $(CPPFLAGS_COMMON) $$4 -DCONFTEST_HEADER="<$$2>" -DCONFTEST_SYMBOL="$$3" $(TARGET_ARCH) $(LDFLAGS) -c -o conftest.o >&3 $(STDERR_TO_STDOUT); \
334
		then \
335 336 337 338 339 340 341 342 343 344 345 346
			if \
				$(CXX) conftest.o $(LDFLAGS) $(LDFLAGS_COMMON) $$5 $(LIBS_COMMON) $(LIBS) -o conftest >&3 $(STDERR_TO_STDOUT); \
			then \
				$(RM) conftest conftest.o conftest.d; \
				$(ECHO) "found and links."; \
			else \
				$(RM) conftest.o conftest.d; \
				$(ECHO) "found but does not link, please install it or set PKG_CONFIG_PATH right!"; \
				$(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
				$(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
				failed=1; \
			fi; \
347
		else \
rpolzer's avatar
rpolzer committed
348
			$(RM) conftest conftest.o conftest.d; \
349
			$(ECHO) "not found, please install it or set PKG_CONFIG_PATH right!"; \
rpolzer's avatar
rpolzer committed
350
			$(ECHO) "To see the failed commands, set DEPENDENCIES_CHECK=verbose"; \
rpolzer's avatar
rpolzer committed
351
			$(ECHO) "To proceed anyway, set DEPENDENCIES_CHECK=off"; \
divverent's avatar
divverent committed
352
			failed=1; \
353 354
		fi; \
	}; \
rpolzer's avatar
rpolzer committed
355
	$(ECHO) checking that the dependencies exist; \
356
	checkheader libjpeg8-dev jpeglib.h jpeg_set_defaults "$(CPPFLAGS_JPEG)" "$(LIBS_JPEG)"; \
Rudolf Polzer's avatar
Rudolf Polzer committed
357
	checkheader libglib2.0-dev glib.h g_path_is_absolute "$(CPPFLAGS_GLIB)" "$(LIBS_GLIB)"; \
rpolzer's avatar
rpolzer committed
358 359
	checkheader libxml2-dev libxml/xpath.h xmlXPathInit "$(CPPFLAGS_XML)" "$(LIBS_XML)"; \
	checkheader libpng12-dev png.h png_create_read_struct "$(CPPFLAGS_PNG)" "$(LIBS_PNG)"; \
360
	checkheader libwebp-dev webp/decode.h WebPGetInfo "$(CPPFLAGS_WEBP)" "$(LIBS_WEBP)"; \
rpolzer's avatar
rpolzer committed
361 362
	checkheader "mesa-common-dev (or another OpenGL library)" GL/gl.h glClear "$(CPPFLAGS_GL)" "$(LIBS_GL)"; \
	checkheader libgtk2.0-dev gtk/gtkdialog.h gtk_dialog_run "$(CPPFLAGS_GTK)" "$(LIBS_GTK)"; \
363
	checkheader libpango1.0-dev pango/pangoft2.h pango_ft2_font_map_new "$(CPPFLAGS_PANGOFT2)" "$(LIBS_PANGOFT2)"; \
rpolzer's avatar
rpolzer committed
364 365 366
	checkheader libgtkglext1-dev gtk/gtkglwidget.h gtk_widget_get_gl_context "$(CPPFLAGS_GTKGLEXT)" "$(LIBS_GTKGLEXT)"; \
	[ "$(OS)" != "Win32" ] && checkheader libc6-dev dlfcn.h dlopen "$(CPPFLAGS_DL)" "$(LIBS_DL)"; \
	checkheader zlib1g-dev zlib.h zlibVersion "$(CPPFLAGS_ZLIB)" "$(LIBS_ZLIB)"; \
divverent's avatar
divverent committed
367
	[ "$$failed" = "0" ] && $(ECHO) All required libraries have been found!
rpolzer's avatar
rpolzer committed
368
	@$(ECHO)
rpolzer's avatar
rpolzer committed
369
endif
370

rpolzer's avatar
rpolzer committed
371 372
.PHONY: binaries
binaries: \
373
	binaries-tools \
Rudolf Polzer's avatar
Rudolf Polzer committed
374
	binaries-radiant \
375 376

.PHONY: binaries-radiant-all
Rudolf Polzer's avatar
Rudolf Polzer committed
377
binaries-radiant: \
378 379
	binaries-radiant-modules \
	binaries-radiant-plugins \
Rudolf Polzer's avatar
Rudolf Polzer committed
380
	binaries-radiant-core \
381 382 383

.PHONY: binaries-radiant-modules
binaries-radiant-modules: \
divverent's avatar
divverent committed
384 385 386 387 388 389 390
	$(INSTALLDIR)/modules/archivepak.$(DLL) \
	$(INSTALLDIR)/modules/archivewad.$(DLL) \
	$(INSTALLDIR)/modules/archivezip.$(DLL) \
	$(INSTALLDIR)/modules/entity.$(DLL) \
	$(INSTALLDIR)/modules/image.$(DLL) \
	$(INSTALLDIR)/modules/imagehl.$(DLL) \
	$(INSTALLDIR)/modules/imagepng.$(DLL) \
391
	$(INSTALLDIR)/modules/imagewebp.$(DLL) \
divverent's avatar
divverent committed
392 393 394 395 396 397 398
	$(INSTALLDIR)/modules/imageq2.$(DLL) \
	$(INSTALLDIR)/modules/mapq3.$(DLL) \
	$(INSTALLDIR)/modules/mapxml.$(DLL) \
	$(INSTALLDIR)/modules/md3model.$(DLL) \
	$(INSTALLDIR)/modules/model.$(DLL) \
	$(INSTALLDIR)/modules/shaders.$(DLL) \
	$(INSTALLDIR)/modules/vfspk3.$(DLL) \
399 400 401

.PHONY: binaries-radiant-plugins
binaries-radiant-plugins: \
divverent's avatar
divverent committed
402 403 404 405 406 407
	$(INSTALLDIR)/plugins/bobtoolz.$(DLL) \
	$(INSTALLDIR)/plugins/brushexport.$(DLL) \
	$(INSTALLDIR)/plugins/prtview.$(DLL) \
	$(INSTALLDIR)/plugins/shaderplug.$(DLL) \
	$(INSTALLDIR)/plugins/sunplug.$(DLL) \
	$(INSTALLDIR)/plugins/ufoaiplug.$(DLL) \
408 409

.PHONY: binaries-radiant
Rudolf Polzer's avatar
Rudolf Polzer committed
410
binaries-radiant-core: \
411
	$(INSTALLDIR)/radiant.$(EXE) \
412
	$(INSTALLDIR)/radiant \
413 414 415 416 417 418 419 420 421 422

.PHONY: binaries-tools
binaries-tools: \
	binaries-tools-quake2 \
	binaries-tools-quake3 \

.PHONY: binaries-tools-quake2
binaries-tools-quake2: \
	binaries-q2map \
	binaries-qdata3 \
Rudolf Polzer's avatar
Rudolf Polzer committed
423
	binaries-h2data \
424 425 426

.PHONY: binaries-q2map
binaries-q2map: \
divverent's avatar
divverent committed
427
	$(INSTALLDIR)/q2map.$(EXE) \
428
	$(INSTALLDIR)/q2map \
429 430 431 432

.PHONY: binaries-qdata3
binaries-qdata3: \
	$(INSTALLDIR)/qdata3.$(EXE) \
433
	$(INSTALLDIR)/qdata3 \
434

Rudolf Polzer's avatar
Rudolf Polzer committed
435 436
.PHONY: binaries-h2data
binaries-h2data: \
437 438
	$(INSTALLDIR)/h2data.$(EXE) \
	$(INSTALLDIR)/h2data \
439 440 441 442 443 444 445 446

.PHONY: binaries-tools-quake3
binaries-tools-quake3: \
	binaries-q3data \
	binaries-q3map2 \

.PHONY: binaries-q3data
binaries-q3data: \
divverent's avatar
divverent committed
447
	$(INSTALLDIR)/q3data.$(EXE) \
448
	$(INSTALLDIR)/q3data \
449 450 451

.PHONY: binaries-q3map2
binaries-q3map2: \
divverent's avatar
divverent committed
452
	$(INSTALLDIR)/q3map2.$(EXE) \
453
	$(INSTALLDIR)/q3map2 \
454

455 456 457

.PHONY: clean
clean:
divverent's avatar
divverent committed
458
	$(RM_R) $(INSTALLDIR_BASE)/
459
	$(RM_R) $(DOWNLOADDIR)/
rpolzer's avatar
rpolzer committed
460
	$(FIND) . \( -name \*.o -o -name \*.d -o -name \*.$(DLL) -o -name \*.$(A) -o -name \*.$(EXE) \) -exec $(RM) {} \;
rpolzer's avatar
rpolzer committed
461
	$(RM) icons/*.rc
462 463

%.$(EXE):
464
	file=$@; $(MKDIR) $${file%/*}
rpolzer's avatar
rpolzer committed
465
	$(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -o $@
466
	[ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
467

468
$(INSTALLDIR)/%: $(INSTALLDIR)/%.$(EXE)
469
	if $(MAKE_EXE_SYMLINK); then o=$<; $(LN_SNF) $${o##*/} $@; else true; fi
470 471 472 473 474

%.$(A):
	$(AR) rc $@ $^
	$(RANLIB) $@

rpolzer's avatar
rpolzer committed
475
%.$(DLL):
476
	file=$@; $(MKDIR) $${file%/*}
rpolzer's avatar
rpolzer committed
477
	$(CXX) $^ $(LDFLAGS) $(LDFLAGS_COMMON) $(LDFLAGS_EXTRA) $(LDFLAGS_DLL) $(LIBS_EXTRA) $(LIBS_COMMON) $(LIBS) -shared -o $@
478
	[ -z "$(LDD)" ] || [ -z "`$(LDD) -r $@ $(STDERR_TO_STDOUT) $(STDOUT_TO_DEVNULL) $(TEE_STDERR)`" ] || { $(RM) $@; exit 1; }
rpolzer's avatar
rpolzer committed
479

rpolzer's avatar
rpolzer committed
480 481 482 483 484 485 486 487
%.rc: %.ico
	$(ECHO) '1 ICON "$<"' > $@

ifeq ($(OS),Win32)
%.o: %.rc
	$(WINDRES) $< $@
endif

Rudolf Polzer's avatar
Rudolf Polzer committed
488
%.o: %.cpp $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check
489
	$(CXX) $< $(CFLAGS) $(CXXFLAGS) $(CFLAGS_COMMON) $(CXXFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
rpolzer's avatar
rpolzer committed
490

491
%.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check
492
	$(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
rpolzer's avatar
rpolzer committed
493

494

495 496
$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_WEBP) $(LIBS_ZLIB)
$(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) $(CPPFLAGS_WEBP) -Itools/quake3/common -Ilibs -Iinclude
divverent's avatar
divverent committed
497
$(INSTALLDIR)/q3map2.$(EXE): \
498 499 500
	tools/quake3/common/cmdlib.o \
	tools/quake3/common/imagelib.o \
	tools/quake3/common/inout.o \
501
	tools/quake3/common/jpeg.o \
rpolzer's avatar
rpolzer committed
502
	tools/quake3/common/md4.o \
503 504 505 506 507 508 509 510 511 512 513
	tools/quake3/common/mutex.o \
	tools/quake3/common/polylib.o \
	tools/quake3/common/scriplib.o \
	tools/quake3/common/threads.o \
	tools/quake3/common/vfs.o \
	tools/quake3/q3map2/brush.o \
	tools/quake3/q3map2/brush_primit.o \
	tools/quake3/q3map2/bspfile_abstract.o \
	tools/quake3/q3map2/bspfile_ibsp.o \
	tools/quake3/q3map2/bspfile_rbsp.o \
	tools/quake3/q3map2/bsp.o \
514 515 516
	tools/quake3/q3map2/bsp_analyze.o \
	tools/quake3/q3map2/bsp_scale.o \
	tools/quake3/q3map2/bsp_info.o \
517
	tools/quake3/q3map2/convert_ase.o \
518
	tools/quake3/q3map2/convert_bsp.o \
519
	tools/quake3/q3map2/convert_obj.o \
520 521
	tools/quake3/q3map2/convert_map.o \
	tools/quake3/q3map2/decals.o \
522
	tools/quake3/q3map2/exportents.o \
523
	tools/quake3/q3map2/facebsp.o \
524
	tools/quake3/q3map2/fixaas.o \
525
	tools/quake3/q3map2/fog.o \
526
	tools/quake3/q3map2/help.o \
527 528 529 530 531 532 533 534 535
	tools/quake3/q3map2/image.o \
	tools/quake3/q3map2/leakfile.o \
	tools/quake3/q3map2/light_bounce.o \
	tools/quake3/q3map2/lightmaps_ydnar.o \
	tools/quake3/q3map2/light.o \
	tools/quake3/q3map2/light_trace.o \
	tools/quake3/q3map2/light_ydnar.o \
	tools/quake3/q3map2/main.o \
	tools/quake3/q3map2/map.o \
536
	tools/quake3/q3map2/minimap.o \
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553
	tools/quake3/q3map2/mesh.o \
	tools/quake3/q3map2/model.o \
	tools/quake3/q3map2/patch.o \
	tools/quake3/q3map2/path_init.o \
	tools/quake3/q3map2/portals.o \
	tools/quake3/q3map2/prtfile.o \
	tools/quake3/q3map2/shaders.o \
	tools/quake3/q3map2/surface_extra.o \
	tools/quake3/q3map2/surface_foliage.o \
	tools/quake3/q3map2/surface_fur.o \
	tools/quake3/q3map2/surface_meta.o \
	tools/quake3/q3map2/surface.o \
	tools/quake3/q3map2/tjunction.o \
	tools/quake3/q3map2/tree.o \
	tools/quake3/q3map2/visflow.o \
	tools/quake3/q3map2/vis.o \
	tools/quake3/q3map2/writebsp.o \
rpolzer's avatar
rpolzer committed
554
	libddslib.$(A) \
555
	libetclib.$(A) \
556
	libfilematch.$(A) \
rpolzer's avatar
rpolzer committed
557 558
	libl_net.$(A) \
	libmathlib.$(A) \
559
	libpicomodel.$(A) \
rpolzer's avatar
rpolzer committed
560
	$(if $(findstring $(OS),Win32),icons/q3map2.o,) \
561

562
libmathlib.$(A): CPPFLAGS_EXTRA := -Ilibs
563 564 565 566
libmathlib.$(A): \
	libs/mathlib/bbox.o \
	libs/mathlib/line.o \
	libs/mathlib/m4x4.o \
rpolzer's avatar
rpolzer committed
567
	libs/mathlib/mathlib.o \
568 569
	libs/mathlib/ray.o \

570
libl_net.$(A): CPPFLAGS_EXTRA := -Ilibs
571 572
libl_net.$(A): \
	libs/l_net/l_net.o \
573
	$(if $(findstring $(OS),Win32),libs/l_net/l_net_wins.o,libs/l_net/l_net_berkley.o) \
574

575
libpicomodel.$(A): CPPFLAGS_EXTRA := -Ilibs
576 577 578 579 580 581 582 583 584 585 586
libpicomodel.$(A): \
	libs/picomodel/lwo/clip.o \
	libs/picomodel/lwo/envelope.o \
	libs/picomodel/lwo/list.o \
	libs/picomodel/lwo/lwio.o \
	libs/picomodel/lwo/lwo2.o \
	libs/picomodel/lwo/lwob.o \
	libs/picomodel/lwo/pntspols.o \
	libs/picomodel/lwo/surface.o \
	libs/picomodel/lwo/vecmath.o \
	libs/picomodel/lwo/vmap.o \
rpolzer's avatar
rpolzer committed
587 588 589 590 591 592 593 594 595 596 597 598 599
	libs/picomodel/picointernal.o \
	libs/picomodel/picomodel.o \
	libs/picomodel/picomodules.o \
	libs/picomodel/pm_3ds.o \
	libs/picomodel/pm_ase.o \
	libs/picomodel/pm_fm.o \
	libs/picomodel/pm_lwo.o \
	libs/picomodel/pm_md2.o \
	libs/picomodel/pm_md3.o \
	libs/picomodel/pm_mdc.o \
	libs/picomodel/pm_ms3d.o \
	libs/picomodel/pm_obj.o \
	libs/picomodel/pm_terrain.o \
600

601
libddslib.$(A): CPPFLAGS_EXTRA := -Ilibs
602 603 604
libddslib.$(A): \
	libs/ddslib/ddslib.o \

605 606 607 608
libetclib.$(A): CPPFLAGS_EXTRA := -Ilibs
libetclib.$(A): \
	libs/etclib.o \

609 610
$(INSTALLDIR)/q3data.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_ZLIB)
$(INSTALLDIR)/q3data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_ZLIB) -Itools/quake3/common -Ilibs -Iinclude
divverent's avatar
divverent committed
611
$(INSTALLDIR)/q3data.$(EXE): \
rpolzer's avatar
rpolzer committed
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
	tools/quake3/common/aselib.o \
	tools/quake3/common/bspfile.o \
	tools/quake3/common/cmdlib.o \
	tools/quake3/common/imagelib.o \
	tools/quake3/common/inout.o \
	tools/quake3/common/md4.o \
	tools/quake3/common/scriplib.o \
	tools/quake3/common/trilib.o \
	tools/quake3/common/vfs.o \
	tools/quake3/q3data/3dslib.o \
	tools/quake3/q3data/compress.o \
	tools/quake3/q3data/images.o \
	tools/quake3/q3data/md3lib.o \
	tools/quake3/q3data/models.o \
	tools/quake3/q3data/p3dlib.o \
	tools/quake3/q3data/polyset.o \
	tools/quake3/q3data/q3data.o \
	tools/quake3/q3data/stripper.o \
	tools/quake3/q3data/video.o \
Rudolf Polzer's avatar
Rudolf Polzer committed
631
	libfilematch.$(A) \
632
	libetclib.$(A) \
rpolzer's avatar
rpolzer committed
633
	libl_net.$(A) \
rpolzer's avatar
rpolzer committed
634
	libmathlib.$(A) \
rpolzer's avatar
rpolzer committed
635
	$(if $(findstring $(OS),Win32),icons/q3data.o,) \
rpolzer's avatar
rpolzer committed
636

divverent's avatar
divverent committed
637
$(INSTALLDIR)/radiant.$(EXE): LDFLAGS_EXTRA := $(MWINDOWS)
638 639
$(INSTALLDIR)/radiant.$(EXE): LIBS_EXTRA := $(LIBS_GL) $(LIBS_DL) $(LIBS_XML) $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_GTKGLEXT) $(LIBS_ZLIB) $(LIBS_PANGOFT2)
$(INSTALLDIR)/radiant.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_GL) $(CPPFLAGS_DL) $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) $(CPPFLAGS_PANGOFT2) -Ilibs -Iinclude
divverent's avatar
divverent committed
640
$(INSTALLDIR)/radiant.$(EXE): \
641 642 643 644
	radiant/autosave.o \
	radiant/brushmanip.o \
	radiant/brushmodule.o \
	radiant/brushnode.o \
rpolzer's avatar
rpolzer committed
645 646
	radiant/brush.o \
	radiant/brush_primit.o \
647 648 649 650 651 652 653 654 655 656 657 658
	radiant/brushtokens.o \
	radiant/brushxml.o \
	radiant/build.o \
	radiant/camwindow.o \
	radiant/clippertool.o \
	radiant/commands.o \
	radiant/console.o \
	radiant/csg.o \
	radiant/dialog.o \
	radiant/eclass_def.o \
	radiant/eclass_doom3.o \
	radiant/eclass_fgd.o \
rpolzer's avatar
rpolzer committed
659
	radiant/eclass.o \
660 661 662
	radiant/eclass_xml.o \
	radiant/entityinspector.o \
	radiant/entitylist.o \
rpolzer's avatar
rpolzer committed
663
	radiant/entity.o \
664 665 666 667 668 669 670 671 672 673 674 675 676 677
	radiant/environment.o \
	radiant/error.o \
	radiant/feedback.o \
	radiant/filetypes.o \
	radiant/filters.o \
	radiant/findtexturedialog.o \
	radiant/glwidget.o \
	radiant/grid.o \
	radiant/groupdialog.o \
	radiant/gtkdlgs.o \
	radiant/gtkmisc.o \
	radiant/help.o \
	radiant/image.o \
	radiant/mainframe.o \
rpolzer's avatar
rpolzer committed
678
	radiant/main.o \
679
	radiant/map.o \
680
	$(if $(findstring $(OS),Win32),radiant/multimon.o,) \
681 682 683 684 685 686
	radiant/mru.o \
	radiant/nullmodel.o \
	radiant/parse.o \
	radiant/patchdialog.o \
	radiant/patchmanip.o \
	radiant/patchmodule.o \
rpolzer's avatar
rpolzer committed
687
	radiant/patch.o \
688 689 690
	radiant/pluginapi.o \
	radiant/pluginmanager.o \
	radiant/pluginmenu.o \
rpolzer's avatar
rpolzer committed
691
	radiant/plugin.o \
692 693 694 695 696 697 698 699 700 701 702
	radiant/plugintoolbar.o \
	radiant/points.o \
	radiant/preferencedictionary.o \
	radiant/preferences.o \
	radiant/qe3.o \
	radiant/qgl.o \
	radiant/referencecache.o \
	radiant/renderer.o \
	radiant/renderstate.o \
	radiant/scenegraph.o \
	radiant/selection.o \
rpolzer's avatar
rpolzer committed
703
	radiant/select.o \
704 705 706
	radiant/server.o \
	radiant/shaders.o \
	radiant/sockets.o \
rpolzer's avatar
rpolzer committed
707
	radiant/stacktrace.o \
708 709
	radiant/surfacedialog.o \
	radiant/texmanip.o \
TimePath's avatar
TimePath committed
710
	radiant/textureentry.o \
711 712 713 714 715 716 717 718 719 720 721 722 723
	radiant/textures.o \
	radiant/texwindow.o \
	radiant/timer.o \
	radiant/treemodel.o \
	radiant/undo.o \
	radiant/url.o \
	radiant/view.o \
	radiant/watchbsp.o \
	radiant/winding.o \
	radiant/windowobservers.o \
	radiant/xmlstuff.o \
	radiant/xywindow.o \
	libcmdlib.$(A) \
rpolzer's avatar
rpolzer committed
724
	libgtkutil.$(A) \
TimePath's avatar
TimePath committed
725
	libuilib.$(A) \
726
	libl_net.$(A) \
rpolzer's avatar
rpolzer committed
727
	libmathlib.$(A) \
728 729
	libprofile.$(A) \
	libxmllib.$(A) \
rpolzer's avatar
rpolzer committed
730
	$(if $(findstring $(OS),Win32),icons/radiant.o,) \
731

732 733 734 735
libfilematch.$(A): CPPFLAGS_EXTRA := -Ilibs
libfilematch.$(A): \
	libs/filematch.o \

736
libcmdlib.$(A): CPPFLAGS_EXTRA := -Ilibs
737 738 739
libcmdlib.$(A): \
	libs/cmdlib/cmdlib.o \

740
libprofile.$(A): CPPFLAGS_EXTRA := -Ilibs -Iinclude
741 742
libprofile.$(A): \
	libs/profile/file.o \
rpolzer's avatar
rpolzer committed
743
	libs/profile/profile.o \
744

745
libgtkutil.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) $(CPPFLAGS_PANGOFT2) -Ilibs -Iinclude
746 747 748 749 750 751 752 753
libgtkutil.$(A): \
	libs/gtkutil/accelerator.o \
	libs/gtkutil/button.o \
	libs/gtkutil/clipboard.o \
	libs/gtkutil/cursor.o \
	libs/gtkutil/dialog.o \
	libs/gtkutil/entry.o \
	libs/gtkutil/filechooser.o \
rpolzer's avatar
rpolzer committed
754
	libs/gtkutil/frame.o \
755 756
	libs/gtkutil/glfont.o \
	libs/gtkutil/glwidget.o \
rpolzer's avatar
rpolzer committed
757
	libs/gtkutil/image.o \
758 759 760 761 762 763 764 765 766
	libs/gtkutil/menu.o \
	libs/gtkutil/messagebox.o \
	libs/gtkutil/nonmodal.o \
	libs/gtkutil/paned.o \
	libs/gtkutil/toolbar.o \
	libs/gtkutil/widget.o \
	libs/gtkutil/window.o \
	libs/gtkutil/xorrectangle.o \

TimePath's avatar
TimePath committed
767 768 769 770
libuilib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) -Ilibs -Iinclude
libuilib.$(A): \
	libs/uilib/uilib.o \

771
libxmllib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
772 773 774
libxmllib.$(A): \
	libs/xml/xmltextags.o \

divverent's avatar
divverent committed
775 776 777
$(INSTALLDIR)/modules/archivezip.$(DLL): LIBS_EXTRA := $(LIBS_ZLIB)
$(INSTALLDIR)/modules/archivezip.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_ZLIB) -Ilibs -Iinclude
$(INSTALLDIR)/modules/archivezip.$(DLL): \
rpolzer's avatar
rpolzer committed
778
	plugins/archivezip/archive.o \
rpolzer's avatar
rpolzer committed
779
	plugins/archivezip/plugin.o \
rpolzer's avatar
rpolzer committed
780

divverent's avatar
divverent committed
781 782
$(INSTALLDIR)/modules/archivewad.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
$(INSTALLDIR)/modules/archivewad.$(DLL): \
rpolzer's avatar
rpolzer committed
783 784 785
	plugins/archivewad/archive.o \
	plugins/archivewad/plugin.o \

divverent's avatar
divverent committed
786 787
$(INSTALLDIR)/modules/archivepak.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
$(INSTALLDIR)/modules/archivepak.$(DLL): \
rpolzer's avatar
rpolzer committed
788 789 790
	plugins/archivepak/archive.o \
	plugins/archivepak/plugin.o \

TimePath's avatar
TimePath committed
791
$(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
divverent's avatar
divverent committed
792
$(INSTALLDIR)/modules/entity.$(DLL): \
rpolzer's avatar
rpolzer committed
793
	plugins/entity/doom3group.o \
rpolzer's avatar
rpolzer committed
794
	plugins/entity/eclassmodel.o \
rpolzer's avatar
rpolzer committed
795 796
	plugins/entity/entity.o \
	plugins/entity/filters.o \
rpolzer's avatar
rpolzer committed
797 798 799 800
	plugins/entity/generic.o \
	plugins/entity/group.o \
	plugins/entity/light.o \
	plugins/entity/miscmodel.o \
rpolzer's avatar
rpolzer committed
801 802
	plugins/entity/plugin.o \
	plugins/entity/skincache.o \
rpolzer's avatar
rpolzer committed
803 804
	plugins/entity/targetable.o \

805 806
$(INSTALLDIR)/modules/image.$(DLL): LIBS_EXTRA := $(LIBS_JPEG)
$(INSTALLDIR)/modules/image.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_JPEG) -Ilibs -Iinclude
divverent's avatar
divverent committed
807
$(INSTALLDIR)/modules/image.$(DLL): \
rpolzer's avatar
rpolzer committed
808
	plugins/image/bmp.o \
rpolzer's avatar
rpolzer committed
809
	plugins/image/dds.o \
rpolzer's avatar
rpolzer committed
810
	plugins/image/image.o \
rpolzer's avatar
rpolzer committed
811
	plugins/image/jpeg.o \
812
	plugins/image/ktx.o \
rpolzer's avatar
rpolzer committed
813 814 815
	plugins/image/pcx.o \
	plugins/image/tga.o \
	libddslib.$(A) \
816
	libetclib.$(A) \
rpolzer's avatar
rpolzer committed
817

divverent's avatar
divverent committed
818 819
$(INSTALLDIR)/modules/imageq2.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
$(INSTALLDIR)/modules/imageq2.$(DLL): \
rpolzer's avatar
rpolzer committed
820 821 822 823
	plugins/imageq2/imageq2.o \
	plugins/imageq2/wal32.o \
	plugins/imageq2/wal.o \

divverent's avatar
divverent committed
824 825
$(INSTALLDIR)/modules/imagehl.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
$(INSTALLDIR)/modules/imagehl.$(DLL): \
rpolzer's avatar
rpolzer committed
826 827 828 829
	plugins/imagehl/hlw.o \
	plugins/imagehl/imagehl.o \
	plugins/imagehl/mip.o \
	plugins/imagehl/sprite.o \
rpolzer's avatar
rpolzer committed
830

divverent's avatar
divverent committed
831 832 833
$(INSTALLDIR)/modules/imagepng.$(DLL): LIBS_EXTRA := $(LIBS_PNG)
$(INSTALLDIR)/modules/imagepng.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_PNG) -Ilibs -Iinclude
$(INSTALLDIR)/modules/imagepng.$(DLL): \
834 835
	plugins/imagepng/plugin.o \

836 837 838 839 840
$(INSTALLDIR)/modules/imagewebp.$(DLL): LIBS_EXTRA := $(LIBS_WEBP)
$(INSTALLDIR)/modules/imagewebp.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_WEBP) -Ilibs -Iinclude
$(INSTALLDIR)/modules/imagewebp.$(DLL): \
	plugins/imagewebp/plugin.o \

TimePath's avatar
TimePath committed
841
$(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
divverent's avatar
divverent committed
842
$(INSTALLDIR)/modules/mapq3.$(DLL): \
843
	plugins/mapq3/parse.o \
rpolzer's avatar
rpolzer committed
844
	plugins/mapq3/plugin.o \
845 846
	plugins/mapq3/write.o \

divverent's avatar
divverent committed
847 848 849
$(INSTALLDIR)/modules/mapxml.$(DLL): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB)
$(INSTALLDIR)/modules/mapxml.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
$(INSTALLDIR)/modules/mapxml.$(DLL): \
rpolzer's avatar
rpolzer committed
850 851 852 853
	plugins/mapxml/plugin.o \
	plugins/mapxml/xmlparse.o \
	plugins/mapxml/xmlwrite.o \

divverent's avatar
divverent committed
854 855
$(INSTALLDIR)/modules/md3model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
$(INSTALLDIR)/modules/md3model.$(DLL): \
856
	plugins/md3model/md2.o \
rpolzer's avatar
rpolzer committed
857 858
	plugins/md3model/md3.o \
	plugins/md3model/md5.o \
859 860
	plugins/md3model/mdc.o \
	plugins/md3model/mdlimage.o \
rpolzer's avatar
rpolzer committed
861 862
	plugins/md3model/mdl.o \
	plugins/md3model/plugin.o \
863

divverent's avatar
divverent committed
864 865
$(INSTALLDIR)/modules/model.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
$(INSTALLDIR)/modules/model.$(DLL): \
866
	plugins/model/model.o \
rpolzer's avatar
rpolzer committed
867
	plugins/model/plugin.o \
868 869
	libpicomodel.$(A) \

divverent's avatar
divverent committed
870 871 872
$(INSTALLDIR)/modules/shaders.$(DLL): LIBS_EXTRA := $(LIBS_GLIB)
$(INSTALLDIR)/modules/shaders.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
$(INSTALLDIR)/modules/shaders.$(DLL): \
873 874 875
	plugins/shaders/plugin.o \
	plugins/shaders/shaders.o \

divverent's avatar
divverent committed
876 877 878
$(INSTALLDIR)/modules/vfspk3.$(DLL): LIBS_EXTRA := $(LIBS_GLIB)
$(INSTALLDIR)/modules/vfspk3.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
$(INSTALLDIR)/modules/vfspk3.$(DLL): \
879 880 881
	plugins/vfspk3/archive.o \
	plugins/vfspk3/vfs.o \
	plugins/vfspk3/vfspk3.o \
Rudolf Polzer's avatar
Rudolf Polzer committed
882
	libfilematch.$(A) \
883

divverent's avatar
divverent committed
884 885 886
$(INSTALLDIR)/plugins/bobtoolz.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
$(INSTALLDIR)/plugins/bobtoolz.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
$(INSTALLDIR)/plugins/bobtoolz.$(DLL): \
rpolzer's avatar
rpolzer committed
887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909
	contrib/bobtoolz/bobToolz-GTK.o \
	contrib/bobtoolz/bsploader.o \
	contrib/bobtoolz/cportals.o \
	contrib/bobtoolz/DBobView.o \
	contrib/bobtoolz/DBrush.o \
	contrib/bobtoolz/DEntity.o \
	contrib/bobtoolz/DEPair.o \
	contrib/bobtoolz/dialogs/dialogs-gtk.o \
	contrib/bobtoolz/DMap.o \
	contrib/bobtoolz/DPatch.o \
	contrib/bobtoolz/DPlane.o \
	contrib/bobtoolz/DPoint.o \
	contrib/bobtoolz/DShape.o \
	contrib/bobtoolz/DTrainDrawer.o \
	contrib/bobtoolz/DTreePlanter.o \
	contrib/bobtoolz/DVisDrawer.o \
	contrib/bobtoolz/DWinding.o \
	contrib/bobtoolz/funchandlers-GTK.o \
	contrib/bobtoolz/lists.o \
	contrib/bobtoolz/misc.o \
	contrib/bobtoolz/ScriptParser.o \
	contrib/bobtoolz/shapes.o \
	contrib/bobtoolz/visfind.o \
rpolzer's avatar
rpolzer committed
910
	libcmdlib.$(A) \
rpolzer's avatar
rpolzer committed
911
	libmathlib.$(A) \
rpolzer's avatar
rpolzer committed
912 913
	libprofile.$(A) \

divverent's avatar
divverent committed
914 915 916
$(INSTALLDIR)/plugins/brushexport.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
$(INSTALLDIR)/plugins/brushexport.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
$(INSTALLDIR)/plugins/brushexport.$(DLL): \
917 918
	contrib/brushexport/callbacks.o \
	contrib/brushexport/export.o \
rpolzer's avatar
rpolzer committed
919 920 921
	contrib/brushexport/interface.o \
	contrib/brushexport/plugin.o \
	contrib/brushexport/support.o \
922

divverent's avatar
divverent committed
923 924 925
$(INSTALLDIR)/plugins/prtview.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
$(INSTALLDIR)/plugins/prtview.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
$(INSTALLDIR)/plugins/prtview.$(DLL): \
926 927 928 929 930 931 932
	contrib/prtview/AboutDialog.o \
	contrib/prtview/ConfigDialog.o \
	contrib/prtview/LoadPortalFileDialog.o \
	contrib/prtview/portals.o \
	contrib/prtview/prtview.o \
	libprofile.$(A) \

divverent's avatar
divverent committed
933 934 935
$(INSTALLDIR)/plugins/shaderplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK) $(LIBS_XML)
$(INSTALLDIR)/plugins/shaderplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_XML) -Ilibs -Iinclude
$(INSTALLDIR)/plugins/shaderplug.$(DLL): \
936 937 938
	contrib/shaderplug/shaderplug.o \
	libxmllib.$(A) \

divverent's avatar
divverent committed
939 940 941
$(INSTALLDIR)/plugins/sunplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
$(INSTALLDIR)/plugins/sunplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
$(INSTALLDIR)/plugins/sunplug.$(DLL): \
942 943
	contrib/sunplug/sunplug.o \

divverent's avatar
divverent committed
944 945 946
$(INSTALLDIR)/qdata3.$(EXE): LIBS_EXTRA := $(LIBS_XML)
$(INSTALLDIR)/qdata3.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
$(INSTALLDIR)/qdata3.$(EXE): \
rpolzer's avatar
rpolzer committed
947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965
	tools/quake2/common/bspfile.o \
	tools/quake2/common/cmdlib.o \
	tools/quake2/common/inout.o \
	tools/quake2/common/l3dslib.o \
	tools/quake2/common/lbmlib.o \
	tools/quake2/common/mathlib.o \
	tools/quake2/common/md4.o \
	tools/quake2/common/path_init.o \
	tools/quake2/common/polylib.o \
	tools/quake2/common/scriplib.o \
	tools/quake2/common/threads.o \
	tools/quake2/common/trilib.o \
	tools/quake2/qdata/images.o \
	tools/quake2/qdata/models.o \
	tools/quake2/qdata/qdata.o \
	tools/quake2/qdata/sprites.o \
	tools/quake2/qdata/tables.o \
	tools/quake2/qdata/video.o \
	libl_net.$(A) \
rpolzer's avatar
rpolzer committed
966
	$(if $(findstring $(OS),Win32),icons/qdata3.o,) \
rpolzer's avatar
rpolzer committed
967

divverent's avatar
divverent committed
968 969 970
$(INSTALLDIR)/q2map.$(EXE): LIBS_EXTRA := $(LIBS_XML)
$(INSTALLDIR)/q2map.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/quake2/common -Ilibs -Iinclude
$(INSTALLDIR)/q2map.$(EXE): \
rpolzer's avatar
rpolzer committed
971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003
	tools/quake2/common/bspfile.o \
	tools/quake2/common/cmdlib.o \
	tools/quake2/common/inout.o \
	tools/quake2/common/l3dslib.o \
	tools/quake2/common/lbmlib.o \
	tools/quake2/common/mathlib.o \
	tools/quake2/common/md4.o \
	tools/quake2/common/path_init.o \
	tools/quake2/common/polylib.o \
	tools/quake2/common/scriplib.o \
	tools/quake2/common/threads.o \
	tools/quake2/common/trilib.o \
	tools/quake2/q2map/brushbsp.o \
	tools/quake2/q2map/csg.o \
	tools/quake2/q2map/faces.o \
	tools/quake2/q2map/flow.o \
	tools/quake2/q2map/glfile.o \
	tools/quake2/q2map/leakfile.o \
	tools/quake2/q2map/lightmap.o \
	tools/quake2/q2map/main.o \
	tools/quake2/q2map/map.o \
	tools/quake2/q2map/nodraw.o \
	tools/quake2/q2map/patches.o \
	tools/quake2/q2map/portals.o \
	tools/quake2/q2map/prtfile.o \
	tools/quake2/q2map/qbsp.o \
	tools/quake2/q2map/qrad.o \
	tools/quake2/q2map/qvis.o \
	tools/quake2/q2map/textures.o \
	tools/quake2/q2map/trace.o \
	tools/quake2/q2map/tree.o \
	tools/quake2/q2map/writebsp.o \
	libl_net.$(A) \
rpolzer's avatar
rpolzer committed
1004
	$(if $(findstring $(OS),Win32),icons/q2map.o,) \
rpolzer's avatar
rpolzer committed
1005

divverent's avatar
divverent committed
1006 1007 1008
$(INSTALLDIR)/plugins/ufoaiplug.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
$(INSTALLDIR)/plugins/ufoaiplug.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
$(INSTALLDIR)/plugins/ufoaiplug.$(DLL): \
rpolzer's avatar
rpolzer committed
1009 1010 1011 1012 1013
	contrib/ufoaiplug/ufoai_filters.o \
	contrib/ufoaiplug/ufoai_gtk.o \
	contrib/ufoaiplug/ufoai_level.o \
	contrib/ufoaiplug/ufoai.o \

1014 1015 1016 1017 1018 1019
$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): LIBS_EXTRA := $(LIBS_GLIB) $(LIBS_GTK)
$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) -Ilibs -Iinclude
$(INSTALLDIR)/plugins/bkgrnd2d.$(DLL): \
	contrib/bkgrnd2d/bkgrnd2d.o \
	contrib/bkgrnd2d/dialog.o \
	contrib/bkgrnd2d/plugin.o \
1020

1021 1022 1023
$(INSTALLDIR)/h2data.$(EXE): LIBS_EXTRA := $(LIBS_XML)
$(INSTALLDIR)/h2data.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) -Itools/heretic2/common -Itools/heretic2/qcommon -Itools/heretic2/h2data -Itools/quake2/common -Ilibs -Iinclude
$(INSTALLDIR)/h2data.$(EXE): \
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053
	tools/heretic2/common/bspfile.o \
	tools/heretic2/common/cmdlib.o \
	tools/heretic2/common/inout.o \
	tools/heretic2/common/l3dslib.o \
	tools/heretic2/common/lbmlib.o \
	tools/heretic2/common/mathlib.o \
	tools/heretic2/common/md4.o \
	tools/heretic2/common/path_init.o \
	tools/heretic2/common/qfiles.o \
	tools/heretic2/common/scriplib.o \
	tools/heretic2/common/threads.o \
	tools/heretic2/common/token.o \
	tools/heretic2/common/trilib.o \
	tools/heretic2/qcommon/reference.o \
	tools/heretic2/qcommon/resourcemanager.o \
	tools/heretic2/qcommon/skeletons.o \
	tools/heretic2/h2data/animcomp.o \
	tools/heretic2/h2data/book.o \
	tools/heretic2/h2data/fmodels.o \
	tools/heretic2/h2data/images.o \
	tools/heretic2/h2data/jointed.o \
	tools/heretic2/h2data/models.o \
	tools/heretic2/h2data/pics.o \
	tools/heretic2/h2data/qdata.o \
	tools/heretic2/h2data/qd_skeletons.o \
	tools/heretic2/h2data/sprites.o \
	tools/heretic2/h2data/svdcmp.o \
	tools/heretic2/h2data/tables.o \
	tools/heretic2/h2data/tmix.o \
	tools/heretic2/h2data/video.o \
rpolzer's avatar
rpolzer committed
1054
	libl_net.$(A) \
rpolzer's avatar
rpolzer committed
1055
	$(if $(findstring $(OS),Win32),icons/h2data.o,) \
rpolzer's avatar
rpolzer committed
1056

rpolzer's avatar
rpolzer committed
1057
.PHONY: install-data
rpolzer's avatar
rpolzer committed
1058
install-data: binaries
1059
	DOWNLOAD_GAMEPACKS="$(DOWNLOAD_GAMEPACKS)" DOWNLOADDIR="$(DOWNLOADDIR)" INSTALLDIR="$(INSTALLDIR)/gamepacks" GIT="$(GIT)" SVN="$(SVN)" WGET="$(WGET)" RM_R="$(RM_R)" MV="$(MV)" UNZIPPER="$(UNZIPPER)" ECHO="$(ECHO)" CP="$(CP)" CP_R="$(CP_R)" ./gamepack-manager
divverent's avatar
divverent committed
1060
	$(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
Thomas Debesse's avatar
Thomas Debesse committed
1061 1062
	$(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
	$(ECHO) $(RADIANT_PATCH_VERSION) > $(INSTALLDIR)/RADIANT_PATCH
divverent's avatar
divverent committed
1063
	$(CP_R) setup/data/tools/* $(INSTALLDIR)/
1064 1065
	$(MKDIR) $(INSTALLDIR)/docs
	$(CP_R) docs/* $(INSTALLDIR)/docs/
rpolzer's avatar
rpolzer committed
1066 1067 1068

.PHONY: install-dll
ifeq ($(OS),Win32)
rpolzer's avatar
rpolzer committed
1069
install-dll: binaries
1070
	MKDIR="$(MKDIR)" CP="$(CP)" CAT="$(CAT)" GTKDIR="$(GTKDIR)" WHICHDLL="$(WHICHDLL)" INSTALLDIR="$(INSTALLDIR)" $(SH) $(DLLINSTALL) 
rpolzer's avatar
rpolzer committed
1071
else
rpolzer's avatar
rpolzer committed
1072
install-dll: binaries
1073
	@$(ECHO) No DLL inclusion implemented for this target.
rpolzer's avatar
rpolzer committed
1074
endif
1075

1076 1077
# release building... NOT for general users
# these may use tools not in the list that is checked by the build system
Rudolf Polzer's avatar
Rudolf Polzer committed
1078
release-src: BUILD_DATE := $(shell date +%Y%m%d)
Rudolf Polzer's avatar
Rudolf Polzer committed
1079
release-src: INSTALLDIR := netradiant-$(RADIANT_VERSION_NUMBER)-$(BUILD_DATE)
1080
release-src:
1081
	$(GIT) archive --format=tar --prefix=$(INSTALLDIR)/ HEAD | bzip2 > ../$(INSTALLDIR).tar.bz2
1082

Rudolf Polzer's avatar
Rudolf Polzer committed
1083
release-win32: BUILD_DATE := $(shell date +%Y%m%d)
Rudolf Polzer's avatar
Rudolf Polzer committed
1084
release-win32: INSTALLDIR := netradiant-$(RADIANT_VERSION_NUMBER)-$(BUILD_DATE)
Rudolf Polzer's avatar
Rudolf Polzer committed
1085
release-win32:
1086
	$(MAKE) all INSTALLDIR=$(INSTALLDIR) MAKEFILE_CONF=cross-Makefile.conf RADIANT_ABOUTMSG="Official release build" BUILD=release
1087
	7za a -sfx../../../../../../../../../../$(HOME)/7z.sfx ../$(INSTALLDIR)-win32-7z.exe $(INSTALLDIR)/
1088
	chmod 644 ../$(INSTALLDIR)-win32-7z.exe # 7zip is evil
1089
	$(MAKE) clean INSTALLDIR=$(INSTALLDIR) MAKEFILE_CONF=cross-Makefile.conf RADIANT_ABOUTMSG="Official release build" BUILD=release
1090

Rudolf Polzer's avatar
Rudolf Polzer committed
1091
release-all:
1092
	$(GIT) clean -xdf
Rudolf Polzer's avatar
Rudolf Polzer committed
1093 1094 1095
	$(MAKE) release-src
	$(MAKE) release-win32

Rudolf Polzer's avatar
Rudolf Polzer committed
1096
# load dependency files
rpolzer's avatar
rpolzer committed
1097
-include $(shell find . -name \*.d)