12a8d6ebaSRod Evans#
22a8d6ebaSRod Evans# CDDL HEADER START
32a8d6ebaSRod Evans#
42a8d6ebaSRod Evans# The contents of this file are subject to the terms of the
52a8d6ebaSRod Evans# Common Development and Distribution License (the "License").
62a8d6ebaSRod Evans# You may not use this file except in compliance with the License.
72a8d6ebaSRod Evans#
82a8d6ebaSRod Evans# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92a8d6ebaSRod Evans# or http://www.opensolaris.org/os/licensing.
102a8d6ebaSRod Evans# See the License for the specific language governing permissions
112a8d6ebaSRod Evans# and limitations under the License.
122a8d6ebaSRod Evans#
132a8d6ebaSRod Evans# When distributing Covered Code, include this CDDL HEADER in each
142a8d6ebaSRod Evans# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152a8d6ebaSRod Evans# If applicable, add the following below this CDDL HEADER, with the
162a8d6ebaSRod Evans# fields enclosed by brackets "[]" replaced with your own identifying
172a8d6ebaSRod Evans# information: Portions Copyright [yyyy] [name of copyright owner]
182a8d6ebaSRod Evans#
192a8d6ebaSRod Evans# CDDL HEADER END
202a8d6ebaSRod Evans#
212a8d6ebaSRod Evans#
222a8d6ebaSRod Evans# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
232a8d6ebaSRod Evans# Use is subject to license terms.
242a8d6ebaSRod Evans#
252a8d6ebaSRod Evans# Makefile.filter.com and Makefile.filter.targ provide centralized Makefiles
262a8d6ebaSRod Evans# for driving the creation of standard shared object filters.  This class of
272a8d6ebaSRod Evans# filter contains absolutely no implementation (code), instead associating all
282a8d6ebaSRod Evans# symbol definitions to an alternative shared object (filtee).
292a8d6ebaSRod Evans#
302a8d6ebaSRod Evans# Standard filters are commonly used to preserve previously documented system
312a8d6ebaSRod Evans# interfaces when moving symbol definitions from one library to another.  They
322a8d6ebaSRod Evans# are analogous to the way symbolic links are used in the system to preserve
332a8d6ebaSRod Evans# well known file names.  For example, the Unified Process Model folded threads
342a8d6ebaSRod Evans# processing into libc.so.1, and left standard filters /lib/lib[p]thread.so.1
352a8d6ebaSRod Evans# in place.  These filters are built under usr/src/lib/lib[p]thread, and serve
362a8d6ebaSRod Evans# as typical examples.
372a8d6ebaSRod Evans#
382a8d6ebaSRod Evans# A typical Makefile.com for building a standard filter library contains:
392a8d6ebaSRod Evans#
402a8d6ebaSRod Evans#   % cat Makefile.com
412a8d6ebaSRod Evans#   ...
422a8d6ebaSRod Evans#   LIBRARY =	   libxxxx.a
432a8d6ebaSRod Evans#   VERS =	   .1
442a8d6ebaSRod Evans#
452a8d6ebaSRod Evans#   include	   $(SRC)/lib/Makefile.rootfs		(1)
462a8d6ebaSRod Evans#
47*241c90a0SRichard Lowe#   DYNFLAGS +=	   -F filtee				(2)
48*241c90a0SRichard Lowe#   MAPFILEDIR =   .					(3)
492a8d6ebaSRod Evans#
502a8d6ebaSRod Evans# 1.  Use Makefile.rootfs when destination is /lib (rather than /usr/lib).
51*241c90a0SRichard Lowe# 2.  Customize DYNFLAGS to indicate filtee name.
52*241c90a0SRichard Lowe# 3.  Change MAPFILEDIR if mapfiles are not under ../common.
532a8d6ebaSRod Evans#
542a8d6ebaSRod Evans# The typical use of Makefile.filter.com and Makefile.filter.targ is through
552a8d6ebaSRod Evans# inclusion from a standard filters machine specific Makefiles:
562a8d6ebaSRod Evans#
572a8d6ebaSRod Evans#   % cat $(MACH)/Makefile
582a8d6ebaSRod Evans#   ...
592a8d6ebaSRod Evans#   include	   $(SRC)/lib/Makefile.filter.com
602a8d6ebaSRod Evans#   include	   ../Makefile.com
612a8d6ebaSRod Evans#   include	   (SRC)/lib/Makefile.lib.64		(1)
622a8d6ebaSRod Evans#
632a8d6ebaSRod Evans#   DYNFLAGS +=	   -h libyyyyy.so.1			(2)
642a8d6ebaSRod Evans#
652a8d6ebaSRod Evans#   install	   all $(ROOT......
662a8d6ebaSRod Evans#
672a8d6ebaSRod Evans#   include	   $(SRC)/lib/Makefile.filter.targ
682a8d6ebaSRod Evans#
692a8d6ebaSRod Evans# 1.  Use Makefile.lib.64 for 64-bit builds.
70*241c90a0SRichard Lowe# 2.  Customize DYNFLAGS for $MACH if necessary.
712a8d6ebaSRod Evans#
722a8d6ebaSRod Evans
73*241c90a0SRichard Loweinclude		$(SRC)/lib/Makefile.lib
742a8d6ebaSRod Evans
752a8d6ebaSRod Evans# Define common flags, that override or append to Makefile.lib rules.
762a8d6ebaSRod Evans
772a8d6ebaSRod EvansDYNFLAGS +=	$(ZNODUMP) $(ZNOLDYNSYM)
782a8d6ebaSRod EvansLIBS =		$(DYNLIB)
792a8d6ebaSRod EvansSRCDIR =	../common
802a8d6ebaSRod EvansMAPFILES +=	$(MAPFILE.FLT)
81