xref: /titanic_44/usr/src/cmd/pcidr/plugins/default/Makefile (revision 62a24de03df1f2399ceda704cb3874dabc98bbbd)
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# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28.PARALLEL:
29
30#############################################################################
31
32NAME = pcidr_plugin
33LIBRARY = $(NAME).a
34VERS =
35
36TOPOBJECTS = pcidr_common.o
37LOCOBJECTS = $(NAME).o pcidr_cfga.o
38OBJECTS = $(LOCOBJECTS) $(TOPOBJECTS)
39
40include $(SRC)/lib/Makefile.lib
41include $(SRC)/cmd/pcidr/Makefile.com
42#############################################################################
43
44THISDIR = $(TOP)/plugins/default
45
46# SRCS is used by the lintcheck rule and is defined as
47# $(OBJECTS:%.o=$(SRCDIR)/%.c) where SRCDIR is this directory; set SRCS to a
48# list of source paths if it differ from the default
49#
50
51SRCDIR = .
52SRCS = $(TOPOBJECTS:%.o=$(TOP)/%.c) $(LOCOBJECTS:%.o=$(SRCDIR)/%.c)
53
54LIBS = $(DYNLIB)
55
56LDLIBS += -lcfgadm -lnvpair
57
58HDRSRCS_SH = ls -1 $(THISDIR)/*.h
59HDRSRCS = $(HDRSRCS_SH:sh)
60CPPFLAGS += -I$(THISDIR)
61
62# override LIBLINKS so that ROOTLIBS or anything else won't match the install
63# target "$(ROOTLIBDIR)/$(LIBLINKS)"
64#
65LIBLINKS = __no_liblinks__
66
67.KEEP_STATE:
68#############################################################################
69
70all: $(LIBS)
71install: $(ROOTLIBS)
72clean:
73clobber:
74lint: lintcheck
75
76$(ROOTLIBS): all
77
78# Note that we can't do:
79#	$(TOPOBJECTS:%=objs/%) := SRCDIR = $(TOP)
80# and let the make do the rest because the man page states:
81# "Notice that if a conditional macro is referred to in a  dependency list,
82#  the $ must be delayed (use $$ instead)."
83#
84# So we must add new targets for our TOPOBJECTS items but follow
85# the existing pic/*.o and objs/*.o rules in lib/Makefile.targ
86#
87objs/%.o pics/%.o: $(TOP)/%.c
88	$(COMPILE.c) -o $@ $<
89	$(POST_PROCESS_O)
90
91include $(SRC)/lib/Makefile.targ
92include ../Makefile.targ
93