xref: /titanic_50/usr/src/lib/scsi/plugins/ses/Makefile.lib (revision 7c64d3750da7fda7e450b8f9b0b963905ded6379)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27
28.KEEP_STATE:
29.SUFFIXES:
30
31include ../../../../../../cmd/Makefile.cmd
32include ../../../../Makefile.defs
33
34#
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.
37#
38PROG = $(MODULE:%=%.so)
39YOBJS = $(YSRCS:%.y=%.o)
40OBJS = $(YOBJS) $(SRCS:%.c=%.o)
41
42#
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.
46#
47ROOTDMOD = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/%.so)
48ROOTDMOD64 = $(DMOD:%.so=$(ROOT)/usr/lib/mdb/proc/$(MACH64)/%.so)
49DMODPROG = $(DMOD:%=dmod/%)
50DMOD_OBJS = $(DMOD_SRCS:%.c=%.o)
51
52ROOTPROG = $(ROOTPLUGINLIBDIR)/ses/$(PLUGINTYPE)/$(PROG)
53ROOTPROG64 = $(ROOTPLUGINLIBDIR)/ses/$(PLUGINTYPE)/$(MACH64)/$(PROG)
54
55LINTFLAGS += -mu
56LINTFILES = $(SRCS:%.c=%.ln)
57
58DMODLINTTGT = $(DMOD:%=lint_dmod)
59DMODLINTFILES = $(DMOD_SRCS:%.c=%.ln)
60
61APIMAP = ../../../../libses/libses_api.map
62
63C99MODE = $(C99_ENABLE)
64CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) $(CC_PICFLAGS)
65CFLAGS += -G $(XREGSFLAG)
66CFLAGS64 += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST) $(CC_PICFLAGS)
67CFLAGS64 += -G $(XREGSFLAG)
68CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
69$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
70LDFLAGS += $(ZTEXT) $(ZCOMBRELOC) $(ZIGNORE)
71
72$(PROG) := LDFLAGS += $(ZDEFS) -M$(APIMAP)
73$(PROG) := LDLIBS += -lc -lnvpair
74
75$(DMODPROG) := LDFLAGS += $(ZNODEFS)
76