1275c9da8Seschrock# 2275c9da8Seschrock# CDDL HEADER START 3275c9da8Seschrock# 4275c9da8Seschrock# The contents of this file are subject to the terms of the 5275c9da8Seschrock# Common Development and Distribution License (the "License"). 6275c9da8Seschrock# You may not use this file except in compliance with the License. 7275c9da8Seschrock# 8275c9da8Seschrock# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9275c9da8Seschrock# or http://www.opensolaris.org/os/licensing. 10275c9da8Seschrock# See the License for the specific language governing permissions 11275c9da8Seschrock# and limitations under the License. 12275c9da8Seschrock# 13275c9da8Seschrock# When distributing Covered Code, include this CDDL HEADER in each 14275c9da8Seschrock# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15275c9da8Seschrock# If applicable, add the following below this CDDL HEADER, with the 16275c9da8Seschrock# fields enclosed by brackets "[]" replaced with your own identifying 17275c9da8Seschrock# information: Portions Copyright [yyyy] [name of copyright owner] 18275c9da8Seschrock# 19275c9da8Seschrock# CDDL HEADER END 20275c9da8Seschrock# 21275c9da8Seschrock 22275c9da8Seschrock# 23275c9da8Seschrock# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24275c9da8Seschrock# Use is subject to license terms. 25275c9da8Seschrock# 26275c9da8Seschrock#ident "%Z%%M% %I% %E% SMI" 27275c9da8Seschrock 28275c9da8Seschrock.KEEP_STATE: 29275c9da8Seschrock.SUFFIXES: 30275c9da8Seschrock 31275c9da8Seschrockinclude ../../../../../../cmd/Makefile.cmd 32275c9da8Seschrockinclude ../../../../Makefile.defs 33275c9da8Seschrock 34275c9da8Seschrock# 35275c9da8Seschrock# Set PROG and OBJS based on the values of MODULE and SRCS. We expect that 36275c9da8Seschrock# these macros to be defined by the Makefile that is including this file. 37275c9da8Seschrock# 38275c9da8SeschrockPROG = $(MODULE:%=%.so) 39275c9da8SeschrockYOBJS = $(YSRCS:%.y=%.o) 40275c9da8SeschrockOBJS = $(YOBJS) $(SRCS:%.c=%.o) 41275c9da8Seschrock 42275c9da8Seschrock# 43275c9da8Seschrock# A module may set DMOD and DMOD_SRCS if it has a mdb proc module. 44275c9da8Seschrock# DMOD, if set, must match PROG above (for mdb autoloading) so it will 45275c9da8Seschrock# be built in a subdirectory. 46275c9da8Seschrock# 47275c9da8SeschrockROOTDMOD = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/%.so) 48275c9da8SeschrockROOTDMOD64 = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/$(MACH64)/%.so) 49275c9da8SeschrockDMODPROG = $(DMOD:%=dmod/%) 50275c9da8SeschrockDMOD_OBJS = $(DMOD_SRCS:%.c=%.o) 51275c9da8Seschrock 52a6e6969cSeschrockROOTPLUGINDIR = $(ROOTPLUGINLIBDIR)/ses/$(PLUGINTYPE) 53a6e6969cSeschrockROOTPLUGINDIR64 = $(ROOTPLUGINLIBDIR)/ses/$(PLUGINTYPE)/$(MACH64) 54a6e6969cSeschrock 55a6e6969cSeschrockROOTPROG = $(ROOTPLUGINDIR)/$(PROG) 56a6e6969cSeschrockROOTPROG64 = $(ROOTPLUGINDIR64)/$(PROG) 57a6e6969cSeschrock 58a6e6969cSeschrock# 59a6e6969cSeschrock# A module can set ALIASES as a list of additional names to correspond to the 60a6e6969cSeschrock# same library. 61a6e6969cSeschrock# 62a6e6969cSeschrockROOTALIASES = $(ALIASES:%=$(ROOTPLUGINDIR)/%.so) 63a6e6969cSeschrockROOTALIASES64 = $(ALIASES:%=$(ROOTPLUGINDIR64)/%.so) 64275c9da8Seschrock 65275c9da8SeschrockLINTFLAGS += -mu 66275c9da8SeschrockLINTFILES = $(SRCS:%.c=%.ln) 67275c9da8Seschrock 68275c9da8SeschrockDMODLINTTGT = $(DMOD:%=lint_dmod) 69275c9da8SeschrockDMODLINTFILES = $(DMOD_SRCS:%.c=%.ln) 70275c9da8Seschrock 71275c9da8SeschrockAPIMAP = ../../../../libses/libses_api.map 72275c9da8Seschrock 73275c9da8SeschrockC99MODE = $(C99_ENABLE) 74275c9da8SeschrockCFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) $(CC_PICFLAGS) 75275c9da8SeschrockCFLAGS += -G $(XREGSFLAG) 76275c9da8SeschrockCFLAGS64 += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) $(CC_PICFLAGS) 77275c9da8SeschrockCFLAGS64 += -G $(XREGSFLAG) 78275c9da8SeschrockCPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT 79275c9da8Seschrock$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG 80*67e3a03eSrieLDFLAGS += $(ZTEXT) $(ZIGNORE) 81275c9da8Seschrock 82275c9da8Seschrock$(PROG) := LDFLAGS += $(ZDEFS) -M$(APIMAP) 83275c9da8Seschrock$(PROG) := LDLIBS += -lc -lnvpair 84275c9da8Seschrock 85275c9da8Seschrock$(DMODPROG) := LDFLAGS += $(ZNODEFS) 86