]> granicus.if.org Git - linux-pam/blob - Makefile
Relevant BUGIDs: 476985
[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 prep:
23         rm -f security
24         ln -sf . security
25
26 clean:
27         if [ ! -f Make.Rules ]; then touch Make.Rules ; fi
28         for i in $(THINGSTOMAKE) ; do $(MAKE) -C $$i clean ; done
29         rm -f security *~ *.orig *.rej Make.Rules #*#
30
31 distclean: clean
32         rm -f Make.Rules _pam_aconf.h
33         rm -f config.status config.cache config.log core
34
35 maintainer-clean: distclean
36         @echo files should be ok for packaging now.
37
38 # NB _pam_aconf.h.in changes will remake this too
39 Make.Rules: configure Make.Rules.in _pam_aconf.h.in
40         @echo XXX - not sure how to preserve past configure options..
41         @echo XXX - so not attempting to. Feel free to run ./configure
42         @echo XXX - by hand, with the options you want.
43         ./configure
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
56         $(MAKE) -C $@ all
57
58 install: _pam_aconf.h prep
59         $(MKDIR) $(FAKEROOT)$(INCLUDED)
60         $(INSTALL) -m 444 security/_pam_aconf.h $(FAKEROOT)$(INCLUDED)
61         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x install ; done
62
63 remove:
64         rm -f $(FAKEROOT)$(INCLUDED)/_pam_aconf.h
65         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x remove ; done
66
67 release:
68         @if [ ! -f Make.Rules ]; then echo $(MAKE) Make.Rules first ;exit 1 ;fi
69         @if [ ! -L ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ]; then \
70            echo generating ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) link ; \
71            ln -sf $(DISTNAME) ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ; \
72            echo to ../$(DISTNAME) . ; fi
73         @diff ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/Make.Rules Make.Rules
74         $(MAKE) distclean
75         cd .. ; tar zvfc $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL).tar.gz \
76                 --exclude CVS --exclude .cvsignore --exclude '.#*' \
77                 $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/*
78