xref: /titanic_44/usr/src/cmd/cmd-inet/usr.bin/pppd/plugins/Makefile (revision 75ce41a57ff334bd8fe2cb9ed51eea835892f944)
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 2009 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26MINCONN =	minconn.so
27PASSPROMPT = 	passprompt.so
28PPPOE =		pppoe.so
29
30LIBRARIES =	minconn.so passprompt.so pppoe.so
31OBJECTS =	minconn.o passprompt.o pppoe.o
32
33# The rest of the sources are GPL
34LINTSRCS =	pppoe.c
35
36include		$(SRC)/lib/Makefile.lib
37include		../Makefile.def
38
39# Express objects in terms of "pics" thus triggering the appropriate CPPFLAGS,
40# CFLAGS and DYNFLAGS settings from lib/Makefile.lib to build shared objects.
41$(MINCONN):=	PICS = pics/minconn.o
42$(PASSPROMPT):=	PICS = pics/passprompt.o
43$(PPPOE):=	PICS = pics/pppoe.o
44
45# Suppress -h setting from DYNFLAGS as these libraries aren't linked against.
46# Establish external references through mapfiles and dependencies to allow
47# use of -zdefs.
48HSONAME=
49$(MINCONN):=	MAPFILES = mapfile-minconn
50$(PASSPROMPT):=	MAPFILES = mapfile-passprompt
51$(PPPOE):=	MAPFILES = mapfile-pppoe
52
53# A bug in pmake causes redundancy when '+=' is conditionally assigned, so
54# '=' is used with extra variables.
55XXXLDLIBS =
56$(PASSPROMPT):=	XXXLDLIBS = -lc
57LDLIBS +=	$(XXXLDLIBS)
58
59CPPFLAGS +=	-I.. -I$(SRC)/uts/common
60# XX64 -- this should not be needed -- fix me
61DYNFLAGS +=	-_gcc=-nostdlib
62
63CLOBBERFILES +=	$(LIBRARIES)
64
65LIBPPPPLUGIN=	$(LIBRARIES:%=$(LIBPPPPLUGINDIR)/%)
66
67$(LIBPPPPLUGIN):=	FILEMODE = 0544
68
69$(LIBPPPPLUGINDIR):=	FILEMODE = 0755
70
71# This is needed because install doesn't handle -g well.
72UTILDIR=	$(ROOT)/usr/share/src/ppputil
73ROOTSRC=	$(UTILDIR)/plugins
74SRCFILES=	Makefile minconn.c passprompt.c pppd.h
75ROOTSRCFILES=	$(SRCFILES:%=$(ROOTSRC)/%)
76$(ROOTSRCFILES):=	FILEMODE= 0444
77
78.KEEP_STATE:
79
80all:	$(LIBRARIES)
81
82$(MINCONN): pics .WAIT $$(PICS)
83	$(BUILD.SO)
84	$(POST_PROCESS_SO)
85
86$(PASSPROMPT): pics .WAIT $$(PICS)
87	$(BUILD.SO)
88	$(POST_PROCESS_SO)
89
90$(PPPOE): pics .WAIT $$(PICS)
91	$(BUILD.SO)
92	$(POST_PROCESS_SO)
93
94install: all $(LIBPPPPLUGINDIR) $(LIBPPPPLUGIN) install_src
95
96$(LIBPPPPLUGINDIR):
97	$(INS.dir)
98
99$(LIBPPPPLUGINDIR)/%:	%
100	$(INS.file)
101
102$(UTILDIR) $(ROOTSRC):
103	$(INS.dir)
104
105$(ROOTSRC)/Makefile%: Makefile%.dist
106	$(INS.rename)
107
108$(ROOTSRC)/%.h: ../%.h
109	$(INS.file)
110
111$(ROOTSRC)/%: %
112	$(INS.file)
113
114install_src:	$(UTILDIR) .WAIT $(ROOTSRC) .WAIT $(ROOTSRCFILES)
115
116lint:
117	$(LINT.c) $(LINTSRCS) $(LDLIBS)
118
119include $(SRC)/lib/Makefile.targ
120