]> git.ozlabs.org Git - ppp.git/blob - linux/Makefile.top
0d72fb245bc757de62be973983f9f7be551a3603
[ppp.git] / linux / Makefile.top
1 # PPP top-level Makefile for Linux.
2
3
4 BINDIR = /usr/sbin
5 MANDIR = /usr/man
6 ETCDIR = /etc/ppp
7
8 # uid 0 = root
9 INSTALL= install -o 0 -g daemon
10
11 all:
12         cd chat; $(MAKE) all
13         cd pppd; $(MAKE) all
14         cd pppstats; $(MAKE) all
15
16 install: $(BINDIR) $(MANDIR)/man8 install-progs install-etcppp
17
18 install-progs:
19         cd chat; $(MAKE) BINDIR=$(BINDIR) MANDIR=$(MANDIR) install
20         cd pppd; $(MAKE) BINDIR=$(BINDIR) MANDIR=$(MANDIR) install
21         cd pppstats; $(MAKE) BINDIR=$(BINDIR) MANDIR=$(MANDIR) install
22
23 install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \
24         $(ETCDIR)/chap-secrets
25
26 $(ETCDIR)/options:
27         if netstat -rn | grep default >/dev/null; then \
28           $(INSTALL) -c -m 644 etc.ppp/options $@; \
29         else $(INSTALL) -c -m 644 etc.ppp/options.leaf $@; fi
30 $(ETCDIR)/pap-secrets:
31         $(INSTALL) -c -m 600 etc.ppp/pap-secrets $@
32 $(ETCDIR)/chap-secrets:
33         $(INSTALL) -c -m 600 etc.ppp/chap-secrets $@
34
35 $(BINDIR):
36         $(INSTALL) -d -m 755 $@
37 $(MANDIR)/man8:
38         $(INSTALL) -d -m 755 $@
39 $(ETCDIR):
40         $(INSTALL) -d -m 755 $@
41
42 clean:
43         rm -f core `find . -name '*.[oas]' -print`
44         rm -f core `find . -name 'core' -print`
45         rm -f core `find . -name '*~' -print`
46         cd chat; $(MAKE) clean
47         cd pppd; $(MAKE) clean
48         cd pppstats; $(MAKE) clean
49
50 dist-clean:     clean
51         rm -f Makefile `find . -name Makefile -print`
52
53 kernel:
54         cd linux; ./kinstall.sh