Commit | Line | Data |
---|---|---|
e31d92d6 DO |
1 | DESTDIR ?= |
2 | prefix ?= /usr/local | |
3 | docdir ?= $(prefix)/share/doc/RackTables | |
abc915d4 | 4 | datadir ?= $(prefix)/share |
971a2366 DO |
5 | # Default values reproduce the layout present in tar.gz, which concurs with |
6 | # the default values of $racktables_gwdir and $racktables_staticdir. But | |
7 | # once the latter are patched for a shared deploy, it is enough to execute | |
8 | # "make install" with appropriate arguments to split the filesystem. | |
9 | staticdir ?= $(datadir)/RackTables/wwwroot | |
10 | codedir ?= $(datadir)/RackTables/wwwroot | |
e31d92d6 | 11 | scriptdir ?= $(datadir)/RackTables |
cf7f9a86 DO |
12 | |
13 | INSTALL := install | |
14 | INSTALL_DATA := $(INSTALL) -m 644 | |
15 | INSTALL_DIR := $(INSTALL) -m 755 -d | |
16 | INSTALL_PROGRAM := $(INSTALL) -m 755 | |
17 | ||
18 | install-docs: COPYING ChangeLog LICENSE README | |
19 | $(INSTALL_DIR) $(DESTDIR)$(docdir) | |
20 | $(INSTALL_DATA) $^ $(DESTDIR)$(docdir) | |
21 | ||
22 | install-helpers: scripts gateways | |
abc915d4 DO |
23 | $(INSTALL_DIR) $(DESTDIR)$(scriptdir) |
24 | cp -r $^ $(DESTDIR)$(scriptdir) | |
25 | find $(DESTDIR)$(scriptdir)/scripts -type d -a -name '.svn' -exec rm -rf \{\} \; -prune | |
26 | find $(DESTDIR)$(scriptdir)/gateways -type d -a -name '.svn' -exec rm -rf \{\} \; -prune | |
cf7f9a86 DO |
27 | |
28 | install-static: wwwroot/css wwwroot/js wwwroot/pix | |
29 | $(INSTALL_DIR) $(DESTDIR)$(staticdir) | |
30 | cp -r $^ $(DESTDIR)$(staticdir) | |
31 | find $(DESTDIR)$(staticdir) -type d -a -name '.svn' -exec rm -rf \{\} \; -prune | |
32 | ||
33 | install-code: wwwroot/inc wwwroot/favicon.ico wwwroot/index.php | |
34 | $(INSTALL_DIR) $(DESTDIR)$(codedir)/inc | |
35 | $(INSTALL_DATA) wwwroot/favicon.ico wwwroot/index.php $(DESTDIR)$(codedir) | |
36 | $(INSTALL_DATA) wwwroot/inc/*.php $(DESTDIR)$(codedir)/inc | |
37 | ||
38 | install: install-helpers install-static install-code |