Print this page
Reduce lint
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/cmd/ptools/Makefile.bld
+++ new/usr/src/cmd/ptools/Makefile.bld
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21
22 22 #
23 23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 26
27 27 PROG:sh = basename `cd ..; pwd`
28 28
29 29 OBJS = $(PROG).o
30 30
31 31 SRCS = ../$(PROG).c
32 32
33 33 FILEMODE = 0555
34 34
35 35 # libproc is added individually as pwait doesn't need it.
36 36 # These are defined this way so lint can use them
37 37 LDLIBS_pargs = -lproc
38 38 LDLIBS_pcred = -lproc
39 39 LDLIBS_pfiles = -lproc -lnsl
40 40 LDLIBS_pflags = -lproc
41 41 LDLIBS_pldd = -lproc
42 42 LDLIBS_plgrp = -lproc -llgrp
43 43 LDLIBS_pmap = -lproc
44 44 LDLIBS_pmadvise = -lproc
45 45 LDLIBS_ppriv = -lproc
46 46 LDLIBS_preap = -lproc
47 47 LDLIBS_prun = -lproc
48 48 LDLIBS_psig = -lproc
49 49 LDLIBS_pstack = -lproc -lc_db
50 50 LDLIBS_pstop = -lproc
51 51 LDLIBS_ptime = -lproc
52 52 LDLIBS_ptree = -lproc -lcontract
53 53 LDLIBS_pwdx = -lproc
54 54
55 55 LDLIBS += $(LDLIBS_$(PROG))
56 56
57 57 CERRWARN_plgrp += -_gcc=-Wno-parentheses
58 58
59 59 CERRWARN_ppriv += -_gcc=-Wno-parentheses
60 60 CERRWARN_ppriv += -_gcc=-Wno-uninitialized
61 61
62 62 CERRWARN_ptree += -_gcc=-Wno-parentheses
63 63
64 64 CERRWARN_pstack += -_gcc=-Wno-uninitialized
65 65 CERRWARN_pstack += -_gcc=-Wno-clobbered
66 66
67 67 CERRWARN_pargs += -_gcc=-Wno-clobbered
68 68 CERRWARN_pargs += -_gcc=-Wno-type-limits
69 69
70 70 CERRWARN += $(CERRWARN_$(PROG))
71 71
72 72 #
73 73 # Common code definitions
74 74 #
75 75 COBJS = ptools_common.o
76 76 CINC = -I../../common
77 77
78 78 # pargs depends on ../../common/elfcap components
79 79 # pmadvise depends on pmap components
80 80
81 81 ELFCAP = $(SRC)/common/elfcap
82 82 PMAP = $(SRC)/cmd/ptools/pmap
83 83
84 84 CPPFLAGS_pargs = -I$(ELFCAP)
85 85 OBJS_pargs = elfcap.o
86 86 SRCS_pargs = $(ELFCAP)/elfcap.c
87 87
88 88 CPPFLAGS_pmap = -I$(PMAP) $(CINC)
89 89 OBJS_pmap = pmap_common.o $(COBJS)
90 90 SRCS_pmap = $(PMAP)/pmap_common.c
91 91
92 92 CPPFLAGS_pmadvise = -I$(PMAP) $(CINC)
93 93 OBJS_pmadvise = pmap_common.o $(COBJS)
94 94 SRCS_pmadvise = $(PMAP)/pmap_common.c
95 95
96 96 CPPFLAGS_preap = $(CINC)
97 97 OBJS_preap = $(COBJS)
98 98
99 99 CPPFLAGS_psig = $(CINC)
100 100 OBJS_psig = $(COBJS)
101 101
102 102 CPPFLAGS_ptime = $(CINC)
103 103 OBJS_ptime = $(COBJS)
104 104
105 105 CPPFLAGS_ptree = $(CINC)
106 106 OBJS_ptree = $(COBJS)
107 107
|
↓ open down ↓ |
107 lines elided |
↑ open up ↑ |
108 108 CPPFLAGS_pwait = $(CINC)
109 109 OBJS_pwait = $(COBJS)
110 110
111 111 CPPFLAGS_pwdx = $(CINC)
112 112 OBJS_pwdx = $(COBJS)
113 113
114 114 CPPFLAGS += $(CPPFLAGS_$(PROG))
115 115 OBJS += $(OBJS_$(PROG))
116 116 SRCS += $(SRCS_$(PROG))
117 117
118 +# For lint, always include ptools_common.c, but suppress the "defined but
119 +# not used" error, in case a given ptool doesn't need it.
120 +SRCS += ../../common/ptools_common.c
121 +LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
122 +LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2
123 +
118 124 INSTALL_NEW=
119 125 INSTALL_LEGACY=$(RM) $(ROOTPROCBINSYMLINK) ; \
120 126 $(LN) -s ../../bin/$(PROG) $(ROOTPROCBINSYMLINK)
121 127
122 128 .KEEP_STATE:
123 129
124 130 elfcap.o: $(ELFCAP)/elfcap.c
125 131 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
126 132
127 133 pmap_common.o: $(PMAP)/pmap_common.c
128 134 $(COMPILE.c) -o $@ $(PMAP)/pmap_common.c
129 135
130 136 %.o: ../%.c
131 137 $(COMPILE.c) $<
132 138
133 139 %.o: ../../common/%.c
134 140 $(COMPILE.c) $<
135 141 $(POST_PROCESS_O)
136 142
137 143 all: $(PROG)
138 144
139 145 ROOTBINPROG=$(ROOTBIN)/$(PROG)
140 146 ROOTPROCBINSYMLINK=$(ROOT)/usr/proc/bin/$(PROG)
141 147
142 148 $(PROG): $$(OBJS)
143 149 $(LINK.c) $(OBJS) -o $@ $(LDLIBS)
144 150 $(POST_PROCESS)
145 151
146 152 #
147 153 # Install the ptool, symlinking it into /usr/proc/bin if PTOOL_TYPE is set
148 154 # to LEGACY.
149 155 #
150 156 install: all $(ROOTISAPROG)
151 157 -$(RM) $(ROOTBINPROG)
152 158 -$(LN) $(ISAEXEC) $(ROOTBINPROG)
153 159 -$(INSTALL_$(PTOOL_TYPE))
154 160
155 161 clean:
156 162 $(RM) $(OBJS)
157 163
158 164 lint:
159 165 $(LINT.c) $(SRCS) $(LDLIBS)
|
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX