]> granicus.if.org Git - linux-pam/blob - Makefile
Relevant BUGIDs: none
[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: config.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 config.h
35         rm -f config.status config.cache config.log core
36         rm -rf autom4te.cache/
37
38 maintainer-clean: distclean
39         @echo files should be ok for packaging now.
40
41 # NB config.h.in changes will remake this too
42 Make.Rules: configure Make.Rules.in config.h.in
43         ./config.status --recheck
44         ./config.status
45
46 config.h: Make.Rules
47
48 configure: configure.in
49         @echo
50         @echo You do not appear to have an up-to-date ./configure file.
51         @echo Please run autoconf, and then ./configure [..options..]
52         @echo
53         @rm -f configure
54         @exit 1
55
56 $(THINGSTOMAKE): config.h prep bootstrap-libpam
57         $(MAKE) -C $@ all
58
59 install: config.h prep
60         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x install ; done
61
62 remove:
63         rm -f $(FAKEROOT)$(INCLUDED)/config.h
64         for x in $(THINGSTOMAKE) ; do $(MAKE) -C $$x remove ; done
65
66 release:
67         @if [ ! -f Make.Rules ]; then echo $(MAKE) Make.Rules first ;exit 1 ;fi
68         @if [ ! -L ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ]; then \
69            echo generating ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) link ; \
70            ln -sf $(DISTNAME) ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL) ; \
71            echo to ../$(DISTNAME) . ; fi
72         @diff ../$(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/Make.Rules Make.Rules
73         $(MAKE) distclean
74         cd .. ; tar zvfc $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL).tar.gz \
75                 --exclude CVS --exclude .cvsignore --exclude '.#*' \
76                 $(DISTNAME)-$(MAJOR_REL).$(MINOR_REL)/*