]> granicus.if.org Git - linux-pam/blob - Makefile
Relevant BUGIDs: 849541
[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 ifeq ($(shell test \! -f Make.Rules || echo yes),yes)
15     include Make.Rules
16 endif
17
18 THINGSTOMAKE = modules libpam libpamc libpam_misc doc examples
19
20 all: $(THINGSTOMAKE)
21
22  # Let's get a dynamic libpam.so first
23  bootstrap-libpam: _pam_aconf.h prep
24         $(MAKE) -C libpam bootstrap-libpam
25
26 prep:
27         rm -f security
28         ln -sf . security
29
30 clean:
31         if [ ! -f Make.Rules ]; then touch Make.Rules ; fi
32         for i in $(THINGSTOMAKE) ; do $(MAKE) -C $$i clean ; done
33         rm -f security *~ *.orig *.rej Make.Rules #*#
34
35 distclean: clean
36         rm -f Make.Rules _pam_aconf.h
37         rm -f config.status config.cache config.log core
38
39 maintainer-clean: distclean
40         @echo files should be ok for packaging now.
41
42 # NB _pam_aconf.h.in changes will remake this too
43 Make.Rules: configure Make.Rules.in _pam_aconf.h.in
44         ./config.status --recheck
45         ./config.status
46
47 _pam_aconf.h: Make.Rules
48
49 configure: configure.in
50         @echo
51         @echo You do not appear to have an up-to-date ./configure file.
52         @echo Please run autoconf, and then ./configure [..options..]
53         @echo
54         @rm -f configure
55         @exit 1
56
57 $(THINGSTOMAKE): _pam_aconf.h prep bootstrap-libpam
58         $(MAKE) -C $@ all
59
60 install: _pam_aconf.h prep
61         $(MKDIR) $(FAKEROOT)$(INCLUDED)
62         $(INSTALL) -m 444 security/_pam_aconf.h $(FAKEROOT)$(INCLUDED)
63         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x install ; done
64
65 remove:
66         rm -f $(FAKEROOT)$(INCLUDED)/_pam_aconf.h
67         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x remove ; done
68
69 release:
70         @if [ ! -f Make.Rules ]; then echo $(MAKE) Make.Rules first ;exit 1 ;fi
71         @if [ ! -L ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ]; then \
72            echo generating ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) link ; \
73            ln -sf $(DISTNAME) ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ; \
74            echo to ../$(DISTNAME) . ; fi
75         @diff ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/Make.Rules Make.Rules
76         $(MAKE) distclean
77         cd .. ; tar zvfc $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL).tar.gz \
78                 --exclude CVS --exclude .cvsignore --exclude '.#*' \
79                 $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/*
80