2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# CDDL HEADER START
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# The contents of this file are subject to the terms of the
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# Common Development and Distribution License (the "License").
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# You may not use this file except in compliance with the License.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# or http://www.opensolaris.org/os/licensing.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# See the License for the specific language governing permissions
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# and limitations under the License.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# When distributing Covered Code, include this CDDL HEADER in each
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# If applicable, add the following below this CDDL HEADER, with the
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# fields enclosed by brackets "[]" replaced with your own identifying
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# information: Portions Copyright [yyyy] [name of copyright owner]
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# CDDL HEADER END
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# Use is subject to license terms.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# Makefile.filter.com and Makefile.filter.targ provide centralized Makefiles
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# for driving the creation of standard shared object filters. This class of
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# filter contains absolutely no implementation (code), instead associating all
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# symbol definitions to an alternative shared object (filtee).
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# Standard filters are commonly used to preserve previously documented system
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# interfaces when moving symbol definitions from one library to another. They
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# are analogous to the way symbolic links are used in the system to preserve
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# well known file names. For example, the Unified Process Model folded threads
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# processing into libc.so.1, and left standard filters /lib/lib[p]thread.so.1
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# in place. These filters are built under usr/src/lib/lib[p]thread, and serve
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# as typical examples.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# A typical Makefile.com for building a standard filter library contains:
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# % cat Makefile.com
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# ...
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# LIBRARY = libxxxx.a
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# VERS = .1
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# include $(SRC)/lib/Makefile.rootfs (1)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# LIBS += $(LINTLIB) (2)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# DYNFLAGS += -F filtee (3)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# MAPFILEDIR = . (4)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# 1. Use Makefile.rootfs when destination is /lib (rather than /usr/lib).
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# 2. Add LINTLIB when a lint library is produced.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# 3. Customize DYNFLAGS to indicate filtee name.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# 4. Change MAPFILEDIR if mapfiles are not under ../common.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# The typical use of Makefile.filter.com and Makefile.filter.targ is through
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# inclusion from a standard filters machine specific Makefiles:
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# % cat $(MACH)/Makefile
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# ...
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# include $(SRC)/lib/Makefile.filter.com
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# include ../Makefile.com
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# include (SRC)/lib/Makefile.lib.64 (1)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# DYNFLAGS += -h libyyyyy.so.1 (2)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# install all $(ROOT......
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# include $(SRC)/lib/Makefile.filter.targ
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# 1. Use Makefile.lib.64 for 64-bit builds.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# 2. Customize DYNFLAGS for $MACH if necessary.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans#
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evansinclude $(SRC)/lib/Makefile.lib
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans# Define common flags, that override or append to Makefile.lib rules.
2a8d6eba033e4713ab12b61178f0513f1f075482Rod Evans
2a8d6eba033e4713ab12b61178f0513f1f075482Rod EvansDYNFLAGS += $(ZNODUMP) $(ZNOLDYNSYM)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod EvansLIBS = $(DYNLIB)
2a8d6eba033e4713ab12b61178f0513f1f075482Rod EvansSRCDIR = ../common
2a8d6eba033e4713ab12b61178f0513f1f075482Rod EvansMAPFILES += $(MAPFILE.FLT)