Print this page
10079 smatch Makefile changes for usr/src/lib
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/lib/libsqlite/Makefile.com
+++ new/usr/src/lib/libsqlite/Makefile.com
1 1 #
2 2 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 3 # Use is subject to license terms.
4 4 # Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
5 5 # Copyright 2016 Nexenta Systems, Inc. All rights reserved.
6 +# Copyright (c) 2018, Joyent, Inc.
6 7 #
7 8
8 9 # Make the SO name unlikely to conflict with any other
9 10 # libsqlite that might also be found on the system.
10 11 LIBRARY = libsqlite-sys.a
11 12
12 13 VERS = .2.8.15
13 14 OBJECTS = \
14 15 attach.o \
15 16 auth.o \
16 17 btree.o \
17 18 btree_rb.o \
18 19 build.o \
19 20 copy.o \
20 21 date.o \
21 22 delete.o \
22 23 encode.o \
23 24 expr.o \
24 25 func.o \
25 26 hash.o \
26 27 insert.o \
27 28 main.o \
28 29 opcodes.o \
29 30 os.o \
30 31 pager.o \
31 32 parse.o \
32 33 pragma.o \
33 34 printf.o \
34 35 random.o \
35 36 select.o \
36 37 table.o \
37 38 tokenize.o \
38 39 trigger.o \
39 40 update.o \
40 41 util.o \
41 42 vacuum.o \
42 43 vdbe.o \
43 44 vdbeaux.o \
44 45 where.o
45 46
46 47 include $(SRC)/lib/Makefile.lib
47 48
48 49 # install this library in the root filesystem
49 50 include $(SRC)/lib/Makefile.rootfs
50 51
51 52 SRCDIR = ../src
52 53 TOOLDIR = ../tool
53 54 $(DYNLIB) := LDLIBS += -lc
54 55 LIBS = $(DYNLIB) $(LINTLIB) $(NATIVERELOC)
55 56
56 57 $(LINTLIB) := SRCS = ../$(LINTSRC)
57 58
58 59 # generated sources
59 60 GENSRC = opcodes.c parse.c
60 61
61 62 # all sources
62 63 SRCS = \
63 64 $(GENSRC) \
64 65 $(SRCDIR)/attach.c \
65 66 $(SRCDIR)/auth.c \
66 67 $(SRCDIR)/btree.c \
67 68 $(SRCDIR)/btree_rb.c \
68 69 $(SRCDIR)/build.c \
69 70 $(SRCDIR)/copy.c \
70 71 $(SRCDIR)/date.c \
71 72 $(SRCDIR)/delete.c \
72 73 $(SRCDIR)/encode.c \
73 74 $(SRCDIR)/expr.c \
74 75 $(SRCDIR)/func.c \
75 76 $(SRCDIR)/hash.c \
76 77 $(SRCDIR)/insert.c \
77 78 $(SRCDIR)/main.c \
78 79 $(SRCDIR)/os.c \
79 80 $(SRCDIR)/pager.c \
80 81 $(SRCDIR)/pragma.c \
81 82 $(SRCDIR)/printf.c \
82 83 $(SRCDIR)/random.c \
83 84 $(SRCDIR)/select.c \
84 85 $(SRCDIR)/table.c \
85 86 $(SRCDIR)/tokenize.c \
86 87 $(SRCDIR)/update.c \
87 88 $(SRCDIR)/util.c \
88 89 $(SRCDIR)/vacuum.c \
89 90 $(SRCDIR)/vdbe.c \
90 91 $(SRCDIR)/vdbeaux.c \
91 92 $(SRCDIR)/where.c \
↓ open down ↓ |
76 lines elided |
↑ open up ↑ |
92 93 $(SRCDIR)/trigger.c
93 94
94 95 MYCPPFLAGS = -D_REENTRANT -DTHREADSAFE=1 -DHAVE_USLEEP=1 -I. -I.. -I$(SRCDIR)
95 96 CPPFLAGS += $(MYCPPFLAGS)
96 97
97 98 CERRWARN += -_gcc=-Wno-implicit-function-declaration
98 99 CERRWARN += -_gcc=-Wno-uninitialized
99 100 CERRWARN += -_gcc=-Wno-unused-function
100 101 CERRWARN += -_gcc=-Wno-unused-label
101 102
103 +# not linted
104 +SMATCH=off
105 +
102 106 MAPFILES = ../mapfile-sqlite
103 107
104 108 # headers generated here
105 109 GENHDR = opcodes.h parse.h
106 110
107 111 # Header files used by all library source files.
108 112 #
109 113 HDR = \
110 114 $(GENHDR) \
111 115 $(SRCDIR)/btree.h \
112 116 $(SRCDIR)/config.h \
113 117 $(SRCDIR)/hash.h \
114 118 $(SRCDIR)/os.h \
115 119 ../sqlite.h \
116 120 $(SRCDIR)/sqliteInt.h \
117 121 $(SRCDIR)/vdbe.h \
118 122 $(SRCDIR)/vdbeInt.h
119 123
120 124 #
121 125 # Sources used for test harness
122 126 #
123 127 TESTSRC = \
124 128 $(SRCDIR)/tclsqlite.c \
125 129 $(SRCDIR)/btree.c \
126 130 $(SRCDIR)/func.c \
127 131 $(SRCDIR)/os.c \
128 132 $(SRCDIR)/pager.c \
129 133 $(SRCDIR)/test1.c \
130 134 $(SRCDIR)/test2.c \
131 135 $(SRCDIR)/test3.c \
132 136 $(SRCDIR)/md5.c
133 137
134 138 TESTOBJS = $(TESTSRC:$(SRCDIR)/%.c=%.o)
135 139
136 140 TESTCLEAN = $(TESTOBJS) test.db test.tcl test1.bt test2.db testdb
137 141
138 142 #
139 143 # Native variant (needed by cmd/configd)
140 144 #
141 145 NATIVERELOC = libsqlite-native.o
142 146 NATIVEPROGS = testfixture
143 147 NATIVEOBJS = $(OBJS:%.o=%-native.o)
144 148
145 149 NATIVETARGETS = $(NATIVEPROGS) $(NATIVEOBJS) $(NATIVERELOC)
146 150
147 151 $(NATIVETARGETS) := CC = $(NATIVECC)
148 152 $(NATIVETARGETS) := LD = $(NATIVELD)
149 153 $(NATIVETARGETS) := CFLAGS = $(NATIVE_CFLAGS)
150 154 $(NATIVETARGETS) := CPPFLAGS = $(MYCPPFLAGS)
151 155 $(NATIVETARGETS) := LDFLAGS =
152 156 $(NATIVETARGETS) := LDLIBS = -lc
153 157
154 158 $(OBJS) := CFLAGS += $(CTF_FLAGS)
155 159 $(OBJS) := CTFCONVERT_POST = $(CTFCONVERT_O)
156 160
157 161 TCLBASE = /usr/sfw
158 162 TCLVERS = tcl8.3
159 163
160 164 testfixture := MYCPPFLAGS += -I$(TCLBASE)/include -DTCLSH -DSQLITE_TEST=1
161 165 #
162 166 # work around compiler issues
163 167 #
164 168 testfixture := CFLAGS += \
165 169 -erroff=E_ARRAY_OF_INCOMPLETE \
166 170 -erroff=E_ARG_INCOMPATIBLE_WITH_ARG
167 171
168 172 testfixture := LDLIBS += -R$(TCLBASE)/lib -L$(TCLBASE)/lib -l$(TCLVERS) -lm -ldl
169 173
170 174 CLEANFILES += \
171 175 $(NATIVETARGETS) \
172 176 $(TESTCLEAN) \
173 177 lemon \
174 178 lemon.o \
175 179 lempar.c \
176 180 opcodes.c \
177 181 opcodes.h \
178 182 parse_tmp.c \
179 183 parse_tmp.h \
180 184 parse_tmp.out \
181 185 parse_tmp.y \
182 186 parse.c \
183 187 parse.h
184 188
185 189 ENCODING = ISO8859
186 190
187 191
188 192 .PARALLEL: $(OBJS) $(OBJS:%.o=%-native.o)
189 193 .KEEP_STATE:
190 194
191 195 # This is the default Makefile target. The objects listed here
192 196 # are what get build when you type just "make" with no arguments.
193 197 #
194 198 all: $(LIBS)
195 199 install: all \
196 200 $(ROOTLIBDIR)/$(DYNLIB) \
197 201 $(ROOTLIBDIR)/$(LINTLIB) \
198 202 $(ROOTLIBDIR)/$(NATIVERELOC)
199 203
200 204 lint:
201 205
202 206 all_h: $(GENHDR)
203 207
204 208 $(ROOTLIBDIR)/$(NATIVERELOC) := FILEMODE= 644
205 209 $(ROOTLINTDIR)/$(LINTLIB) := FILEMODE= 644
206 210
207 211 $(ROOTLINK): $(ROOTLIBDIR) $(ROOTLIBDIR)/$(DYNLIB)
208 212 $(INS.liblink)
209 213
210 214 $(ROOTLINTDIR)/%: ../%
211 215 $(INS.file)
212 216
213 217 native: $(NATIVERELOC)
214 218
215 219 $(NATIVERELOC): objs .WAIT $(OBJS:%.o=%-native.o)
216 220 $(LD) -r -o $(NATIVERELOC) $(OBJS:%.o=%-native.o)
217 221
218 222 opcodes.h: $(SRCDIR)/vdbe.c
219 223 @echo "Generating $@"; \
220 224 $(RM) -f $@ ; \
221 225 echo '/* Automatically generated file. Do not edit */' > $@ ; \
222 226 grep '^case OP_' $(SRCDIR)/vdbe.c | \
223 227 sed -e 's/://' | \
224 228 $(AWK) '{printf "#define %-30s %3d\n", $$2, ++cnt}' >> $@
225 229
226 230 opcodes.c: $(SRCDIR)/vdbe.c
227 231 @echo "Generating $@"; \
228 232 $(RM) -f $@ ; \
229 233 echo '/* Automatically generated file. Do not edit */' > $@ ; \
230 234 echo 'char *sqliteOpcodeNames[] = { "???", ' >> $@ ; \
231 235 grep '^case OP_' $(SRCDIR)/vdbe.c | \
232 236 sed -e 's/^.*OP_/ "/' -e 's/:.*$$/", /' >> $@ ; \
233 237 echo '};' >> $@
234 238
235 239 testfixture: FRC
236 240 @if [ -f $(TCLBASE)/include/tcl.h ]; then \
237 241 unset SUNPRO_DEPENDENCIES; \
238 242 echo $(LINK.c) -o testfixture $(TESTSRC) $(LIBRARY) $(LDLIBS) ;\
239 243 exec $(LINK.c) -o testfixture $(TESTSRC) $(LIBRARY) $(LDLIBS) ;\
240 244 else \
241 245 echo "$(TCLBASE)/include/tcl.h: not found."; \
242 246 exit 1; \
243 247 fi
244 248
245 249 # Prevent Makefile.lib $(PICS) := from adding PICFLAGS
246 250 # by building lemon in a recursive make invocation.
247 251 # Otherwise, this target causes a rebuild every time after
248 252 # the PICS target builds this one way, then lint the other.
249 253 parse.h parse.c : $(SRCDIR)/parse.y $(TOOLDIR)/lemon.c $(TOOLDIR)/lempar.c
250 254 -$(RM) parse_tmp.y lempar.c
251 255 $(CP) $(SRCDIR)/parse.y parse_tmp.y
252 256 $(CP) $(TOOLDIR)/lempar.c lempar.c
253 257 $(MAKE) lemon
254 258 ./lemon parse_tmp.y
255 259 -$(RM) parse.c parse.h
256 260 $(CP) parse_tmp.h parse.h
257 261 $(CP) parse_tmp.c parse.c
258 262
259 263 lemon: $(TOOLDIR)/lemon.c
260 264 $(NATIVECC) $(NATIVE_CFLAGS) -o $@ $(TOOLDIR)/lemon.c
261 265
262 266 objs/%-native.o: $(SRCDIR)/%.c $(GENHDR)
263 267 $(COMPILE.c) -o $@ $<
264 268 $(POST_PROCESS_O)
265 269
266 270 objs/%-native.o: %.c $(GENHDR)
267 271 $(COMPILE.c) -o $@ $<
268 272 $(POST_PROCESS_O)
269 273
270 274 objs/parse-native.o: parse.c $(GENHDR)
271 275 $(COMPILE.c) -o $@ parse.c
272 276 $(POST_PROCESS_O)
273 277
274 278 objs/%.o pics/%.o: $(SRCDIR)/%.c $(GENHDR)
275 279 $(COMPILE.c) -o $@ $<
276 280 $(POST_PROCESS_O)
277 281
278 282 objs/%.o pics/%.o: %.c $(GENHDR)
279 283 $(COMPILE.c) -o $@ $<
280 284 $(POST_PROCESS_O)
281 285
282 286 # need direct rules for generated files
283 287 objs/opcodes.o pics/opcodes.o: opcodes.c $(GENHDR)
284 288 $(COMPILE.c) -o $@ opcodes.c
285 289 $(POST_PROCESS_O)
286 290
287 291 objs/parse.o pics/parse.o: parse.c $(GENHDR)
288 292 $(COMPILE.c) -o $@ parse.c
289 293 $(POST_PROCESS_O)
290 294
291 295 include $(SRC)/lib/Makefile.targ
292 296
293 297 FRC:
↓ open down ↓ |
182 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX