]> granicus.if.org Git - linux-pam/blob - Makefile
Relevant BUGIDs:
[linux-pam] / Makefile
1 ##
2 ## $Id$
3 ##
4
5 ## Note, ideally I would prefer it if this top level makefile did
6 ## not get created by autoconf. As I find typing 'make' and relying
7 ## on it to take care of all dependencies much more friendly than
8 ## the multi-stage autoconf+make and also worry about updates to
9 ## configure.in not getting propagated down the tree. (AGM) [I realise
10 ## that this may not prove possible, but at least I tried.. Sigh.]
11
12 DISTNAME=Linux-PAM
13
14 -include Make.Rules
15
16 THINGSTOMAKE = libpam libpamc libpam_misc modules doc examples
17
18 all: $(THINGSTOMAKE)
19
20  # Let's get a dynamic libpam.so first
21  bootstrap-libpam: _pam_aconf.h prep
22         $(MAKE) -C libpam bootstrap-libpam
23
24 prep:
25         rm -f security
26         ln -sf . security
27
28 clean:
29         if [ ! -f Make.Rules ]; then touch Make.Rules ; fi
30         for i in $(THINGSTOMAKE) ; do $(MAKE) -C $$i clean ; done
31         rm -f security *~ *.orig *.rej #*#
32
33 distclean: clean
34         rm -f Make.Rules _pam_aconf.h
35         rm -f config.status config.cache config.log core
36
37 maintainer-clean: distclean
38         @echo files should be ok for packaging now.
39
40 # NB _pam_aconf.h.in changes will remake this too
41 Make.Rules: configure Make.Rules.in _pam_aconf.h.in
42         ./config.status --recheck
43         ./config.status
44
45 _pam_aconf.h: Make.Rules
46
47 configure: configure.in
48         @echo
49         @echo You do not appear to have an up-to-date ./configure file.
50         @echo Please run autoconf, and then ./configure [..options..]
51         @echo
52         @rm -f configure
53         @exit 1
54
55 $(THINGSTOMAKE): _pam_aconf.h prep bootstrap-libpam
56         $(MAKE) -C $@ all
57
58 install: _pam_aconf.h prep
59         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x install ; done
60
61 remove:
62         rm -f $(FAKEROOT)$(INCLUDED)/_pam_aconf.h
63         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x remove ; done
64
65 release:
66         @if [ ! -f Make.Rules ]; then echo $(MAKE) Make.Rules first ;exit 1 ;fi
67         @if [ ! -L ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ]; then \
68            echo generating ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) link ; \
69            ln -sf $(DISTNAME) ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ; \
70            echo to ../$(DISTNAME) . ; fi
71         @diff ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/Make.Rules Make.Rules
72         $(MAKE) distclean
73         cd .. ; tar zvfc $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL).tar.gz \
74                 --exclude CVS --exclude .cvsignore --exclude '.#*' \
75                 $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/*