17c478bd9Sstevel@tonic-gate#
2f53eecf5SJames Carlson# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate# Use is subject to license terms.
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# cmd/cmd-inet/usr.bin/pppd/Makefile
67c478bd9Sstevel@tonic-gate#
71f5207b7SJohn Levon# Copyright (c) 2019, Joyent, Inc.
87c478bd9Sstevel@tonic-gate
97c478bd9Sstevel@tonic-gateinclude		../../../Makefile.cmd
107c478bd9Sstevel@tonic-gateinclude		Makefile.def
117c478bd9Sstevel@tonic-gate
127c478bd9Sstevel@tonic-gatePROG=		pppd
137c478bd9Sstevel@tonic-gateSUBDIRS=	plugins
147c478bd9Sstevel@tonic-gateOBJS=		auth.o ccp.o chap.o demand.o fsm.o ipcp.o ipv6cp.o \
157c478bd9Sstevel@tonic-gate		lcp.o magic.o main.o options.o sys-solaris.o upap.o utils.o \
167c478bd9Sstevel@tonic-gate		multilink.o cbcp.o
177c478bd9Sstevel@tonic-gate
187c478bd9Sstevel@tonic-gate# Object tdb.o used only for Multilink; not supported yet.
197c478bd9Sstevel@tonic-gate
207c478bd9Sstevel@tonic-gateall:=		TARGET= all
217c478bd9Sstevel@tonic-gateinstall:=	TARGET= install
227c478bd9Sstevel@tonic-gateclean:=		TARGET= clean
237c478bd9Sstevel@tonic-gateclobber:=	TARGET= clobber
247c478bd9Sstevel@tonic-gatelint:=		TARGET= lint
257c478bd9Sstevel@tonic-gate
26fb60e41dSssLDLIBS +=	-lpam -lmd -lsocket -lnsl -ldlpi
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate#
297c478bd9Sstevel@tonic-gate# We need absolute path to /etc/ppp/plugins and /usr/lib/inet/ppp, not
307c478bd9Sstevel@tonic-gate# that of the proto area
317c478bd9Sstevel@tonic-gate#
327c478bd9Sstevel@tonic-gateLDFLAGS +=	-R$(ETCPPPPLUGINDIR_ABS) -R$(LIBPPPPLUGINDIR_ABS)
337c478bd9Sstevel@tonic-gate
347c478bd9Sstevel@tonic-gateCPPFLAGS +=	-DPLUGIN -DSVR4 -DSOL2 -DINET6
357c478bd9Sstevel@tonic-gateCPPFLAGS +=	-D_PATH_VARRUN='"/var/run/"'
367c478bd9Sstevel@tonic-gateCPPFLAGS +=	-DNEGOTIATE_FCS -DCBCP_SUPPORT -DALLOW_PAM -DHAS_SHADOW
377c478bd9Sstevel@tonic-gateCPPFLAGS +=	-DHAVE_MMAP -DCOMP_TUNE -DMUX_FRAME
387c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)CPPFLAGS +=	-DDEBUG
397c478bd9Sstevel@tonic-gate
407c478bd9Sstevel@tonic-gate.KEEP_STATE:
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gate.PARALLEL:	$(SUBDIRS)
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gateall:		$(PROG) $(SUBDIRS)
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gate# MS-CHAP support
47eedefb95SdarrenmCPPFLAGS +=	-DHAVE_CRYPT_H -DUSE_CRYPT -DHAVE_LIBMD
487c478bd9Sstevel@tonic-gateCPPFLAGS +=	-DCHAPMS -DMSLANMAN
497c478bd9Sstevel@tonic-gateCPPFLAGS +=	-DCHAPMSV2
50734b6a94SdarrenmOBJS +=		chap_ms.o
517c478bd9Sstevel@tonic-gateEXOBJS +=	mschap_test.o
527c478bd9Sstevel@tonic-gateCLOBBERFILES +=	mschap_test
537c478bd9Sstevel@tonic-gate
54*d3b5f563SJohn LevonCERRWARN +=	$(CNOWARN_UNINIT)
557014882cSRichard Lowe
561f5207b7SJohn Levon# main() is too hairy for smatch
571f5207b7SJohn LevonSMATCH=off
581f5207b7SJohn Levon
597c478bd9Sstevel@tonic-gate# This is used *only* for testing the portability of the libraries
607c478bd9Sstevel@tonic-gate# required for MS-CHAPv1.  It is not needed in any normal system and
617c478bd9Sstevel@tonic-gate# is not built by default.
62734b6a94Sdarrenmmschap_test:	mschap_test.o chap_ms.o
63eedefb95Sdarrenm	$(LINK.c) -o mschap_test mschap_test.o chap_ms.o $(LDFLAGS) -lmd
647c478bd9Sstevel@tonic-gate	@echo "Run with 'mschap_test 00000000000000000000000000000000 hello'"
657c478bd9Sstevel@tonic-gate	@echo
667c478bd9Sstevel@tonic-gate	@echo "Output should be:"
677c478bd9Sstevel@tonic-gate	@echo
687c478bd9Sstevel@tonic-gate	@echo " MS-CHAPv1 with LAN Manager -- 49 bytes:"
697c478bd9Sstevel@tonic-gate	@echo "  C9 CA EE 9B 1C A7 87 04"
707c478bd9Sstevel@tonic-gate	@echo "  79 36 8C 55 AB 88 EC 5A"
717c478bd9Sstevel@tonic-gate	@echo "  57 E9 A1 B7 95 40 C3 74"
727c478bd9Sstevel@tonic-gate	@echo "  F4 D9 9D AF 82 64 DC 3C"
737c478bd9Sstevel@tonic-gate	@echo "  53 F9 BC 92 14 B5 5D 9E"
747c478bd9Sstevel@tonic-gate	@echo "  78 C4 21 48 9D B7 A8 B4"
757c478bd9Sstevel@tonic-gate	@echo "  01"
767c478bd9Sstevel@tonic-gate	@echo "  MS-CHAPv2 -- 49 bytes:"
777c478bd9Sstevel@tonic-gate	@echo "  xx xx xx xx xx xx xx xx"
787c478bd9Sstevel@tonic-gate	@echo "  xx xx xx xx xx xx xx xx"
797c478bd9Sstevel@tonic-gate	@echo "  00 00 00 00 00 00 00 00"
807c478bd9Sstevel@tonic-gate	@echo "  xx xx xx xx xx xx xx xx"
817c478bd9Sstevel@tonic-gate	@echo "  xx xx xx xx xx xx xx xx"
827c478bd9Sstevel@tonic-gate	@echo "  xx xx xx xx xx xx xx xx"
837c478bd9Sstevel@tonic-gate	@echo "  00"
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gate.PARALLEL:	$(OBJS)
867c478bd9Sstevel@tonic-gate
877c478bd9Sstevel@tonic-gate$(PROG):	$(OBJS)
887c478bd9Sstevel@tonic-gate	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
897c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gate$(ROOTPROG):=	FILEMODE = 04555
927c478bd9Sstevel@tonic-gate
937c478bd9Sstevel@tonic-gateASPPP2PPPD=	$(ROOTUSRSBIN)/asppp2pppd
947c478bd9Sstevel@tonic-gate$(ASPPP2PPPD):=	FILEMODE = 0550
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gateinstall:	$(PROG) .WAIT $(SUBDIRS) $(ROOTPROG) $(ETCPPPDIR) $(ASPPP2PPPD)
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gate$(ETCPPPDIR)/%:	%
997c478bd9Sstevel@tonic-gate	$(INS.file)
1007c478bd9Sstevel@tonic-gate
1017c478bd9Sstevel@tonic-gate$(ETCPPPDIR):
1027c478bd9Sstevel@tonic-gate	$(INS.dir)
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate$(SUBDIRS):	FRC
1057c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gateFRC:
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gateclean:		$(SUBDIRS)
1107c478bd9Sstevel@tonic-gate	$(RM) $(OBJS) $(EXOBJS)
1117c478bd9Sstevel@tonic-gate
1127c478bd9Sstevel@tonic-gateclobber:	$(SUBDIRS)
1137c478bd9Sstevel@tonic-gate
1147c478bd9Sstevel@tonic-gateinclude		../../../Makefile.targ
115