r4305 initial revision
[racktables] / Makefile
1 DESTDIR ?=
2 prefix ?= /usr/local
3
4 docdir ?= $(prefix)/share/doc/racktables
5 datadir ?= $(prefix)/share/racktables
6 staticdir ?= $(datadir)/static
7 codedir ?= $(datadir)/code
8
9 INSTALL := install
10 INSTALL_DATA := $(INSTALL) -m 644
11 INSTALL_DIR := $(INSTALL) -m 755 -d
12 INSTALL_PROGRAM := $(INSTALL) -m 755
13
14 install-docs: COPYING ChangeLog LICENSE README
15 $(INSTALL_DIR) $(DESTDIR)$(docdir)
16 $(INSTALL_DATA) $^ $(DESTDIR)$(docdir)
17
18 install-helpers: scripts gateways
19 $(INSTALL_DIR) $(DESTDIR)$(datadir)
20 cp -r $^ $(DESTDIR)$(datadir)
21 find $(DESTDIR)$(datadir)/scripts -type d -a -name '.svn' -exec rm -rf \{\} \; -prune
22 find $(DESTDIR)$(datadir)/gateways -type d -a -name '.svn' -exec rm -rf \{\} \; -prune
23
24 install-static: wwwroot/css wwwroot/js wwwroot/pix
25 $(INSTALL_DIR) $(DESTDIR)$(staticdir)
26 cp -r $^ $(DESTDIR)$(staticdir)
27 find $(DESTDIR)$(staticdir) -type d -a -name '.svn' -exec rm -rf \{\} \; -prune
28
29 install-code: wwwroot/inc wwwroot/favicon.ico wwwroot/index.php
30 $(INSTALL_DIR) $(DESTDIR)$(codedir)/inc
31 $(INSTALL_DATA) wwwroot/favicon.ico wwwroot/index.php $(DESTDIR)$(codedir)
32 $(INSTALL_DATA) wwwroot/inc/*.php $(DESTDIR)$(codedir)/inc
33
34 install: install-helpers install-static install-code