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