xonotic/Makefile

133 lines
4.9 KiB
Makefile
Raw Normal View History

2012-04-21 13:52:28 +00:00
DESTDIR ?=
2011-10-29 18:41:11 +00:00
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib/xonotic
DOCDIR ?= $(PREFIX)/share/doc/xonotic
ZIP ?= zip -9
INSTALL ?= install
ARCH ?= $(shell if [ x"`uname -m`" = x"x86_64" ]; then echo linux64; else echo linux32; fi)
LN ?= ln
CP ?= cp
2012-04-21 13:26:10 +00:00
BINARY ?= yes
SUFFIX ?= $(shell if [ -d .git ]; then echo git; elif [ x"$(BINARY)" = x"yes" ]; then echo zip-binary; else echo zip-source; fi)
2012-04-21 13:36:20 +00:00
RIJNDAELDETECT_CONFIGURE ?= $(shell if ! [ -f source/d0_blind_id/d0_rijndael.c ]; then echo --disable-rijndael; fi)
RIJNDAELDETECT_MAKE_DP ?= $(shell if [ -f source/d0_blind_id/d0_rijndael.c ]; then echo DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=$(CURDIR)/source/d0_blind_id/.libs; fi)
2011-10-29 18:41:11 +00:00
2011-10-29 18:58:18 +00:00
2011-10-29 18:41:11 +00:00
.PHONY: all
2011-10-29 18:58:18 +00:00
all: all-$(SUFFIX)
.PHONY: all-git
all-git:
2011-10-29 18:41:11 +00:00
./all compile -r
2012-04-21 13:26:10 +00:00
.PHONY: all-zip-binary
all-zip-binary:
@echo Nothing to do
.PHONY: all-zip-source
all-zip-source:
2012-04-21 13:36:20 +00:00
( cd source/d0_blind_id && ./configure --enable-static --disable-shared $(RIJNDAELDETECT_CONFIGURE) )
$(MAKE) -C source/d0_blind_id
2013-05-06 14:15:06 +00:00
$(MAKE) -C source/gmqcc
$(MAKE) -C source/qcsrc FTEQCC=$(CURDIR)/source/gmqcc/gmqcc
2012-04-21 13:36:20 +00:00
$(MAKE) -C source/darkplaces sv-release DP_CRYPTO_STATIC_LIBDIR=$(CURDIR)/source/d0_blind_id/.libs
$(MAKE) -C source/darkplaces cl-release DP_CRYPTO_STATIC_LIBDIR=$(CURDIR)/source/d0_blind_id/.libs
$(MAKE) -C source/darkplaces sdl-release DP_CRYPTO_STATIC_LIBDIR=$(CURDIR)/source/d0_blind_id/.libs
2011-10-29 18:58:18 +00:00
2011-10-29 18:41:11 +00:00
.PHONY: clean
2011-10-29 18:58:18 +00:00
clean: clean-$(SUFFIX)
.PHONY: clean-git
clean-git:
2011-10-29 18:42:59 +00:00
./all clean
2011-10-29 18:41:11 +00:00
2011-10-29 18:58:18 +00:00
.PHONY: clean-zip
2012-04-21 13:36:20 +00:00
clean-zip-binary:
2012-04-21 13:26:10 +00:00
@echo Nothing to do
.PHONY: clean-zip
2012-04-21 13:36:20 +00:00
clean-zip-source:
-$(MAKE) -C source/d0_blind_id distclean
2013-05-06 14:15:06 +00:00
$(MAKE) -C source/gmqcc clean
2012-04-21 13:36:20 +00:00
$(MAKE) -C source/qcsrc clean
$(MAKE) -C source/darkplaces clean
2011-10-29 18:58:18 +00:00
.PHONY: install-data
install-data: install-data-$(SUFFIX)
2011-10-29 18:41:11 +00:00
.PHONY: install-data-git
2012-04-21 13:26:10 +00:00
install-data-git: all-git
2012-04-21 13:52:28 +00:00
$(RM) -rf $(DESTDIR)$(LIBDIR)/data
$(INSTALL) -d $(DESTDIR)$(LIBDIR)/data
for p in data/*.pk3; do $(INSTALL) $$p $(DESTDIR)$(LIBDIR)/$$p || exit 1; done
2012-04-21 13:54:17 +00:00
for p in data/*.pk3dir; do ( cd $$p && $(ZIP) -r $(DESTDIR)$(LIBDIR)/$${p%dir} * ) || exit 1; done
2011-10-29 18:41:11 +00:00
2012-04-21 13:26:10 +00:00
.PHONY: install-data-zip-binary
install-data-zip-binary: all-zip-binary
2012-04-21 13:52:28 +00:00
$(RM) -rf $(DESTDIR)$(LIBDIR)/data
$(INSTALL) -d $(DESTDIR)$(LIBDIR)/data
for p in data/*.pk3; do $(INSTALL) $$p $(DESTDIR)$(LIBDIR)/$$p || exit 1; done
2012-04-21 13:26:10 +00:00
.PHONY: install-data-zip-source
install-data-zip-source: all-zip-source
2012-04-21 13:52:28 +00:00
$(RM) -rf $(DESTDIR)$(LIBDIR)/data
$(INSTALL) -d $(DESTDIR)$(LIBDIR)/data
for p in data/*.pk3; do $(INSTALL) $$p $(DESTDIR)$(LIBDIR)/$$p || exit 1; done
2012-04-21 13:54:17 +00:00
for p in data/xonotic-*-data*.pk3; do cd source && $(ZIP) $(DESTDIR)$(LIBDIR)/$$p progs.dat menu.dat csprogs.dat; done
2011-10-29 18:41:11 +00:00
2011-10-29 18:58:18 +00:00
.PHONY: install-engine
install-engine: install-engine-$(SUFFIX)
2011-10-29 18:41:11 +00:00
.PHONY: install-engine-git
2012-04-21 13:26:10 +00:00
install-engine-git: all-git
2012-04-21 13:52:28 +00:00
$(INSTALL) -d $(DESTDIR)$(LIBDIR)
$(INSTALL) xonotic-linux-glx.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-glx.sh
$(INSTALL) xonotic-linux-sdl.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-sdl.sh
$(INSTALL) xonotic-linux-dedicated.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-dedicated.sh
$(INSTALL) darkplaces/darkplaces-sdl $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-sdl
$(INSTALL) darkplaces/darkplaces-glx $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-glx
$(INSTALL) darkplaces/darkplaces-dedicated $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-dedicated
2011-10-29 18:41:11 +00:00
2012-04-21 13:26:10 +00:00
.PHONY: install-engine-zip-binary
2012-04-21 13:36:20 +00:00
install-engine-zip-binary: all-zip-binary
2012-04-21 13:52:28 +00:00
$(INSTALL) -d $(DESTDIR)$(LIBDIR)
$(INSTALL) xonotic-linux-glx.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-glx.sh
$(INSTALL) xonotic-linux-sdl.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-sdl.sh
$(INSTALL) xonotic-linux-dedicated.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-dedicated.sh
$(INSTALL) xonotic-$(ARCH)-sdl $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-sdl
$(INSTALL) xonotic-$(ARCH)-glx $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-glx
$(INSTALL) xonotic-$(ARCH)-dedicated $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-dedicated
2011-10-29 18:41:11 +00:00
2012-04-21 13:26:10 +00:00
.PHONY: install-engine-zip-source
2012-04-21 13:36:20 +00:00
install-engine-zip-source: all-zip-source
2012-04-21 13:52:28 +00:00
$(INSTALL) -d $(DESTDIR)$(LIBDIR)
$(INSTALL) xonotic-linux-glx.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-glx.sh
$(INSTALL) xonotic-linux-sdl.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-sdl.sh
$(INSTALL) xonotic-linux-dedicated.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-dedicated.sh
$(INSTALL) source/darkplaces/darkplaces-sdl $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-sdl
$(INSTALL) source/darkplaces/darkplaces-glx $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-glx
$(INSTALL) source/darkplaces/darkplaces-dedicated $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-dedicated
2012-04-21 13:26:10 +00:00
2011-10-29 18:41:11 +00:00
.PHONY: install-links
2011-10-29 18:58:18 +00:00
install-links:
2011-10-29 18:41:11 +00:00
$(INSTALL) -d $(BINDIR)
2012-04-21 13:52:28 +00:00
$(LN) -snf $(LIBDIR)/xonotic-linux-sdl.sh $(DESTDIR)$(BINDIR)/xonotic-sdl
$(LN) -snf $(LIBDIR)/xonotic-linux-glx.sh $(DESTDIR)$(BINDIR)/xonotic-glx
$(LN) -snf $(LIBDIR)/xonotic-linux-dedicated.sh $(DESTDIR)$(BINDIR)/xonotic-dedicated
2011-10-29 18:41:11 +00:00
2011-10-29 18:58:18 +00:00
2011-10-29 18:41:11 +00:00
.PHONY: install-doc
install-doc:
2012-04-21 13:52:28 +00:00
$(INSTALL) -d $(DESTDIR)$(DOCDIR)/server
$(CP) -R Docs/* $(DESTDIR)$(DOCDIR)/
$(CP) -R server/* $(DESTDIR)$(DOCDIR)/server
2011-10-29 18:41:11 +00:00
2011-10-29 18:58:18 +00:00
2011-10-29 18:41:11 +00:00
.PHONY: install
install: install-data install-engine install-links install-doc