xref: /titanic_52/usr/src/cmd/cmd-inet/usr.bin/pppd/plugins/Makefile (revision a93a1f58a8763fa69172980b98e3d24720c1136e)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28MINCONN =	minconn.so
29PASSPROMPT = 	passprompt.so
30PPPOE =		pppoe.so
31
32LIBRARIES =	minconn.so passprompt.so pppoe.so
33OBJECTS =	minconn.o passprompt.o pppoe.o
34
35# The rest of the sources are GPL
36LINTSRCS =	pppoe.c
37
38include		$(SRC)/lib/Makefile.lib
39include		../Makefile.def
40
41# Express objects in terms of "pics" thus triggering the appropriate CPPFLAGS,
42# CFLAGS and DYNFLAGS settings from lib/Makefile.lib to build shared objects.
43$(MINCONN):=	PICS = pics/minconn.o
44$(PASSPROMPT):=	PICS = pics/passprompt.o
45$(PPPOE):=	PICS = pics/pppoe.o
46
47# Suppress -h setting from DYNFLAGS as these libraries aren't linked against.
48# Establish external references through mapfiles and dependencies to allow
49# use of -zdefs.
50HSONAME=
51$(MINCONN):=	MAPFILES = mapfile-minconn
52$(PASSPROMPT):=	MAPFILES = mapfile-passprompt
53$(PPPOE):=	MAPFILES = mapfile-pppoe
54
55# A bug in pmake causes redundancy when '+=' is conditionally assigned, so
56# '=' is used with extra variables.
57XXXLDLIBS =
58$(PASSPROMPT):=	XXXLDLIBS = -lc
59LDLIBS +=	$(XXXLDLIBS)
60
61CPPFLAGS +=	-I.. -I$(SRC)/uts/common
62# XX64 -- this should not be needed -- fix me
63DYNFLAGS +=	-_gcc=-nostdlib
64
65CLOBBERFILES +=	$(LIBRARIES)
66
67LIBPPPPLUGIN=	$(LIBRARIES:%=$(LIBPPPPLUGINDIR)/%)
68
69$(LIBPPPPLUGIN):=	FILEMODE = 0544
70$(LIBPPPPLUGIN):=	OWNER = root
71$(LIBPPPPLUGIN):=	GROUP = bin
72
73$(LIBPPPPLUGINDIR):=	FILEMODE = 0755
74$(LIBPPPPLUGINDIR):=	OWNER = root
75$(LIBPPPPLUGINDIR):=	GROUP = bin
76
77# This is needed because install doesn't handle -g well.
78UTILDIR=	$(ROOT)/usr/share/src/ppputil
79$(UTILDIR):=	OWNER = root
80$(UTILDIR):=	GROUP = bin
81ROOTSRC=	$(UTILDIR)/plugins
82SRCFILES=	Makefile minconn.c passprompt.c pppd.h
83ROOTSRCFILES=	$(SRCFILES:%=$(ROOTSRC)/%)
84$(ROOTSRC):=	OWNER = root
85$(ROOTSRC):=	GROUP = bin
86$(ROOTSRCFILES):=	FILEMODE= 0444
87$(ROOTSRCFILES):=	OWNER = root
88$(ROOTSRCFILES):=	GROUP = bin
89
90.KEEP_STATE:
91
92all:	$(LIBRARIES)
93
94$(MINCONN): pics .WAIT $$(PICS)
95	$(BUILD.SO)
96	$(POST_PROCESS_SO)
97
98$(PASSPROMPT): pics .WAIT $$(PICS)
99	$(BUILD.SO)
100	$(POST_PROCESS_SO)
101
102$(PPPOE): pics .WAIT $$(PICS)
103	$(BUILD.SO)
104	$(POST_PROCESS_SO)
105
106install: all $(LIBPPPPLUGINDIR) $(LIBPPPPLUGIN) install_src
107
108$(LIBPPPPLUGINDIR):
109	$(INS.dir)
110
111$(LIBPPPPLUGINDIR)/%:	%
112	$(INS.file)
113
114$(UTILDIR) $(ROOTSRC):
115	$(INS.dir)
116
117$(ROOTSRC)/Makefile%: Makefile%.dist
118	$(INS.rename)
119
120$(ROOTSRC)/%.h: ../%.h
121	$(INS.file)
122
123$(ROOTSRC)/%: %
124	$(INS.file)
125
126install_src:	$(UTILDIR) .WAIT $(ROOTSRC) .WAIT $(ROOTSRCFILES)
127
128lint:
129	$(LINT.c) $(LINTSRCS) $(LDLIBS)
130
131include $(SRC)/lib/Makefile.targ
132