Print this page
10080 smatch Makefile changes for usr/src/cmd
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/cron/Makefile
+++ new/usr/src/cmd/cron/Makefile
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.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
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 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 +# Copyright (c) 2018, Joyent, Inc.
25 26
26 27 DEFAULTFILES = cron.dfl
27 28
28 29 include ../Makefile.cmd
29 30
30 31 MANIFEST = cron.xml
31 32
32 33 ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
33 34 ROOTMETHOD = $(ROOTLIBSVCMETHOD)/svc-cron
34 35
35 36 CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
36 37 CERRWARN += -_gcc=-Wno-parentheses
37 38 CERRWARN += -_gcc=-Wno-unused-label
38 39 CERRWARN += -_gcc=-Wno-uninitialized
39 40 CERRWARN += -_gcc=-Wno-unused-variable
40 41 CERRWARN += -_gcc=-Wno-unused-value
41 42
43 +# not linted
44 +SMATCH=off
45 +
42 46 ROOTVAR = $(ROOT)/var
43 47
44 48 ROOTSPCRON = $(ROOTVAR)/spool/cron
45 49 ROOTCROND = $(ROOTETC)/cron.d
46 50 ROOTCRONTABS = $(ROOTSPCRON)/crontabs
47 51 ROOTATJOBS = $(ROOTSPCRON)/atjobs
48 52 ROOTLIBCRON = $(ROOTLIB)/cron
49 53
50 54 PROG1 = cron
51 55 PROG2 = at atq atrm crontab
52 56 XPG6PROG = crontab
53 57 XPG4PROG = at crontab
54 58 PROG = $(PROG1) $(PROG2)
55 59
56 60 SCRIPT = batch
57 61 XPG4SCRIPT = batch.xpg4
58 62
59 63 POFILE= $(PROG1)_cmd.po
60 64 POFILES1= at.po crontab.po funcs.po batch.po
61 65 POFILES= $(POFILES1) atrm.po
62 66 $(POFILES1) := XGETFLAGS= -a -x $(PROG1).xcl
63 67
64 68 ROOTDIRS = $(ROOTSPCRON) $(ROOTCROND) \
65 69 $(ROOTCRONTABS) $(ROOTATJOBS)
66 70
67 71 ROOTPROG = $(PROG1:%=$(ROOTUSRSBIN)/%) $(PROG2:%=$(ROOTBIN)/%) \
68 72 $(SCRIPT:%=$(ROOTBIN)/%) \
69 73 $(XPG6PROG:%=$(ROOTXPG6BIN)/%) \
70 74 $(XPG4PROG:%=$(ROOTXPG4BIN)/%) \
71 75 $(XPG4SCRIPT:%.xpg4=$(ROOTXPG4BIN)/%)
72 76
73 77 ROOTSYMLINK = $(ROOTLIBCRON) $(ROOTETC)/cron
74 78
75 79 GETRESPSRC= $(SRC)/common/util/getresponse.c
76 80 GETRESPOBJ= getresponse.o
77 81 COMMONOBJ1= permit.o
78 82 COMMONOBJ2= funcs.o
79 83 COMMONOBJS= $(COMMONOBJ1) $(COMMONOBJ2)
80 84 CRONOBJS= cron.o elm.o
81 85 ATOBJS= at.o att1.o att2.o
82 86 XPG4OBJS= values-xpg4.o
83 87 ATRMOBJS1= atrm.o
84 88 ATRMOBJS= $(ATRMOBJS1) $(GETRESPOBJ)
85 89 ATQOBJS= atq.o
86 90 CRONTABOBJS1= crontab.o
87 91 CRONTABOBJS= $(CRONTABOBJS1) $(GETRESPOBJ)
88 92
89 93 # /usr/xpg*/bin/crontab isn't linked with values-xpg*.o since it isn't
90 94 # required by any specific behavior differences; this makes these
91 95 # setuid variants less likely to accidently trip over differences that
92 96 # could unintentionally open up a security hole.
93 97 XPG4COMMONOBJS= $(COMMONOBJS:%=objs.xpg4/%)
94 98 XPG4CTOBJS= $(CRONTABOBJS:%=objs.xpg4/%)
95 99 XPG4ATOBJS= $(ATOBJS:%=objs.xpg4/%) $(XPG4OBJS:%=objs.xpg4/%)
96 100 XPG6COMMONOBJS= $(COMMONOBJS:%=objs.xpg6/%)
97 101 XPG6CTOBJS= $(CRONTABOBJS:%=objs.xpg6/%)
98 102
99 103 cron := POBJS = $(CRONOBJS) $(COMMONOBJ2)
100 104 at := POBJS = $(ATOBJS) $(COMMONOBJS)
101 105 at.xpg4 := POBJS = $(XPG4ATOBJS) $(XPG4COMMONOBJS)
102 106 atrm := POBJS = $(ATRMOBJS) $(COMMONOBJS)
103 107 atq := POBJS = $(ATQOBJS) $(COMMONOBJS)
104 108 crontab := POBJS = $(CRONTABOBJS) $(COMMONOBJS)
105 109 crontab.xpg4 := POBJS = $(XPG4CTOBJS) $(XPG4COMMONOBJS)
106 110 crontab.xpg6 := POBJS = $(XPG6CTOBJS) $(XPG6COMMONOBJS)
107 111
108 112 CFLAGS += $(CCVERBOSE)
109 113
110 114 NOBJS= $(CRONOBJS) $(ATOBJS) $(ATRMOBJS1) $(ATQOBJS) $(CRONTABOBJS1) \
111 115 $(COMMONOBJS)
112 116 OBJS = $(NOBJS) $(XPG4COMMONOBJS) $(XPG4ATOBJS) $(XPG4CTOBJS) \
113 117 $(XPG6COMMONOBJS) $(XPG6CTOBJS) $(GETRESPOBJ)
114 118
115 119 SRCS = $(NOBJS:%.o=%.c) $(GETRESPSRC)
116 120
117 121 CLOBBERFILES += $(SCRIPT) $(XPG4SCRIPT)
118 122
119 123 $(ROOTLIBCRON) := SYMLNKDEST = ../../etc/cron.d
120 124 $(ROOTETC)/cron := SYMLNKDEST = ../usr/sbin/cron
121 125
122 126 $(ROOTBIN)/at := FILEMODE = 04755
123 127 $(ROOTXPG4BIN)/at := FILEMODE = 04755
124 128 $(ROOTBIN)/atrm := FILEMODE = 04755
125 129 $(ROOTBIN)/atq := FILEMODE = 04755
126 130 $(ROOTBIN)/crontab := FILEMODE = 04555
127 131 $(ROOTXPG6BIN)/crontab := FILEMODE = 04555
128 132 $(ROOTXPG4BIN)/crontab := FILEMODE = 04555
129 133 $(ROOTUSRSBIN)/cron := FILEMODE = 0555
130 134
131 135 LDLIBS += -lbsm
132 136
133 137 at := LDLIBS += -lproject -lsecdb
134 138 at.xpg4 := LDLIBS += -lproject -lsecdb
135 139 atq := LDLIBS += -lsecdb
136 140 atrm := LDLIBS += -lsecdb
137 141 cron := LDLIBS += -lpam -lproject -lcontract -lzoneinfo
138 142 crontab := LDLIBS += -lsecdb -lpam -lzoneinfo
139 143 crontab.xpg6 := LDLIBS += -lsecdb -lpam -lzoneinfo
140 144 crontab.xpg4 := LDLIBS += -lsecdb -lpam -lzoneinfo
141 145
142 146 lint := LDLIBS += -lproject -lsecdb -lcontract -lpam
143 147
144 148 $(XPG4) := CFLAGS += -DXPG4
145 149 $(XPG6) := CFLAGS += -DXPG6
146 150
147 151 LINTFLAGS += -u
148 152
149 153 $(ROOTSVCSYSTEM)/cron.xml := FILEMODE = 0444
150 154 $(ROOTLIBSVCMETHOD)/svc-cron := FILEMODE = 0555
151 155
152 156
153 157 .KEEP_STATE:
154 158
155 159 all : $(PROG) $(XPG4) $(XPG6) $(SCRIPT) $(XPG4SCRIPT) $(FILES)
156 160
157 161 install : all $(ROOTPROG) $(ROOTETCDEFAULTFILES) $(ROOTSYMLINK) \
158 162 $(ROOTMANIFEST) $(ROOTMETHOD)
159 163
160 164 $(PROG) : $$(POBJS)
161 165 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
162 166 $(POST_PROCESS)
163 167
164 168 $(XPG4) : objs.xpg4 $$(POBJS)
165 169 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
166 170 $(POST_PROCESS)
167 171
168 172 $(XPG6) : objs.xpg6 $$(POBJS)
169 173 $(LINK.c) $(POBJS) -o $@ $(LDLIBS)
170 174 $(POST_PROCESS)
171 175
172 176 objs.xpg6/%.o: %.c
173 177 $(COMPILE.c) -o $@ $<
174 178
175 179 objs.xpg6:
176 180 -@mkdir -p $@
177 181
178 182 objs.xpg4/%.o: %.c
179 183 $(COMPILE.c) -o $@ $<
180 184
181 185 objs.xpg4:
182 186 -@mkdir -p $@
183 187
184 188 objs.xpg4/values-xpg4.o: ../../lib/crt/common/values-xpg4.c
185 189 $(COMPILE.c) -o $@ ../../lib/crt/common/values-xpg4.c
186 190
187 191 %.o: $(SRC)/common/util/%.c
188 192 $(COMPILE.c) $(OUTPUT_OPTION) $<
189 193 $(POST_PROCESS_O)
190 194
191 195 objs.xpg4/%.o: $(SRC)/common/util/%.c
192 196 $(COMPILE.c) -o $@ $<
193 197 $(POST_PROCESS_O)
194 198
195 199 objs.xpg6/%.o: $(SRC)/common/util/%.c
196 200 $(COMPILE.c) -o $@ $<
197 201 $(POST_PROCESS_O)
198 202
199 203 att1.c : att1.y
200 204 $(YACC.y) -d att1.y
201 205 $(MV) y.tab.c att1.c
202 206 $(MV) y.tab.h att1.h
203 207
204 208 att2.c : att2.l att2.ed att1.c
205 209 $(LEX) att2.l
206 210 ed - lex.yy.c < att2.ed
207 211 $(MV) lex.yy.c att2.c
208 212
209 213 # Don't re-install directories installed by Targetdirs
210 214 #$(ROOTDIRS):
211 215 # $(INS.dir)
212 216
213 217 $(ROOTSYMLINK) :
214 218 $(RM) $@; $(SYMLINK) $(SYMLNKDEST) $@
215 219
216 220 check: $(CHKMANIFEST)
217 221
218 222 $(POFILE): $(POFILES)
219 223 $(RM) $@; cat $(POFILES) > $@
220 224
221 225 clean :
222 226 $(RM) $(OBJS) att1.h att1.c att2.c
223 227
224 228 lint : lint_SRCS
225 229
226 230 strip :
227 231 $(STRIP) $(PROG) $(XPG4) $(XPG6)
228 232
229 233 include ../Makefile.targ
↓ open down ↓ |
178 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX