]> granicus.if.org Git - linux-pam/blob - Makefile
Relevant BUGIDs: 728887
[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         @echo XXX - not sure how to preserve past configure options..
45         @echo XXX - so not attempting to. Feel free to run ./configure
46         @echo XXX - by hand, with the options you want.
47         ./configure
48
49 _pam_aconf.h: Make.Rules
50
51 configure: configure.in
52         @echo
53         @echo You do not appear to have an up-to-date ./configure file.
54         @echo Please run autoconf, and then ./configure [..options..]
55         @echo
56         @rm -f configure
57         @exit 1
58
59 $(THINGSTOMAKE): _pam_aconf.h prep bootstrap-libpam
60         $(MAKE) -C $@ all
61
62 install: _pam_aconf.h prep
63         $(MKDIR) $(FAKEROOT)$(INCLUDED)
64         $(INSTALL) -m 444 security/_pam_aconf.h $(FAKEROOT)$(INCLUDED)
65         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x install ; done
66
67 remove:
68         rm -f $(FAKEROOT)$(INCLUDED)/_pam_aconf.h
69         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x remove ; done
70
71 release:
72         @if [ ! -f Make.Rules ]; then echo $(MAKE) Make.Rules first ;exit 1 ;fi
73         @if [ ! -L ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ]; then \
74            echo generating ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) link ; \
75            ln -sf $(DISTNAME) ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ; \
76            echo to ../$(DISTNAME) . ; fi
77         @diff ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/Make.Rules Make.Rules
78         $(MAKE) distclean
79         cd .. ; tar zvfc $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL).tar.gz \
80                 --exclude CVS --exclude .cvsignore --exclude '.#*' \
81                 $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/*
82