xref: /titanic_41/usr/src/cmd/pcidr/plugins/default/Makefile (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#ident	"%Z%%M%	%I%	%E% SMI"
27#
28# cmd/pcidr/plugins/default/Makefile
29#
30
31.PARALLEL:
32
33#############################################################################
34
35NAME = pcidr_plugin
36LIBRARY = $(NAME).a
37VERS =
38
39TOPOBJECTS = pcidr_common.o
40LOCOBJECTS = $(NAME).o pcidr_cfga.o
41OBJECTS = $(LOCOBJECTS) $(TOPOBJECTS)
42
43include $(SRC)/lib/Makefile.lib
44include $(SRC)/cmd/pcidr/Makefile.com
45#############################################################################
46
47THISDIR = $(TOP)/plugins/default
48
49# SRCS is used by the lintcheck rule and is defined as
50# $(OBJECTS:%.o=$(SRCDIR)/%.c) where SRCDIR is this directory; set SRCS to a
51# list of source paths if it differ from the default
52#
53SRCS = $(TOPOBJECTS:%.o=$(TOP)/%.c) $(LOCOBJECTS:%.o=$(SRCDIR)/%.c)
54
55LIBS = $(DYNLIB)
56
57LDLIBS += -lcfgadm -lnvpair
58
59HDRSRCS_SH = ls -1 $(THISDIR)/*.h
60HDRSRCS = $(HDRSRCS_SH:sh)
61CPPFLAGS += -I$(THISDIR)
62
63# override LIBLINKS so that ROOTLIBS or anything else won't match the install
64# target "$(ROOTLIBDIR)/$(LIBLINKS)"
65#
66LIBLINKS = __no_liblinks__
67
68.KEEP_STATE:
69#############################################################################
70
71all: $(LIBS)
72install: $(ROOTLIBS)
73clean:
74clobber:
75lint: lintcheck
76
77$(ROOTLIBS): all
78
79# Note that we can't do:
80#	$(TOPOBJECTS:%=objs/%) := SRCDIR = $(TOP)
81# and let the make do the rest because the man page states:
82# "Notice that if a conditional macro is referred to in a  dependency list,
83#  the $ must be delayed (use $$ instead)."
84#
85# So we must add new targets for our TOPOBJECTS items but follow
86# the existing pic/*.o and objs/*.o rules in lib/Makefile.targ
87#
88objs/%.o pics/%.o: $(TOP)/%.c
89	$(COMPILE.c) -o $@ $<
90	$(POST_PROCESS_O)
91
92include $(SRC)/lib/Makefile.targ
93include ../Makefile.targ
94