2 BINDIR ?= $(PREFIX)/bin
3 LIBDIR ?= $(PREFIX)/lib/xonotic
4 DOCDIR ?= $(PREFIX)/share/doc/xonotic
7 ARCH ?= $(shell if [ x"`uname -m`" = x"x86_64" ]; then echo linux64; else echo linux32; fi)
11 SUFFIX ?= $(shell if [ -d .git ]; then echo git; elif [ x"$(BINARY)" = x"yes" ]; then echo zip-binary; else echo zip-source; fi)
21 .PHONY: all-zip-binary
25 .PHONY: all-zip-source
27 $(MAKE) -C source/fteqcc
28 $(MAKE) -C source/qcsrc FTEQCC=$(CURDIR)/source/fteqcc/fteqcc.bin
29 $(MAKE) -C source/darkplaces sv-release
30 $(MAKE) -C source/darkplaces cl-release
31 $(MAKE) -C source/darkplaces sdl-release
35 clean: clean-$(SUFFIX)
47 @echo Sorry, this is not implemented yet
52 install-data: install-data-$(SUFFIX)
54 .PHONY: install-data-git
55 install-data-git: all-git
56 $(RM) -rf $(LIBDIR)/data
57 $(INSTALL) -d $(LIBDIR)/data
58 for p in data/*.pk3; do $(INSTALL) $$p $(LIBDIR)/$$p || exit 1; done
59 for p in data/*.pk3dir; do ( cd $$p; $(ZIP) -r $(LIBDIR)/$${p%dir} * ) || exit 1; done
61 .PHONY: install-data-zip-binary
62 install-data-zip-binary: all-zip-binary
63 $(RM) -rf $(LIBDIR)/data
64 $(INSTALL) -d $(LIBDIR)/data
65 for p in data/*.pk3; do $(INSTALL) $$p $(LIBDIR)/$$p || exit 1; done
67 .PHONY: install-data-zip-source
68 install-data-zip-source: all-zip-source
69 $(RM) -rf $(LIBDIR)/data
70 $(INSTALL) -d $(LIBDIR)/data
71 for p in data/*.pk3; do $(INSTALL) $$p $(LIBDIR)/$$p || exit 1; done
72 for p in data/xonotic-*-data*.pk3; do cd source; $(ZIP) $(LIBDIR)/$$p progs.dat menu.dat csprogs.dat; done
75 .PHONY: install-engine
76 install-engine: install-engine-$(SUFFIX)
78 .PHONY: install-engine-git
79 install-engine-git: all-git
80 $(INSTALL) -d $(LIBDIR)
81 $(INSTALL) xonotic-linux-glx.sh $(LIBDIR)/xonotic-linux-glx.sh
82 $(INSTALL) xonotic-linux-sdl.sh $(LIBDIR)/xonotic-linux-sdl.sh
83 $(INSTALL) xonotic-linux-dedicated.sh $(LIBDIR)/xonotic-linux-dedicated.sh
84 $(INSTALL) darkplaces/darkplaces-sdl $(LIBDIR)/xonotic-$(ARCH)-sdl
85 $(INSTALL) darkplaces/darkplaces-glx $(LIBDIR)/xonotic-$(ARCH)-glx
86 $(INSTALL) darkplaces/darkplaces-dedicated $(LIBDIR)/xonotic-$(ARCH)-dedicated
88 .PHONY: install-engine-zip-binary
89 install-engine-zip: all-zip
90 $(INSTALL) -d $(LIBDIR)
91 $(INSTALL) xonotic-linux-glx.sh $(LIBDIR)/xonotic-linux-glx.sh
92 $(INSTALL) xonotic-linux-sdl.sh $(LIBDIR)/xonotic-linux-sdl.sh
93 $(INSTALL) xonotic-linux-dedicated.sh $(LIBDIR)/xonotic-linux-dedicated.sh
94 $(INSTALL) xonotic-$(ARCH)-sdl $(LIBDIR)/xonotic-$(ARCH)-sdl
95 $(INSTALL) xonotic-$(ARCH)-glx $(LIBDIR)/xonotic-$(ARCH)-glx
96 $(INSTALL) xonotic-$(ARCH)-dedicated $(LIBDIR)/xonotic-$(ARCH)-dedicated
98 .PHONY: install-engine-zip-source
99 install-engine-zip: all-zip
100 $(INSTALL) -d $(LIBDIR)
101 $(INSTALL) xonotic-linux-glx.sh $(LIBDIR)/xonotic-linux-glx.sh
102 $(INSTALL) xonotic-linux-sdl.sh $(LIBDIR)/xonotic-linux-sdl.sh
103 $(INSTALL) xonotic-linux-dedicated.sh $(LIBDIR)/xonotic-linux-dedicated.sh
104 $(INSTALL) source/darkplaces/xonotic-sdl $(LIBDIR)/xonotic-$(ARCH)-sdl
105 $(INSTALL) source/darkplaces/darkplaces-sdl $(LIBDIR)/xonotic-$(ARCH)-glx
106 $(INSTALL) source/darkplaces/darkplaces-dedicated $(LIBDIR)/xonotic-$(ARCH)-dedicated
109 .PHONY: install-links
111 $(INSTALL) -d $(BINDIR)
112 $(LN) -snf $(LIBDIR)/xonotic-linux-sdl.sh $(BINDIR)/xonotic-sdl
113 $(LN) -snf $(LIBDIR)/xonotic-linux-glx.sh $(BINDIR)/xonotic-glx
114 $(LN) -snf $(LIBDIR)/xonotic-linux-dedicated.sh $(BINDIR)/xonotic-dedicated
119 $(INSTALL) -d $(DOCDIR)/server
120 $(CP) -R Docs/* $(DOCDIR)/
121 $(CP) -R server/* $(DOCDIR)/server
125 install: install-data install-engine install-links install-doc