X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=linux%2FMakefile.top;h=0d72fb245bc757de62be973983f9f7be551a3603;hp=00ca83df7a72917e3b05e083208411bb1c0e4e98;hb=e79f90482eb6f90c3f1fe7732258756d2ea0277f;hpb=bbe9c77aafc5d183eb3c29879563e4c9b95bc1b6 diff --git a/linux/Makefile.top b/linux/Makefile.top index 00ca83d..0d72fb2 100644 --- a/linux/Makefile.top +++ b/linux/Makefile.top @@ -1,13 +1,54 @@ # PPP top-level Makefile for Linux. + +BINDIR = /usr/sbin +MANDIR = /usr/man +ETCDIR = /etc/ppp + +# uid 0 = root +INSTALL= install -o 0 -g daemon + all: cd chat; $(MAKE) all cd pppd; $(MAKE) all + cd pppstats; $(MAKE) all + +install: $(BINDIR) $(MANDIR)/man8 install-progs install-etcppp + +install-progs: + cd chat; $(MAKE) BINDIR=$(BINDIR) MANDIR=$(MANDIR) install + cd pppd; $(MAKE) BINDIR=$(BINDIR) MANDIR=$(MANDIR) install + cd pppstats; $(MAKE) BINDIR=$(BINDIR) MANDIR=$(MANDIR) install -install: - cd chat; $(MAKE) install - cd pppd; $(MAKE) install +install-etcppp: $(ETCDIR) $(ETCDIR)/options $(ETCDIR)/pap-secrets \ + $(ETCDIR)/chap-secrets + +$(ETCDIR)/options: + if netstat -rn | grep default >/dev/null; then \ + $(INSTALL) -c -m 644 etc.ppp/options $@; \ + else $(INSTALL) -c -m 644 etc.ppp/options.leaf $@; fi +$(ETCDIR)/pap-secrets: + $(INSTALL) -c -m 600 etc.ppp/pap-secrets $@ +$(ETCDIR)/chap-secrets: + $(INSTALL) -c -m 600 etc.ppp/chap-secrets $@ + +$(BINDIR): + $(INSTALL) -d -m 755 $@ +$(MANDIR)/man8: + $(INSTALL) -d -m 755 $@ +$(ETCDIR): + $(INSTALL) -d -m 755 $@ clean: + rm -f core `find . -name '*.[oas]' -print` + rm -f core `find . -name 'core' -print` + rm -f core `find . -name '*~' -print` cd chat; $(MAKE) clean cd pppd; $(MAKE) clean + cd pppstats; $(MAKE) clean + +dist-clean: clean + rm -f Makefile `find . -name Makefile -print` + +kernel: + cd linux; ./kinstall.sh