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 (c) 2010, Oracle and/or its affiliates. All rights reserved.
29 include ../../../../../../cmd/Makefile.cmd
30 include ../../../../Makefile.defs
33 # Set PROG and OBJS based on the values of MODULE and SRCS. We expect that
34 # these macros to be defined by the Makefile that is including this file.
36 PROG = $(MODULE:%=%.so)
37 YOBJS = $(YSRCS:%.y=%.o)
38 OBJS = $(YOBJS) $(SRCS:%.c=%.o)
41 # A module may set DMOD and DMOD_SRCS if it has a mdb proc module.
42 # DMOD, if set, must match PROG above (for mdb autoloading) so it will
43 # be built in a subdirectory.
45 ROOTDMOD = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/%.so)
46 ROOTDMOD64 = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/$(MACH64)/%.so)
47 DMODPROG = $(DMOD:%=dmod/%)
48 DMOD_OBJS = $(DMOD_SRCS:%.c=%.o)
50 ROOTPLUGINDIR = $(ROOTPLUGINLIBDIR)/smp/$(PLUGINTYPE)
51 ROOTPLUGINDIR64 = $(ROOTPLUGINLIBDIR)/smp/$(PLUGINTYPE)/$(MACH64)
53 ROOTPROG = $(ROOTPLUGINDIR)/$(PROG)
54 ROOTPROG64 = $(ROOTPLUGINDIR64)/$(PROG)
57 # A module can set ALIASES as a list of additional names to correspond to the
60 ROOTALIASES = $(ALIASES:%=$(ROOTPLUGINDIR)/%.so)
61 ROOTALIASES64 = $(ALIASES:%=$(ROOTPLUGINDIR64)/%.so)
65 APIMAP = ../../../../libsmp/libsmp_api.map
68 CFLAGS += $(CTF_FLAGS) $(CC_PICFLAGS)
69 CFLAGS += $(GSHARED) $(XREGSFLAG)
70 CFLAGS64 += $(CTF_FLAGS) $(CC_PICFLAGS)
71 CFLAGS64 += $(GSHARED) $(XREGSFLAG)
72 CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS
73 $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
74 LDFLAGS += $(ZTEXT) $(ZCOMBRELOC) $(ZIGNORE)
76 $(PROG) := LDFLAGS += $(ZDEFS) -Wl,-M$(APIMAP)
77 $(PROG) := LDLIBS += -lc
79 $(DMODPROG) := LDFLAGS += $(ZNODEFS)