|
root / base / usr / src / lib / libsqlite / Makefile.targ
Makefile.targ Makefile 88 lines 2.5 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#
# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
# Copyright 2015 Igor Kozhukhov <ikozhukhov@gmail.com>
# Copyright 2016 Nexenta Systems, Inc.  All rights reserved.
# Copyright (c) 2019, Joyent, Inc.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#

opcodes.h: $(SRCDIR)/vdbe.c
	@echo "Generating $@"; \
	$(RM) -f $@ ; \
	echo '/* Automatically generated file.  Do not edit */' > $@ ; \
	$(GREP) '^case OP_' $(SRCDIR)/vdbe.c | \
	    $(SED) -e 's/://' | \
	    $(AWK) '{printf "#define %-30s %3d\n", $$2, ++cnt}' >> $@

opcodes.c: $(SRCDIR)/vdbe.c
	@echo "Generating $@"; \
	$(RM) -f $@ ; \
	$(ECHO) '/* Automatically generated file.  Do not edit */' > $@ ; \
	$(ECHO) 'char *sqliteOpcodeNames[] = { "???", ' >> $@ ; \
	$(GREP) '^case OP_' $(SRCDIR)/vdbe.c | \
	    $(SED) -e 's/^.*OP_/  "/' -e 's/:.*$$/", /' >> $@ ; \
	 $(ECHO) '};' >> $@

testfixture: FRC
	@if [ -f $(TCLBASE)/include/tcl.h ]; then \
		unset SUNPRO_DEPENDENCIES; \
		$(ECHO) $(LINK.c) -o testfixture $(TESTSRC) $(LIBRARY) $(LDLIBS) ;\
		exec $(LINK.c) -o testfixture $(TESTSRC) $(LIBRARY) $(LDLIBS) ;\
	else \
		$(ECHO) "$(TCLBASE)/include/tcl.h: not found."; \
		exit 1; \
	fi

# Prevent Makefile.lib $(PICS) := from adding PICFLAGS
# by building lemon in a recursive make invocation.
# Otherwise, this target causes a rebuild every time after
# the PICS target builds this one way, then lint the other.
parse.h parse.c : $(SRCDIR)/parse.y $(TOOLDIR)/lemon.c $(TOOLDIR)/lempar.c
	-$(RM) parse_tmp.y lempar.c
	$(CP) $(SRCDIR)/parse.y parse_tmp.y
	$(CP) $(TOOLDIR)/lempar.c lempar.c
	$(MAKE) lemon
	./lemon parse_tmp.y
	-$(RM) parse.c parse.h
	$(CP) parse_tmp.h parse.h
	$(CP) parse_tmp.c parse.c

lemon: $(TOOLDIR)/lemon.c
	$(NATIVECC) $(NATIVE_CFLAGS) -o $@ $(TOOLDIR)/lemon.c

objs/%.o: $(SRCDIR)/%.c $(GENHDR)
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

pics/%.o: $(SRCDIR)/%.c $(GENHDR)
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

objs/%.o: %.c $(GENHDR)
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

pics/%.o: %.c $(GENHDR)
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

# need direct rules for generated files
objs/opcodes.o: opcodes.c $(GENHDR)
	$(COMPILE.c) -o $@ opcodes.c
	$(POST_PROCESS_O)

pics/opcodes.o: opcodes.c $(GENHDR)
	$(COMPILE.c) -o $@ opcodes.c
	$(POST_PROCESS_O)

objs/parse.o: parse.c $(GENHDR)
	$(COMPILE.c) -o $@ parse.c
	$(POST_PROCESS_O)

pics/parse.o: parse.c $(GENHDR)
	$(COMPILE.c) -o $@ parse.c
	$(POST_PROCESS_O)

include $(SRC)/lib/Makefile.targ