xref: /illumos-gate/usr/src/cmd/pcitool/Makefile.com (revision 581cede61ac9c14d8d4ea452562a567189eead78)
1# CDDL HEADER START
2#
3# The contents of this file are subject to the terms of the
4# Common Development and Distribution License (the "License").
5# You may not use this file except in compliance with the License.
6#
7# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8# or http://www.opensolaris.org/os/licensing.
9# See the License for the specific language governing permissions
10# and limitations under the License.
11#
12# When distributing Covered Code, include this CDDL HEADER in each
13# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14# If applicable, add the following below this CDDL HEADER, with the
15# fields enclosed by brackets "[]" replaced with your own identifying
16# information: Portions Copyright [yyyy] [name of copyright owner]
17#
18# CDDL HEADER END
19#
20# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
21# Use is subject to license terms.
22#
23
24PROG = pcitool
25OBJS = pcitool.o pcitool_ui.o pcitool_usage.o
26SRCS = $(OBJS:%.o=../%.c)
27
28#
29# Manpage is in the directory above platform-specific directory
30# from which this makefile is called.
31#
32MAN1MFILES = pcitool.1m
33MANFILE_SRC_PATH = ../$(MAN1MFILES)
34
35include $(SRC)/cmd/Makefile.cmd
36
37UTSBASE = ../../../../src/uts
38
39LDLIBS += -ldevinfo
40
41CFLAGS += -D$(MACH) -I$(UTSBASE)/common
42
43LINTFLAGS += -I$(UTSBASE)/common
44
45.KEEP_STATE:
46
47all: $(PROG) $(MANFILE_SRC_PATH)
48
49$(SUBDIRS):	FRC
50	@cd $@; pwd; $(MAKE) $(TARGET)
51
52$(PROG):	$(OBJS)
53	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
54	$(POST_PROCESS)
55
56$(ROOTMAN1M):
57	mkdir -p $(ROOTMAN1M)
58
59$(ROOTMAN1MFILES): $(MANFILE_SRC_PATH) $(ROOTMAN1M)
60	$(INS.file) $(MANFILE_SRC_PATH)
61
62install: all $(PROG) $(MANFILE_SRC_PATH)
63
64clean:
65	$(RM) $(OBJS) $(PROG)
66
67lint:
68	$(LINT.c) $(SRCS) $(LDLIBS)
69
70%.o:	../%.c
71	$(COMPILE.c) -o $@ $<
72
73include $(SRC)/cmd/Makefile.targ
74