]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - Makefile
support misc_*model as misc_model in the radiant editor (way more convenient)
[xonotic/netradiant.git] / Makefile
index 17e2b6634558cfe0b7f49dfa1a739bcfba303913..5cdeee6947a9c0aef605e7baa4bd568f56421ca7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -44,9 +44,11 @@ TR                 ?= tr
 FIND               ?= find
 DIFF               ?= diff
 SED                ?= sed
-
-# optional:
-SVNVERSION         ?= svnversion
+GIT                ?= git
+SVN                ?= svn
+WGET               ?= wget
+MV                 ?= mv
+UNZIP              ?= unzip
 
 STDOUT_TO_DEVNULL  ?= >/dev/null
 STDERR_TO_DEVNULL  ?= 2>/dev/null
@@ -75,6 +77,8 @@ LIBS_DL            ?= -ldl # nothing on Win32
 CPPFLAGS_ZLIB      ?=
 LIBS_ZLIB          ?= -lz
 DEPEND_ON_MAKEFILE ?= yes
+DOWNLOAD_GAMEPACKS ?= yes
+# set to no to disable gamepack, set to all to even download undistributable gamepacks
 DEPENDENCIES_CHECK ?= quiet
 # or: off, verbose
 
@@ -221,10 +225,10 @@ Q3MAP_VERSION = 2.5.17n
 # Executable extension
 RADIANT_EXECUTABLE := $(EXE)
 
-SVN_VERSION := $(shell $(SVNVERSION) -n $(STDERR_TO_DEVNULL) | $(SED) 's/M$$//g; s/.*://g;')
-ifneq ($(SVN_VERSION),)
-       RADIANT_VERSION := $(RADIANT_VERSION)-svn$(SVN_VERSION)
-       Q3MAP_VERSION := $(Q3MAP_VERSION)-svn$(SVN_VERSION)
+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)
 endif
 
 CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\""
@@ -268,6 +272,7 @@ dependencies-check:
        checkbinary coreutils "$(CP_R)"; \
        checkbinary coreutils "$(RM)"; \
        checkbinary coreutils "$(RM_R)"; \
+       checkbinary coreutils "$(MV)"; \
        checkbinary coreutils "$(ECHO) test $(TEE_STDERR)"; \
        checkbinary sed "$(SED)"; \
        checkbinary findutils "$(FIND)"; \
@@ -277,6 +282,10 @@ dependencies-check:
        checkbinary binutils "$(RANLIB)"; \
        checkbinary binutils "$(AR)"; \
        checkbinary pkg-config "$(PKGCONFIG)"; \
+       checkbinary unzip "$(UNZIP)"; \
+       checkbinary git-core "$(GIT)"; \
+       checkbinary subversion "$(SVN)"; \
+       checkbinary wget "$(WGET)"; \
        [ "$(OS)" = "Win32" ] && checkbinary mingw32 "$(WINDRES)"; \
        [ -n "$(LDD)" ] && checkbinary libc6 "$(LDD)"; \
        [ -n "$(OTOOL)" ] && checkbinary xcode "$(OTOOL)"; \
@@ -910,12 +919,12 @@ $(INSTALLDIR)/plugins/ufoaiplug.$(DLL): \
        contrib/ufoaiplug/ufoai_level.o \
        contrib/ufoaiplug/ufoai.o \
 
-#$(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 \
+$(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 \
 
 $(INSTALLDIR)/heretic2/h2data.$(EXE): LIBS_EXTRA := $(LIBS_XML)
 $(INSTALLDIR)/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
@@ -958,18 +967,7 @@ install-data: binaries
        $(MKDIR) $(INSTALLDIR)/games
        $(FIND) $(INSTALLDIR_BASE)/ -name .svn -exec $(RM_R) {} \; -prune
        [ "$(OS)" != "Darwin" ] || $(CP_R) setup/data/osx/NetRadiant.app/* $(INSTALLDIR_BASE)/NetRadiant.app/
-       set -ex; \
-       for GAME in games/*; do \
-               if [ -d "$$GAME/tools" ]; then \
-                       GAME=$$GAME/tools; \
-               fi; \
-               for GAMEFILE in $$GAME/games/*.game; do \
-                       $(CP) "$$GAMEFILE" $(INSTALLDIR)/games/; \
-               done; \
-               for GAMEDIR in $$GAME/*.game; do \
-                       $(CP_R) "$$GAMEDIR" $(INSTALLDIR)/; \
-               done; \
-       done
+       DOWNLOAD_GAMEPACKS="$(DOWNLOAD_GAMEPACKS)" GIT="$(GIT)" SVN="$(SVN)" WGET="$(WGET)" RM_R="$(RM_R)" MV="$(MV)" UNZIP="$(UNZIP)" ECHO="$(ECHO)" SH="$(SH)" CP="$(CP)" CP_R="$(CP_R)" $(SH) install-gamepacks.sh "$(INSTALLDIR)"
        $(ECHO) $(RADIANT_MINOR_VERSION) > $(INSTALLDIR)/RADIANT_MINOR
        $(ECHO) $(RADIANT_MAJOR_VERSION) > $(INSTALLDIR)/RADIANT_MAJOR
        $(CP_R) setup/data/tools/* $(INSTALLDIR)/