chiark / gitweb /
@@ -1,3 +1,11 @@
[chiark-utils.git] / backup / Makefile
1 # Makefile
2 # simple make settings
3 #
4 # This file is part of chiark backup, a system for backing up GNU/Linux and
5 # other UN*X-compatible machines, as used on chiark.greenend.org.uk.
6 #
7 # chiark backup is:
8 #  Copyright (C) 1997-1998,2000-2001 Ian Jackson <ian@chiark.greenend.org.uk>
9 #  Copyright (C) 1999 Peter Maydell <pmaydell@chiark.greenend.org.uk>
10 #
11 # This is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2, or (at your option) any later version.
14 #
15 # This is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
18 # details.
19 #
20 # You should have received a copy of the GNU General Public License along
21 # with this program; if not, write to the Free Software Foundation, Inc.,
22 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24 SYSTEM_GROUP=   root
25
26 prefix=/usr/local
27 etcdir=/etc
28 varlib=/var/lib
29
30 confdir=$(etcdir)/chiark-backup
31 bindir=$(prefix)/bin
32 sharedir=$(prefix)/share/chiark-backup
33 txtdocdir=$(prefix)/share/doc/chiark-backup
34 exampledir=$(txtdocdir)/examples
35 vardir=$(varlib)/chiark-backup
36 mandir=${prefix}/man
37 man1dir=${mandir}/man1
38
39 INSTALL=                install -c
40 INSTALL_SHARE=          $(INSTALL) -m 644 -o root -g $(SYSTEM_GROUP)
41 INSTALL_SCRIPT=         $(INSTALL) -m 755 -o root -g $(SYSTEM_GROUP)
42 INSTALL_PROGRAM=        $(INSTALL_SCRIPT) -s
43 INSTALL_DIRECTORY=      $(INSTALL) -m 2755 -o root -g $(SYSTEM_GROUP) -d
44
45 BINSCRIPTS=     checkallused loaded driver takedown whatsthis labeltape
46 SHARESCRIPTS=   bringup full increm
47 SHAREFILES=     backuplib.pl
48
49 EXAMPLES=       relativity chiark
50
51 all:
52
53 install:                all
54                 $(INSTALL_DIRECTORY) $(confdir) $(bindir) $(sharedir) $(vardir) $(man1dir)
55                 set -e; for s in $(BINSCRIPTS); do \
56                         $(INSTALL_SCRIPT) $$s $(bindir)/backup-$$s; done
57                 $(INSTALL_SHARE) $(SHAREFILES) $(sharedir)
58                 $(INSTALL_SCRIPT) $(SHARESCRIPTS) $(sharedir)
59
60 install-docs:
61                 $(INSTALL_DIRECTORY) $(txtdocdir)
62                 $(INSTALL_SHARE) iwjbackup.txt $(txtdocdir)/README
63
64 install-examples:
65                 set -e; for e in $(EXAMPLES); do \
66                         cd examples/$$e; \
67                         $(INSTALL_DIRECTORY) $(exampledir)/$$e; \
68                         $(INSTALL_SHARE) [^A-Z]*[^~] $(exampledir)/$$e; \
69                         if test -f SYMLINKS.tar; then \
70                                 exec <SYMLINKS.tar; \
71                                 (set -e; cd $(exampledir) && tar -xf -); \
72                         fi; \
73                         cd ../..; \
74                 done
75
76 clean:
77                 rm -f *~ ./#*# *.o
78
79 distclean realclean:    clean