]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - Makefile
-install.py
[xonotic/netradiant.git] / Makefile
index 1ad371d8ae5ad56698f434173059886d4a7deb94..bcb5b31d32cb4ccec4acb0e11452bcfb465bff88 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,11 +9,16 @@ A = a
 DLL = so
 NETAPI = berkley
 
+RADIANT_ABOUTMSG = Custom build
+
 LDD ?= ldd
 FIND ?= find
 RANLIB ?= ranlib
 AR ?= ar
 MKDIR ?= mkdir -p
+CP ?= cp
+CP_R ?= $(CP) -r
+RM_R ?= $(RM) -r
 
 TEE_STDERR ?= | tee /dev/stderr
 
@@ -48,6 +53,7 @@ LDFLAGS := $(LDFLAGS_COMMON)
 
 .PHONY: all
 all: \
+       makeversion \
        install/q3map2.$(EXE) \
        install/q3data.$(EXE) \
        install/radiant.$(EXE) \
@@ -60,6 +66,7 @@ all: \
        install/modules/model.$(DLL) \
        install/modules/shaders.$(DLL) \
        install/modules/vfspk3.$(DLL) \
+       install-data \
 
 .PHONY: clean
 clean:
@@ -445,3 +452,36 @@ install/modules/vfspk3.$(DLL): \
        plugins/vfspk3/vfs.o \
        plugins/vfspk3/vfspk3.o \
 
+.PHONY: makeversion
+makeversion:
+       set -ex; \
+       ver=`cat include/version.default`; \
+       major=`echo $$ver | cut -d . -f 2`; \
+       minor=`echo $$ver | cut -d . -f 3 | cut -d - -f 1`; \
+       echo "// generated header, see Makefile" > include/version.h; \
+       echo "#define RADIANT_VERSION \"$$ver\"" >> include/version.h; \
+       echo "#define RADIANT_MAJOR_VERSION \"$$major\"" >> include/version.h; \
+       echo "#define RADIANT_MINOR_VERSION \"$$minor\"" >> include/version.h; \
+       echo "$$major" > include/RADIANT_MAJOR; \
+       echo "$$minor" > include/RADIANT_MINOR; \
+       echo "$$ver" > include/version; \
+       echo "// generated header, see Makefile" > include/aboutmsg.h; \
+       echo "#define RADIANT_ABOUTMSG \"$(RADIANT_ABOUTMSG)\"" >> include/aboutmsg.h; \
+
+.PHONY: install-data
+install-data:
+       set -ex; \
+       for GAME in games/*; do \
+               for GAMEFILE in $$GAME/games/*.game; do \
+                       $(MKDIR) install/games; \
+                       $(CP) "$$GAMEFILE" install/games/; \
+               done; \
+               for GAMEDIR in $$GAME/*.game; do \
+                       $(MKDIR) install; \
+                       $(CP_R) "$$GAMEDIR" install/; \
+               done; \
+       done
+       $(CP) include/RADIANT_MAJOR install/
+       $(CP) include/RADIANT_MINOR install/
+       $(CP_R) setup/data/tools/* install/
+       $(FIND) install/ -name .svn -exec $(RM_R) {} \; -prune; \