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