Makefile revision 3893cb7fe5bfa1c9a4f7954517a917367f6cf081
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
3b4098640dd85040270f39b9a5ee5e22de99d3d6Mark Andrews# CDDL HEADER START
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# The contents of this file are subject to the terms of the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Common Development and Distribution License (the "License").
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You may not use this file except in compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# or http://www.opensolaris.org/os/licensing.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# See the License for the specific language governing permissions
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# When distributing Covered Code, include this CDDL HEADER in each
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# If applicable, add the following below this CDDL HEADER, with the
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# fields enclosed by brackets "[]" replaced with your own identifying
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews# information: Portions Copyright [yyyy] [name of copyright owner]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# CDDL HEADER END
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# Use is subject to license terms.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#ident "%Z%%M% %I% %E% SMI"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODULE = libumem.so
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMDBTGT = proc
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODSRCS_DIR = ../../../common/modules/genunix
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCOMMONSRCS = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews libumem.c \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews misc.c \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews umem.c
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsKMODSRCS = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(COMMONSRCS)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsMODSRCS = \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(COMMONSRCS) \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews kgrep.c \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews leaky.c \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews leaky_subr.c \
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews proc_kludges.c
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# This signals that $(KMODSRCS) != $(MODSRCS). There are certain features of
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# the libumem dmod, such as leak detection, that we cannot yet use in the kmod.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# In most cases, the inability to use a given function is due to that function's
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# dependance on libproc interfaces - interfaces which are not present in kmdb.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsKMOD_SOURCES_DIFFERENT=$(POUND_SIGN)
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../../../Makefile.cmd
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCPPFLAGS += -I$(SRC)/lib/libumem/common
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsCPPFLAGS += -I$(MODSRCS_DIR)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../../../Makefile.cmd.64
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsinclude ../../Makefile.sparcv9
4abdfc917e6635a7c81d1f931a0c79227e72d025Mark Andrewsinclude ../../../Makefile.module
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews%.o: $(MODSRCS_DIR)/%.c
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(COMPILE.c) $<
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(CTFCONVERT_O)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews%.ln: $(MODSRCS_DIR)/%.c
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $(LINT.c) -c $<
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews#
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# This module is somewhat unusual in that it is a proc-style dmod. proc dmods
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# are not normally built both for mdb and kmdb. These overrides build it as a
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews# proc dmod and as a kvm kmod.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTARGETS = $(TARGETS_proc) $(TARGETS_kvm_kmdb)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsROOTTGTS = $(ROOTTGTS_proc)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews