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.
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.
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]
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 PROG:sh = basename `cd ..; pwd`
35 # libproc is added individually as pwait doesn't need it.
36 # These are defined this way so lint can use them
39 LDLIBS_pfiles = -lproc -lnsl
40 LDLIBS_pflags = -lproc
42 LDLIBS_plgrp = -lproc -llgrp
44 LDLIBS_pmadvise = -lproc
48 LDLIBS_psecflags = -lproc -lproject
50 LDLIBS_pstack = -lproc -lc_db
53 LDLIBS_ptree = -lproc -lcontract
56 LDLIBS += $(LDLIBS_$(PROG))
58 CERRWARN_plgrp += -_gcc=-Wno-parentheses
60 CERRWARN_ppriv += -_gcc=-Wno-parentheses
61 CERRWARN_ppriv += -_gcc=-Wno-uninitialized
63 CERRWARN_ptree += -_gcc=-Wno-parentheses
65 CERRWARN_pstack += -_gcc=-Wno-uninitialized
66 CERRWARN_pstack += -_gcc=-Wno-clobbered
68 CERRWARN_pargs += -_gcc=-Wno-clobbered
69 CERRWARN_pargs += -_gcc=-Wno-type-limits
71 CERRWARN += $(CERRWARN_$(PROG))
73 # pargs depends on ../../common/elfcap components
74 # pmadvise depends on pmap components
76 ELFCAP = $(SRC)/common/elfcap
77 PMAP = $(SRC)/cmd/ptools/pmap
79 CPPFLAGS_pargs = -I$(ELFCAP)
81 SRCS_pargs = $(ELFCAP)/elfcap.c
83 CPPFLAGS_pmap = -I$(PMAP)
84 OBJS_pmap = pmap_common.o
85 SRCS_pmap = $(PMAP)/pmap_common.c
87 CPPFLAGS_pmadvise = -I$(PMAP)
88 OBJS_pmadvise = pmap_common.o
89 SRCS_pmadvise = $(PMAP)/pmap_common.c
91 CPPFLAGS += $(CPPFLAGS_$(PROG))
92 OBJS += $(OBJS_$(PROG))
93 SRCS += $(SRCS_$(PROG))
96 INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
97 $(LN) -s ../../bin/$(PROG) $(ROOTPROCBINSYMLINK)
101 elfcap.o: $(ELFCAP)/elfcap.c
102 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
104 pmap_common.o: $(PMAP)/pmap_common.c
105 $(COMPILE.c) -o $@ $(PMAP)/pmap_common.c
112 ROOTBINPROG=$(ROOTBIN)/$(PROG)
113 ROOTPROCBINSYMLINK=$(ROOT)/usr/proc/bin/$(PROG)
116 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
120 # Install the ptool, symlinking it into /usr/proc/bin if PTOOL_TYPE is set
123 install: all $(ROOTISAPROG)
124 -$(RM) $(ROOTBINPROG)
125 -$(LN) $(ISAEXEC) $(ROOTBINPROG)
126 -$(INSTALL_$(PTOOL_TYPE))
132 $(LINT.c) $(SRCS) $(LDLIBS)