chiark / gitweb /
461d44d6c034db35865e212ec5b71053a95610f6
[chiark-utils.git] / sync-accounts / Makefile
1 # Makefile
2
3 # This file is part of chiark-utils, a collection of useful programs
4 # used on chiark.greenend.org.uk.
5 #
6 # This file is:
7 #  Copyright 2001-2002 Ian Jackson <ian@chiark.greenend.org.uk>
8 #
9 # This is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2, or (at your option) any later version.
12 #
13 # This is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16 # details.
17 #
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc.,
20 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
22 INSTALL=                install -c
23 INSTALL_SHARE=          $(INSTALL) -m 644 -o root -g root
24 INSTALL_SCRIPT=         $(INSTALL) -m 755 -o root -g root
25 INSTALL_DIRECTORY=      $(INSTALL) -m 2755 -o root -g root -d
26
27 prefix=/usr/local
28 bindir=$(prefix)/bin
29 mandir=${prefix}/man
30 man5dir=${mandir}/man5
31 man8dir=${mandir}/man8
32 txtdocdir=$(prefix)/share/doc/sync-accounts
33 exampledir=$(txtdocdir)/examples
34
35 SCRIPTS=        sync-accounts sync-accounts-createuser grab-account
36 MANPAGES5=      sync-accounts
37 MANPAGES8=      sync-accounts sync-accounts-createuser grab-account
38 EXAMPLES=       linux bsd
39
40 all:
41
42 install:
43                 $(INSTALL_DIRECTORY) $(bindir)
44                 set -e; for f in $(SCRIPTS); do \
45                         $(INSTALL_SCRIPT) $$f $(bindir)/$$f; done
46
47 install-docs:
48                 $(INSTALL_DIRECTORY) $(man5dir) $(man8dir)
49                 set -e; for f in $(MANPAGES5); do \
50                         $(INSTALL_SCRIPT) $$f.5 $(man5dir)/$$f.5; done
51                 set -e; for f in $(MANPAGES8); do \
52                         $(INSTALL_SCRIPT) $$f.8 $(man8dir)/$$f.8; done
53
54 install-examples:
55                 $(INSTALL_DIRECTORY) $(exampledir)
56                 set -e; for e in $(EXAMPLES); do \
57                         $(INSTALL_SHARE) sync-accounts.example-$$e \
58                                 $(exampledir)/sync-accounts.$$e; \
59                         done
60
61 clean:
62                 rm -f *~ ./#*#
63
64 distclean realclean:    clean