xref: /illumos-gate/usr/src/lib/cfgadm_plugins/pci/Makefile.com (revision 711890bc9379ceea66272dc8d4981812224ea86e)
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
28LIBRARY= pci.a
29VERS= .1
30OBJECTS= cfga.o pci_strings.o
31
32# include library definitions
33include ../../../Makefile.lib
34
35SRCDIR =	../common
36INS.dir.root.sys=       $(INS) -s -d -m $(DIRMODE) $@
37$(CH)INS.dir.root.sys=  $(INS) -s -d -m $(DIRMODE) -u root -g sys $@
38INS.dir.bin.bin=        $(INS) -s -d -m $(DIRMODE) $@
39$(CH)INS.dir.bin.bin=   $(INS) -s -d -m $(DIRMODE) -u bin -g bin $@
40
41USR_LIB_DIR		= $(ROOT)/usr/lib
42USR_LIB_DIR_CFGADM	= $(USR_LIB_DIR)/cfgadm
43USR_LIB_DIR_CFGADM_64	= $(USR_LIB_DIR_CFGADM)/$(MACH64)
44
45ROOTLIBDIR= $(USR_LIB_DIR_CFGADM)
46ROOTLIBDIR64= $(USR_LIB_DIR_CFGADM_64)
47
48SRCS=		../common/cfga.c $(SRC)/common/pci/pci_strings.c
49
50LIBS = $(DYNLIB)
51
52CPPFLAGS +=	-D_POSIX_PTHREAD_SEMANTICS
53CFLAGS +=	$(CCVERBOSE)
54LDLIBS +=	-lc -ldevice -ldevinfo -lrcm
55
56.KEEP_STATE:
57
58all: $(LIBS)
59
60lint:   lintcheck
61
62# Create target directories
63$(USR_LIB_DIR):
64	-$(INS.dir.root.sys)
65
66$(USR_LIB_DIR_CFGADM): $(USR_LIB_DIR)
67	-$(INS.dir.bin.bin)
68
69$(USR_LIB_DIR_CFGADM_64): $(USR_LIB_DIR_CFGADM)
70	-$(INS.dir.bin.bin)
71
72$(USR_LIB_DIR_CFGADM)/%: % $(USR_LIB_DIR_CFGADM)
73	-$(INS.file)
74
75$(USR_LIB_DIR_CFGADM_64)/%: % $(USR_LIB_DIR_CFGADM_64)
76	-$(INS.file)
77
78# include library targets
79include ../../../Makefile.targ
80
81pics/cfga.o: ../common/cfga.c
82	$(COMPILE.c) -o $@ ../common/cfga.c
83	$(POST_PROCESS_O)
84
85pics/pci_strings.o: $(SRC)/common/pci/pci_strings.c
86	$(COMPILE.c) -o $@ $(SRC)/common/pci/pci_strings.c
87	$(POST_PROCESS_O)
88