forked from higepon/mosh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Generate.mk
50 lines (36 loc) · 1.72 KB
/
Generate.mk
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
# generate source files which requires extra prerequisites
# mosh/bison/re2c
#
# this file used by both gen-git-build.sh and Makefile.am
# 1) do not use special Automake constructs (including
# Autoconf predicates like "if DEVELOPER")
# 2) this file uses following variable
# top_srcdir: Autoconf sets this variable to apropriate
# directory path for the user invoked configure script.
#### Instruction.h
src/Instruction.h: src/instruction.scm
mosh $(top_srcdir)/misc/scripts/gen-insn.scm $< $@
src/main.cpp: src/psyntax_mosh_image.cpp src/baselib.h src/match.h
src/labels.cpp: src/instruction.scm
mosh $(top_srcdir)/misc/scripts/gen-label.scm $< $@
src/cprocedures.cpp: boot/free-vars-decl.scm
mosh $(top_srcdir)/misc/scripts/gen-cproc.scm $< $@
src/all-tests.scm: src/test-data.scm
(cd $(top_srcdir) && mosh -5 misc/scripts/gen-test.scm src/test-data.scm src/all-tests.scm)
# echo 'run -5 misc/scripts/gen-test.scm test-data.scm all-tests.scm ' | gdb ./mosh
src/Object-accessors.h: src/accessors.scm
(cd $(top_srcdir) && mosh misc/scripts/gen-accessors.scm) > $@
src/OSConstants.h: src/os-constants.scm
(cd $(top_srcdir) && mosh misc/scripts/gen-os-constants.scm) > $@
# READER
src/Reader.tab.cpp src/Reader.tab.hpp: src/Reader.y
bison -d $< -o src/Reader.tab.cpp
# bison -Wcounterexamples -d $< -o src/Reader.tab.cpp
src/NumberReader.tab.cpp src/NumberReader.tab.hpp: src/NumberReader.y
bison -p "number_yy" -d $< -o src/NumberReader.tab.cpp
src/Scanner.cpp : src/scanner.re
re2c -u $< > $@ # -d is debug option
src/NumberScanner.cpp : src/NumberScanner.re
re2c -cu $< > $@ # -d is debug option
## N.B. Do not use -g (optimization) option. -u causes YYCURSOR bug.
## for " \ " yen mark, -g causes infinite loop