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.
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.
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]
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
26 #ident "%Z%%M% %I% %E% SMI"
31 include ../../../../../../cmd/Makefile.cmd
32 include ../../../../Makefile.defs
35 # Set PROG and OBJS based on the values of MODULE and SRCS. We expect that
36 # these macros to be defined by the Makefile that is including this file.
38 PROG = $(MODULE:%=%.so)
39 YOBJS = $(YSRCS:%.y=%.o)
40 OBJS = $(YOBJS) $(SRCS:%.c=%.o)
43 # A module may set DMOD and DMOD_SRCS if it has a mdb proc module.
44 # DMOD, if set, must match PROG above (for mdb autoloading) so it will
45 # be built in a subdirectory.
47 ROOTDMOD = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/$(MACH32)%.so)
48 ROOTDMOD64 = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/%.so)
49 DMODPROG = $(DMOD:%=dmod/%)
50 DMOD_OBJS = $(DMOD_SRCS:%.c=%.o)
52 ROOTPLUGINDIR = $(ROOTPLUGINLIBDIR)/ses/$(PLUGINTYPE)/$(MACH32)
53 ROOTPLUGINDIR64 = $(ROOTPLUGINLIBDIR)/ses/$(PLUGINTYPE)
55 ROOTPROG = $(ROOTPLUGINDIR)/$(PROG)
56 ROOTPROG64 = $(ROOTPLUGINDIR64)/$(PROG)
59 # A module can set ALIASES as a list of additional names to correspond to the
62 ROOTALIASES = $(ALIASES:%=$(ROOTPLUGINDIR)/%.so)
63 ROOTALIASES64 = $(ALIASES:%=$(ROOTPLUGINDIR64)/%.so)
67 APIMAP = ../../../../libses/libses_api.map
70 CFLAGS += $(CTF_FLAGS) $(CC_PICFLAGS)
71 CFLAGS += $(GSHARED) $(XREGSFLAG)
72 CFLAGS64 += $(CTF_FLAGS) $(CC_PICFLAGS)
73 CFLAGS64 += $(GSHARED) $(XREGSFLAG)
74 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS
75 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
76 LDFLAGS += $(ZTEXT) $(ZIGNORE)
78 $(PROG) := LDFLAGS += $(ZDEFS) -Wl,-M$(APIMAP)
79 $(PROG) := LDLIBS += -lc -lnvpair
81 $(DMODPROG) := LDFLAGS += $(ZNODEFS)