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