xref: /onnv-gate/usr/src/cmd/cmd-inet/usr.bin/pppd/plugins/Makefile (revision 10207:87c40ea3fc4b)
10Sstevel@tonic-gate#
22522Sraf# CDDL HEADER START
32522Sraf#
42522Sraf# The contents of this file are subject to the terms of the
52522Sraf# Common Development and Distribution License (the "License").
62522Sraf# You may not use this file except in compliance with the License.
72522Sraf#
82522Sraf# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92522Sraf# or http://www.opensolaris.org/os/licensing.
102522Sraf# See the License for the specific language governing permissions
112522Sraf# and limitations under the License.
122522Sraf#
132522Sraf# When distributing Covered Code, include this CDDL HEADER in each
142522Sraf# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152522Sraf# If applicable, add the following below this CDDL HEADER, with the
162522Sraf# fields enclosed by brackets "[]" replaced with your own identifying
172522Sraf# information: Portions Copyright [yyyy] [name of copyright owner]
182522Sraf#
192522Sraf# CDDL HEADER END
202522Sraf#
212522Sraf#
22*10207SJames.McPherson@Sun.COM# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
230Sstevel@tonic-gate# Use is subject to license terms.
240Sstevel@tonic-gate#
250Sstevel@tonic-gate
260Sstevel@tonic-gateMINCONN =	minconn.so
270Sstevel@tonic-gatePASSPROMPT = 	passprompt.so
280Sstevel@tonic-gatePPPOE =		pppoe.so
290Sstevel@tonic-gate
300Sstevel@tonic-gateLIBRARIES =	minconn.so passprompt.so pppoe.so
310Sstevel@tonic-gateOBJECTS =	minconn.o passprompt.o pppoe.o
320Sstevel@tonic-gate
330Sstevel@tonic-gate# The rest of the sources are GPL
340Sstevel@tonic-gateLINTSRCS =	pppoe.c
350Sstevel@tonic-gate
360Sstevel@tonic-gateinclude		$(SRC)/lib/Makefile.lib
370Sstevel@tonic-gateinclude		../Makefile.def
380Sstevel@tonic-gate
390Sstevel@tonic-gate# Express objects in terms of "pics" thus triggering the appropriate CPPFLAGS,
400Sstevel@tonic-gate# CFLAGS and DYNFLAGS settings from lib/Makefile.lib to build shared objects.
410Sstevel@tonic-gate$(MINCONN):=	PICS = pics/minconn.o
420Sstevel@tonic-gate$(PASSPROMPT):=	PICS = pics/passprompt.o
430Sstevel@tonic-gate$(PPPOE):=	PICS = pics/pppoe.o
440Sstevel@tonic-gate
450Sstevel@tonic-gate# Suppress -h setting from DYNFLAGS as these libraries aren't linked against.
460Sstevel@tonic-gate# Establish external references through mapfiles and dependencies to allow
470Sstevel@tonic-gate# use of -zdefs.
480Sstevel@tonic-gateHSONAME=
492522Sraf$(MINCONN):=	MAPFILES = mapfile-minconn
502522Sraf$(PASSPROMPT):=	MAPFILES = mapfile-passprompt
512522Sraf$(PPPOE):=	MAPFILES = mapfile-pppoe
520Sstevel@tonic-gate
530Sstevel@tonic-gate# A bug in pmake causes redundancy when '+=' is conditionally assigned, so
540Sstevel@tonic-gate# '=' is used with extra variables.
550Sstevel@tonic-gateXXXLDLIBS =
560Sstevel@tonic-gate$(PASSPROMPT):=	XXXLDLIBS = -lc
570Sstevel@tonic-gateLDLIBS +=	$(XXXLDLIBS)
580Sstevel@tonic-gate
590Sstevel@tonic-gateCPPFLAGS +=	-I.. -I$(SRC)/uts/common
600Sstevel@tonic-gate# XX64 -- this should not be needed -- fix me
61224SwesolowsDYNFLAGS +=	-_gcc=-nostdlib
620Sstevel@tonic-gate
630Sstevel@tonic-gateCLOBBERFILES +=	$(LIBRARIES)
640Sstevel@tonic-gate
650Sstevel@tonic-gateLIBPPPPLUGIN=	$(LIBRARIES:%=$(LIBPPPPLUGINDIR)/%)
660Sstevel@tonic-gate
670Sstevel@tonic-gate$(LIBPPPPLUGIN):=	FILEMODE = 0544
680Sstevel@tonic-gate
690Sstevel@tonic-gate$(LIBPPPPLUGINDIR):=	FILEMODE = 0755
700Sstevel@tonic-gate
710Sstevel@tonic-gate# This is needed because install doesn't handle -g well.
720Sstevel@tonic-gateUTILDIR=	$(ROOT)/usr/share/src/ppputil
730Sstevel@tonic-gateROOTSRC=	$(UTILDIR)/plugins
740Sstevel@tonic-gateSRCFILES=	Makefile minconn.c passprompt.c pppd.h
750Sstevel@tonic-gateROOTSRCFILES=	$(SRCFILES:%=$(ROOTSRC)/%)
760Sstevel@tonic-gate$(ROOTSRCFILES):=	FILEMODE= 0444
770Sstevel@tonic-gate
780Sstevel@tonic-gate.KEEP_STATE:
790Sstevel@tonic-gate
800Sstevel@tonic-gateall:	$(LIBRARIES)
810Sstevel@tonic-gate
822522Sraf$(MINCONN): pics .WAIT $$(PICS)
830Sstevel@tonic-gate	$(BUILD.SO)
840Sstevel@tonic-gate	$(POST_PROCESS_SO)
850Sstevel@tonic-gate
862522Sraf$(PASSPROMPT): pics .WAIT $$(PICS)
870Sstevel@tonic-gate	$(BUILD.SO)
880Sstevel@tonic-gate	$(POST_PROCESS_SO)
890Sstevel@tonic-gate
902522Sraf$(PPPOE): pics .WAIT $$(PICS)
910Sstevel@tonic-gate	$(BUILD.SO)
920Sstevel@tonic-gate	$(POST_PROCESS_SO)
930Sstevel@tonic-gate
940Sstevel@tonic-gateinstall: all $(LIBPPPPLUGINDIR) $(LIBPPPPLUGIN) install_src
950Sstevel@tonic-gate
960Sstevel@tonic-gate$(LIBPPPPLUGINDIR):
970Sstevel@tonic-gate	$(INS.dir)
980Sstevel@tonic-gate
990Sstevel@tonic-gate$(LIBPPPPLUGINDIR)/%:	%
1000Sstevel@tonic-gate	$(INS.file)
1010Sstevel@tonic-gate
1020Sstevel@tonic-gate$(UTILDIR) $(ROOTSRC):
1030Sstevel@tonic-gate	$(INS.dir)
1040Sstevel@tonic-gate
1050Sstevel@tonic-gate$(ROOTSRC)/Makefile%: Makefile%.dist
1060Sstevel@tonic-gate	$(INS.rename)
1070Sstevel@tonic-gate
1080Sstevel@tonic-gate$(ROOTSRC)/%.h: ../%.h
1090Sstevel@tonic-gate	$(INS.file)
1100Sstevel@tonic-gate
1110Sstevel@tonic-gate$(ROOTSRC)/%: %
1120Sstevel@tonic-gate	$(INS.file)
1130Sstevel@tonic-gate
1140Sstevel@tonic-gateinstall_src:	$(UTILDIR) .WAIT $(ROOTSRC) .WAIT $(ROOTSRCFILES)
1150Sstevel@tonic-gate
1160Sstevel@tonic-gatelint:
1170Sstevel@tonic-gate	$(LINT.c) $(LINTSRCS) $(LDLIBS)
1180Sstevel@tonic-gate
1190Sstevel@tonic-gateinclude $(SRC)/lib/Makefile.targ
120