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