xref: /titanic_41/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile (revision 70025d765b044c6d8594bb965a2247a61e991a99)
1#
2# ident	"%Z%%M%	%I%	%E% SMI"
3#
4# Copyright 2004 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 -lmd5 -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 md4.o sha1.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 md4.o sha1.o
59	$(LINK.c) -o mschap_test mschap_test.o chap_ms.o md4.o sha1.o \
60		$(LDFLAGS)
61	@echo "Run with 'mschap_test 00000000000000000000000000000000 hello'"
62	@echo
63	@echo "Output should be:"
64	@echo
65	@echo " MS-CHAPv1 with LAN Manager -- 49 bytes:"
66	@echo "  C9 CA EE 9B 1C A7 87 04"
67	@echo "  79 36 8C 55 AB 88 EC 5A"
68	@echo "  57 E9 A1 B7 95 40 C3 74"
69	@echo "  F4 D9 9D AF 82 64 DC 3C"
70	@echo "  53 F9 BC 92 14 B5 5D 9E"
71	@echo "  78 C4 21 48 9D B7 A8 B4"
72	@echo "  01"
73	@echo "  MS-CHAPv2 -- 49 bytes:"
74	@echo "  xx xx xx xx xx xx xx xx"
75	@echo "  xx xx xx xx xx xx xx xx"
76	@echo "  00 00 00 00 00 00 00 00"
77	@echo "  xx xx xx xx xx xx xx xx"
78	@echo "  xx xx xx xx xx xx xx xx"
79	@echo "  xx xx xx xx xx xx xx xx"
80	@echo "  00"
81
82LINTFLAGS +=	-erroff=E_NAME_USED_NOT_DEF2
83LINTFLAGS +=	-erroff=E_GLOBAL_COULD_BE_STATIC2
84LINTFLAGS +=	-erroff=E_NAME_DEF_NOT_USED2
85
86SRCS=		$(OBJS:%.o=%.c)
87
88.PARALLEL:	$(OBJS)
89
90$(PROG):	$(OBJS)
91	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
92	$(POST_PROCESS)
93
94$(ROOTPROG):=	FILEMODE = 04555
95$(ROOTPROG):=	OWNER = root
96
97ASPPP2PPPD=	$(ROOTUSRSBIN)/asppp2pppd
98$(ASPPP2PPPD):=	OWNER=root
99$(ASPPP2PPPD):=	GROUP=bin
100$(ASPPP2PPPD):=	FILEMODE = 0550
101
102install:	$(PROG) .WAIT $(SUBDIRS) $(ROOTPROG) $(ETCPPPDIR) $(ASPPP2PPPD)
103
104$(ETCPPPDIR)/%:	%
105	$(INS.file)
106
107$(ETCPPPDIR):
108	$(INS.dir)
109
110$(SUBDIRS):	FRC
111	@cd $@; pwd; $(MAKE) $(TARGET)
112
113FRC:
114
115LINTOBJS=$(OBJS:%.o=%.ln)
116CLOBBERFILES +=	$(LINTOBJS)
117
118clean:		$(SUBDIRS)
119	$(RM) $(OBJS) $(EXOBJS)
120
121sha1.ln:=	LINTFLAGS += -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
122
123# Not using the default lint target here so that we can disable
124# warnings per module as needed.
125lint:		$(SUBDIRS) $(LINTOBJS)
126	$(LINT.c) $(LINTOBJS) $(LDLIBS)
127
128clobber:	$(SUBDIRS)
129
130include		../../../Makefile.targ
131