xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile (revision 337314b168c54664c60b2a5071e5b3d509167aef)
1#
2# ident	"%Z%%M%	%I%	%E% SMI"
3#
4# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
5# Use is subject to license terms.
6#
7# cmd/cmd-inet/usr.bin/pppd/Makefile
8#
9
10include		../../../Makefile.cmd
11include		Makefile.def
12
13PROG=		pppd
14SUBDIRS=	plugins
15OBJS=		auth.o ccp.o chap.o demand.o fsm.o ipcp.o ipv6cp.o \
16		lcp.o magic.o main.o options.o sys-solaris.o upap.o utils.o \
17		multilink.o cbcp.o
18
19# Object tdb.o used only for Multilink; not supported yet.
20
21all:=		TARGET= all
22install:=	TARGET= install
23clean:=		TARGET= clean
24clobber:=	TARGET= clobber
25lint:=		TARGET= lint
26
27LDLIBS +=	-lpam -lmd -lsocket -lnsl
28
29#
30# We need absolute path to /etc/ppp/plugins and /usr/lib/inet/ppp, not
31# that of the proto area
32#
33LDFLAGS +=	-R$(ETCPPPPLUGINDIR_ABS) -R$(LIBPPPPLUGINDIR_ABS)
34
35CPPFLAGS +=	-DPLUGIN -DSVR4 -DSOL2 -DINET6
36CPPFLAGS +=	-D_PATH_VARRUN='"/var/run/"'
37CPPFLAGS +=	-DNEGOTIATE_FCS -DCBCP_SUPPORT -DALLOW_PAM -DHAS_SHADOW
38CPPFLAGS +=	-DHAVE_MMAP -DCOMP_TUNE -DMUX_FRAME
39$(NOT_RELEASE_BUILD)CPPFLAGS +=	-DDEBUG
40
41.KEEP_STATE:
42
43.PARALLEL:	$(SUBDIRS)
44
45all:		$(PROG) $(SUBDIRS)
46
47# MS-CHAP support
48CPPFLAGS +=	-DHAVE_CRYPT_H -DUSE_CRYPT
49CPPFLAGS +=	-DCHAPMS -DMSLANMAN
50CPPFLAGS +=	-DCHAPMSV2
51OBJS +=		chap_ms.o
52EXOBJS +=	mschap_test.o
53CLOBBERFILES +=	mschap_test
54
55# This is used *only* for testing the portability of the libraries
56# required for MS-CHAPv1.  It is not needed in any normal system and
57# is not built by default.
58mschap_test:	mschap_test.o chap_ms.o
59	$(LINK.c) -o mschap_test mschap_test.o chap_ms.o $(LDFLAGS)
60	@echo "Run with 'mschap_test 00000000000000000000000000000000 hello'"
61	@echo
62	@echo "Output should be:"
63	@echo
64	@echo " MS-CHAPv1 with LAN Manager -- 49 bytes:"
65	@echo "  C9 CA EE 9B 1C A7 87 04"
66	@echo "  79 36 8C 55 AB 88 EC 5A"
67	@echo "  57 E9 A1 B7 95 40 C3 74"
68	@echo "  F4 D9 9D AF 82 64 DC 3C"
69	@echo "  53 F9 BC 92 14 B5 5D 9E"
70	@echo "  78 C4 21 48 9D B7 A8 B4"
71	@echo "  01"
72	@echo "  MS-CHAPv2 -- 49 bytes:"
73	@echo "  xx xx xx xx xx xx xx xx"
74	@echo "  xx xx xx xx xx xx xx xx"
75	@echo "  00 00 00 00 00 00 00 00"
76	@echo "  xx xx xx xx xx xx xx xx"
77	@echo "  xx xx xx xx xx xx xx xx"
78	@echo "  xx xx xx xx xx xx xx xx"
79	@echo "  00"
80
81LINTFLAGS +=	-erroff=E_NAME_USED_NOT_DEF2
82LINTFLAGS +=	-erroff=E_GLOBAL_COULD_BE_STATIC2
83LINTFLAGS +=	-erroff=E_NAME_DEF_NOT_USED2
84
85SRCS=		$(OBJS:%.o=%.c)
86
87.PARALLEL:	$(OBJS)
88
89$(PROG):	$(OBJS)
90	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
91	$(POST_PROCESS)
92
93$(ROOTPROG):=	FILEMODE = 04555
94$(ROOTPROG):=	OWNER = root
95
96ASPPP2PPPD=	$(ROOTUSRSBIN)/asppp2pppd
97$(ASPPP2PPPD):=	OWNER=root
98$(ASPPP2PPPD):=	GROUP=bin
99$(ASPPP2PPPD):=	FILEMODE = 0550
100
101install:	$(PROG) .WAIT $(SUBDIRS) $(ROOTPROG) $(ETCPPPDIR) $(ASPPP2PPPD)
102
103$(ETCPPPDIR)/%:	%
104	$(INS.file)
105
106$(ETCPPPDIR):
107	$(INS.dir)
108
109$(SUBDIRS):	FRC
110	@cd $@; pwd; $(MAKE) $(TARGET)
111
112FRC:
113
114LINTOBJS=$(OBJS:%.o=%.ln)
115CLOBBERFILES +=	$(LINTOBJS)
116
117clean:		$(SUBDIRS)
118	$(RM) $(OBJS) $(EXOBJS)
119
120sha1.ln:=	LINTFLAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
121
122# Not using the default lint target here so that we can disable
123# warnings per module as needed.
124lint:		$(SUBDIRS) $(LINTOBJS)
125	$(LINT.c) $(LINTOBJS) $(LDLIBS)
126
127clobber:	$(SUBDIRS)
128
129include		../../../Makefile.targ
130