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