chiark / gitweb /
Now actually builds some packages. No idea if they work.
[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 CC=             gcc
25 CFLAGS=         $(WARNINGS) $(OPTIMISE) $(DEBUG)
26 CPPFLAGS=       -DRWBUFFER_SIZE_MB=$(RWBUFFER_SIZE_MB)
27
28 WARNINGS=       -Wall -Wwrite-strings -Wmissing-prototypes \
29                 -Wstrict-prototypes -Wpointer-arith
30 OPTIMISE=       -O2
31 DEBUG=          -g
32 RWBUFFER_SIZE_MB=16
33
34 prefix=/usr/local
35 etcdir=/etc/chiark-backup
36 bindir=$(prefix)/bin
37 sharedir=$(prefix)/share/chiark-backup
38
39 INSTALL=                install -c
40 INSTALL_SHARE=          $(INSTALL) -m 644 -o root -g root
41 INSTALL_SCRIPT=         $(INSTALL) -m 755 -o root -g root
42 INSTALL_PROGRAM=        $(INSTALL_SCRIPT) -s
43 INSTALL_DIRECTORY=      $(INSTALL) -m 2755 -o root -g root -d
44
45 CTARGETS=       readbuffer writebuffer
46 BINSCRIPTS=     checkallused loaded driver takedown whatsthis
47 SHARESCRIPTS=   bringup full increm
48 SHAREFILES=     backuplib.pl
49
50 all:            $(CTARGETS)
51
52 install:                all
53                 $(INSTALL_DIRECTORY) $(etcdir) $(bindir) $(sharedir)
54                 $(INSTALL_PROGRAM) $(CTARGETS) $(bindir)
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 clean:
61                 rm -f *~ ./#*#
62
63 distclean realclean:    clean
64                 rm -f $(CTARGETS)