-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
57 lines (48 loc) · 1.74 KB
/
Makefile
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
#!/usr/make
#
# Makefile for jlemon
#
# The toplevel directory of the source tree. This is the directory
# that contains this "Makefile".
#
TOP = .
# The directory where parser is created.
#
GEN = $(TOP)/src/main/java
# C Compiler and options for use in building executables that
# will run on the platform that is doing the build.
#
BCC = gcc -g -O2
# Filename extensions
#
BEXE =
# This is the default Makefile target. The objects listed here
# are what get build when you type just "make" with no arguments.
#
all: jlemon$(EXE) yyParser.java simple
# Rules to build the LEMON compiler generator
#
jlemon$(BEXE): $(TOP)/lemon.c
$(BCC) -o $@ $(TOP)/lemon.c
# Rules to build yyParser.java and TokenType.java - the outputs of jlemon.
#
TokenType.java: yyParser.java
yyParser.java: jlemon$(BEXE) $(TOP)/lempar.c $(TOP)/src/main/java/org/sqlite/parser/parse.y
./jlemon$(BEXE) -q -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT $(TOP)/src/main/java/org/sqlite/parser/parse.y
cpp -P $(TOP)/src/main/java/org/sqlite/parser/parse.j > $(GEN)/org/sqlite/parser/yyParser.java
rm $(TOP)/src/main/java/org/sqlite/parser/parse.j
simple: jlemon$(BEXE) $(TOP)/lempar.c $(TOP)/src/test/java/simple/parser.y
./jlemon -q $(TOP)/src/test/java/simple/parser.y
cpp -P $(TOP)/src/test/java/simple/parser.j > $(TOP)/src/test/java/simple/yyParser.java
rm $(TOP)/src/test/java/simple/parser.j
clean:
-rm -rf jlemon.dSYM
-rm -f jlemon$(BEXE)
# rm -f $(GEN)/org/sqlite/parser/yyParser.java
-rm -f $(TOP)/src/main/java/org/sqlite/parser/*.h
-rm -f $(TOP)/src/main/java/org/sqlite/parser/*.j
-rm -f $(TOP)/src/main/java/org/sqlite/parser/*.out
# rm -f $(GEN)/simple/yyParser.java
-rm -f $(TOP)/src/test/java/simple/*.h
-rm -f $(TOP)/src/test/java/simple/*.j
-rm -f $(TOP)/src/test/java/simple/*.out