Makefile.plugin revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License"). You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
.KEEP_STATE:
.SUFFIXES:
include ../../../../../Makefile.cmd
#
# Set PROG and OBJS based on the values of MODULE and SRCS. We expect that
# these macros to be defined by the Makefile that is including this file.
#
PROG = $(MODULE:%=%.so)
TOPO = $(MODULE:%=%.topo)
YOBJS = $(YSRCS:%.y=%.o)
OBJS = $(YOBJS) $(SRCS:%.c=%.o)
#
# Set ROOTPROG and ROOTTOPO based on the values of MODULE, CLASS, and PLATFORMS
# We expect these macros to be defined by the Makefile that is including us.
#
common_TOPODIR = $(ROOT)/usr/lib/fm/topo
arch_TOPODIR = $(ROOT)/usr/lib/fm/topo/$(ARCH)
ROOT_TOPO_DIR = $($(CLASS)_TOPODIR)
ROOTPROG = $(ROOT_TOPO_DIR)/$(PROG)
ROOTTOPO = $(ROOT_TOPO_DIR)/$(TOPO)
LINTFLAGS += -mu
LINTFILES = $(SRCS:%.c=%.ln)
LINTLDLIBS += -L$(ROOTLIB)/fm -ltopo
CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) -xstrconst -K pic -G $(XREGSFLAG)
CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
LDFLAGS += -z text -z combreloc -z defs -z ignore -R/usr/lib/fm
LDLIBS += -L$(ROOTLIB)/fm -ltopo -lc
#
# Reset STRIPFLAG to the empty string. FMA modules are intentionally installed
# with symbol tables in order to help module developers.
#
STRIPFLAG =
all: $(PROG)
.NO_PARALLEL:
.PARALLEL: $(OBJS) $(LINTFILES)
$(PROG): $(OBJS)
$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
$(CTFMERGE) -L VERSION -o $@ $(OBJS)
$(POST_PROCESS_SO)
%.o: %.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
clean:
$(RM) $(OBJS) $(LINTFILES)
clobber: clean
$(RM) $(PROG)
%.ln: %.c
$(LINT.c) -c $<
lint: $(LINTFILES)
$(LINT) $(LINTFLAGS) $(LINTFILES) $(LDLIBS)
install_h:
$(ROOTPROG): $$(@D) $(PROG)
$(RM) $@; $(INS) -s -m 0555 -f $(@D) $(PROG)
$(ROOTTOPO): $$(@D) $(TOPO)
$(RM) $@; $(INS) -s -m 0444 -f $(@D) $(TOPO)
install: $(ROOTTOPO) $(ROOTPROG)
include ../../../Makefile.rootdirs