xref: /illumos-gate/usr/src/cmd/pcidr/plugins/default/Makefile (revision f808c858fa61e7769218966759510a8b1190dfcf)
170025d76Sjohnny#
270025d76Sjohnny# CDDL HEADER START
370025d76Sjohnny#
470025d76Sjohnny# The contents of this file are subject to the terms of the
5*f808c858Sraf# Common Development and Distribution License (the "License").
6*f808c858Sraf# You may not use this file except in compliance with the License.
770025d76Sjohnny#
870025d76Sjohnny# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
970025d76Sjohnny# or http://www.opensolaris.org/os/licensing.
1070025d76Sjohnny# See the License for the specific language governing permissions
1170025d76Sjohnny# and limitations under the License.
1270025d76Sjohnny#
1370025d76Sjohnny# When distributing Covered Code, include this CDDL HEADER in each
1470025d76Sjohnny# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1570025d76Sjohnny# If applicable, add the following below this CDDL HEADER, with the
1670025d76Sjohnny# fields enclosed by brackets "[]" replaced with your own identifying
1770025d76Sjohnny# information: Portions Copyright [yyyy] [name of copyright owner]
1870025d76Sjohnny#
1970025d76Sjohnny# CDDL HEADER END
2070025d76Sjohnny#
2170025d76Sjohnny#
22*f808c858Sraf# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2370025d76Sjohnny# Use is subject to license terms.
2470025d76Sjohnny#
2570025d76Sjohnny# ident	"%Z%%M%	%I%	%E% SMI"
2670025d76Sjohnny#
2770025d76Sjohnny
2870025d76Sjohnny.PARALLEL:
2970025d76Sjohnny
3070025d76Sjohnny#############################################################################
3170025d76Sjohnny
3270025d76SjohnnyNAME = pcidr_plugin
3370025d76SjohnnyLIBRARY = $(NAME).a
3470025d76SjohnnyVERS =
3570025d76Sjohnny
3670025d76SjohnnyTOPOBJECTS = pcidr_common.o
3770025d76SjohnnyLOCOBJECTS = $(NAME).o pcidr_cfga.o
3870025d76SjohnnyOBJECTS = $(LOCOBJECTS) $(TOPOBJECTS)
3970025d76Sjohnny
4070025d76Sjohnnyinclude $(SRC)/lib/Makefile.lib
4170025d76Sjohnnyinclude $(SRC)/cmd/pcidr/Makefile.com
4270025d76Sjohnny#############################################################################
4370025d76Sjohnny
4470025d76SjohnnyTHISDIR = $(TOP)/plugins/default
4570025d76Sjohnny
4670025d76Sjohnny# SRCS is used by the lintcheck rule and is defined as
4770025d76Sjohnny# $(OBJECTS:%.o=$(SRCDIR)/%.c) where SRCDIR is this directory; set SRCS to a
4870025d76Sjohnny# list of source paths if it differ from the default
4970025d76Sjohnny#
50*f808c858Sraf
51*f808c858SrafSRCDIR = .
5270025d76SjohnnySRCS = $(TOPOBJECTS:%.o=$(TOP)/%.c) $(LOCOBJECTS:%.o=$(SRCDIR)/%.c)
5370025d76Sjohnny
5470025d76SjohnnyLIBS = $(DYNLIB)
5570025d76Sjohnny
5670025d76SjohnnyLDLIBS += -lcfgadm -lnvpair
5770025d76Sjohnny
5870025d76SjohnnyHDRSRCS_SH = ls -1 $(THISDIR)/*.h
5970025d76SjohnnyHDRSRCS = $(HDRSRCS_SH:sh)
6070025d76SjohnnyCPPFLAGS += -I$(THISDIR)
6170025d76Sjohnny
6270025d76Sjohnny# override LIBLINKS so that ROOTLIBS or anything else won't match the install
6370025d76Sjohnny# target "$(ROOTLIBDIR)/$(LIBLINKS)"
6470025d76Sjohnny#
6570025d76SjohnnyLIBLINKS = __no_liblinks__
6670025d76Sjohnny
6770025d76Sjohnny.KEEP_STATE:
6870025d76Sjohnny#############################################################################
6970025d76Sjohnny
7070025d76Sjohnnyall: $(LIBS)
7170025d76Sjohnnyinstall: $(ROOTLIBS)
7270025d76Sjohnnyclean:
7370025d76Sjohnnyclobber:
7470025d76Sjohnnylint: lintcheck
7570025d76Sjohnny
7670025d76Sjohnny$(ROOTLIBS): all
7770025d76Sjohnny
7870025d76Sjohnny# Note that we can't do:
7970025d76Sjohnny#	$(TOPOBJECTS:%=objs/%) := SRCDIR = $(TOP)
8070025d76Sjohnny# and let the make do the rest because the man page states:
8170025d76Sjohnny# "Notice that if a conditional macro is referred to in a  dependency list,
8270025d76Sjohnny#  the $ must be delayed (use $$ instead)."
8370025d76Sjohnny#
8470025d76Sjohnny# So we must add new targets for our TOPOBJECTS items but follow
8570025d76Sjohnny# the existing pic/*.o and objs/*.o rules in lib/Makefile.targ
8670025d76Sjohnny#
8770025d76Sjohnnyobjs/%.o pics/%.o: $(TOP)/%.c
8870025d76Sjohnny	$(COMPILE.c) -o $@ $<
8970025d76Sjohnny	$(POST_PROCESS_O)
9070025d76Sjohnny
9170025d76Sjohnnyinclude $(SRC)/lib/Makefile.targ
9270025d76Sjohnnyinclude ../Makefile.targ
93