3 BINDIR ?= $(PREFIX)/bin
4 LIBDIR ?= $(PREFIX)/lib/xonotic
5 DOCDIR ?= $(PREFIX)/share/doc/xonotic
8 ARCH ?= $(shell if [ x"`uname -m`" = x"x86_64" ]; then echo linux64; else echo linux32; fi)
12 SUFFIX ?= $(shell if [ -d .git ]; then echo git; elif [ x"$(BINARY)" = x"yes" ]; then echo zip-binary; else echo zip-source; fi)
13 RIJNDAELDETECT_CONFIGURE ?= $(shell if ! [ -f source/d0_blind_id/d0_rijndael.c ]; then echo --disable-rijndael; fi)
14 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)
24 .PHONY: all-zip-binary
28 .PHONY: all-zip-source
30 ( cd source/d0_blind_id && ./configure --enable-static --disable-shared $(RIJNDAELDETECT_CONFIGURE) )
31 $(MAKE) -C source/d0_blind_id
32 $(MAKE) -C source/gmqcc
33 $(MAKE) -C source/qcsrc FTEQCC=$(CURDIR)/source/gmqcc/gmqcc
34 $(MAKE) -C source/darkplaces sv-release DP_CRYPTO_STATIC_LIBDIR=$(CURDIR)/source/d0_blind_id/.libs
35 $(MAKE) -C source/darkplaces cl-release DP_CRYPTO_STATIC_LIBDIR=$(CURDIR)/source/d0_blind_id/.libs
36 $(MAKE) -C source/darkplaces sdl-release DP_CRYPTO_STATIC_LIBDIR=$(CURDIR)/source/d0_blind_id/.libs
40 clean: clean-$(SUFFIX)
52 -$(MAKE) -C source/d0_blind_id distclean
53 $(MAKE) -C source/gmqcc clean
54 $(MAKE) -C source/qcsrc clean
55 $(MAKE) -C source/darkplaces clean
59 install-data: install-data-$(SUFFIX)
61 .PHONY: install-data-git
62 install-data-git: all-git
63 $(RM) -rf $(DESTDIR)$(LIBDIR)/data
64 $(INSTALL) -d $(DESTDIR)$(LIBDIR)/data
65 for p in data/*.pk3; do $(INSTALL) $$p $(DESTDIR)$(LIBDIR)/$$p || exit 1; done
66 for p in data/*.pk3dir; do ( cd $$p && $(ZIP) -r $(DESTDIR)$(LIBDIR)/$${p%dir} * ) || exit 1; done
68 .PHONY: install-data-zip-binary
69 install-data-zip-binary: all-zip-binary
70 $(RM) -rf $(DESTDIR)$(LIBDIR)/data
71 $(INSTALL) -d $(DESTDIR)$(LIBDIR)/data
72 for p in data/*.pk3; do $(INSTALL) $$p $(DESTDIR)$(LIBDIR)/$$p || exit 1; done
74 .PHONY: install-data-zip-source
75 install-data-zip-source: all-zip-source
76 $(RM) -rf $(DESTDIR)$(LIBDIR)/data
77 $(INSTALL) -d $(DESTDIR)$(LIBDIR)/data
78 for p in data/*.pk3; do $(INSTALL) $$p $(DESTDIR)$(LIBDIR)/$$p || exit 1; done
79 for p in data/xonotic-*-data*.pk3; do cd source && $(ZIP) $(DESTDIR)$(LIBDIR)/$$p progs.dat menu.dat csprogs.dat; done
82 .PHONY: install-engine
83 install-engine: install-engine-$(SUFFIX)
85 .PHONY: install-engine-git
86 install-engine-git: all-git
87 $(INSTALL) -d $(DESTDIR)$(LIBDIR)
88 $(INSTALL) xonotic-linux-glx.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-glx.sh
89 $(INSTALL) xonotic-linux-sdl.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-sdl.sh
90 $(INSTALL) xonotic-linux-dedicated.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-dedicated.sh
91 $(INSTALL) darkplaces/darkplaces-sdl $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-sdl
92 $(INSTALL) darkplaces/darkplaces-glx $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-glx
93 $(INSTALL) darkplaces/darkplaces-dedicated $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-dedicated
95 .PHONY: install-engine-zip-binary
96 install-engine-zip-binary: all-zip-binary
97 $(INSTALL) -d $(DESTDIR)$(LIBDIR)
98 $(INSTALL) xonotic-linux-glx.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-glx.sh
99 $(INSTALL) xonotic-linux-sdl.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-sdl.sh
100 $(INSTALL) xonotic-linux-dedicated.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-dedicated.sh
101 $(INSTALL) xonotic-$(ARCH)-sdl $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-sdl
102 $(INSTALL) xonotic-$(ARCH)-glx $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-glx
103 $(INSTALL) xonotic-$(ARCH)-dedicated $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-dedicated
105 .PHONY: install-engine-zip-source
106 install-engine-zip-source: all-zip-source
107 $(INSTALL) -d $(DESTDIR)$(LIBDIR)
108 $(INSTALL) xonotic-linux-glx.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-glx.sh
109 $(INSTALL) xonotic-linux-sdl.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-sdl.sh
110 $(INSTALL) xonotic-linux-dedicated.sh $(DESTDIR)$(LIBDIR)/xonotic-linux-dedicated.sh
111 $(INSTALL) source/darkplaces/darkplaces-sdl $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-sdl
112 $(INSTALL) source/darkplaces/darkplaces-glx $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-glx
113 $(INSTALL) source/darkplaces/darkplaces-dedicated $(DESTDIR)$(LIBDIR)/xonotic-$(ARCH)-dedicated
116 .PHONY: install-links
118 $(INSTALL) -d $(BINDIR)
119 $(LN) -snf $(LIBDIR)/xonotic-linux-sdl.sh $(DESTDIR)$(BINDIR)/xonotic-sdl
120 $(LN) -snf $(LIBDIR)/xonotic-linux-glx.sh $(DESTDIR)$(BINDIR)/xonotic-glx
121 $(LN) -snf $(LIBDIR)/xonotic-linux-dedicated.sh $(DESTDIR)$(BINDIR)/xonotic-dedicated
126 $(INSTALL) -d $(DESTDIR)$(DOCDIR)/server
127 $(CP) -R Docs/* $(DESTDIR)$(DOCDIR)/
128 $(CP) -R server/* $(DESTDIR)$(DOCDIR)/server
132 install: install-data install-engine install-links install-doc