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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
## This file is part of ANTLR (http://www.antlr.org). Have a
## look into LICENSE.txt for license details. This file has
## been written by (C) Wolfgang Haefelinger, 2004.
## do not change this value
subdir=examples/python/inherit.tinyc
## get configured (standard) variables - checkout or modify
## scripts/config.vars[.in] for details.
@stdvars@
### how to get rid of damned dos line ending style and -- al-
### most equally worse -- stupid tab character.
### dos2unix = perl -p -i.tmp -e 's,\r,,g;s,\t, ,g'
dos2unix = :
### when running python we invoke python like ..
python = /bin/sh @abs_this_builddir@/scripts/python.sh
## get configured rules
@stdmake@
## By default we compile class files so we are ready to carry
## out a test. Note that deps have been setup in such a way
## that you can do a 'make compile' whithout having made
## antlr.jar before.
this : compile
all :: compile
g_FILES = \
$(_srcdir)/inherit.g \
$(eol)
g_py_FILES = \
inherit_p.py \
tinyc_p.py \
tinyc_l.py \
expandedinherit.g \
$(eol)
compile : $(g_py_FILES)
## we need some local Python modules
%.py : $(_srcdir)/%.py
@-@RMF@ $@ &&@CP@ $< $@
%.py : @abs_this_builddir@/examples/python/tinyc/%.py
@CP@ $< $@
## We inherit from grammar files in tinyc. Rather than
## using them directly we copy them locally to avoid problems
## due to vocabularies that can't be found.
%.g : @abs_top_srcdir@/examples/python/tinyc/%.g
@-@RMF@ $@ &&@CP@ $< $@
## This vocabluary file is imported by the expanded grammar.
## Unfortunaly, there is no way to tell ANTLR where to search
## for it. ANTLR assumes it's always there where the grammar
## file resides. Therefore we are going to "make" the base
## grammar first and then copy required vocabulary over ..
TinyCTokenTypes.txt :
@MAKE@ -C ../tinyc
@CP@ ../tinyc/$@ $@
@abs_this_builddir@/examples/python/tinyc/%.py :
@MAKE@ -C ../tinyc
test :: test1
test1_deps = \
inherit.py \
tinyc_p.py \
tinyc_l.py \
$(g_py_FILES) \
$(buildtree)/scripts/python.sh \
$(eol)
test1_cmd = \
$(python) inherit.py < $(_srcdir)/inherit.in \
$(eol)
test1 : $(test1_deps)
@ $(test1_cmd)
$(g_py_FILES) : $(g_FILES) tinyc_p.g tinyc_l.g TinyCTokenTypes.txt
@ @RMF@ $(g_py_FILES)
@ @RMF@ $(g_src_FILES)
@ANTLR_COMPILE_CMD@ tinyc_p.g tinyc_l.g
@ANTLRFLAGS="-glib `@CYGPATH_W@ tinyc_p.g`" \
@ANTLR_COMPILE_CMD@ $(g_FILES)
@ $(dos2unix) $(g_py_FILES)
$(g_py_FILES) : @ANTLR_JAR@
$(g_py_FILES) : $(buildtree)/scripts/antlr.sh
### cleanup tinyc
clean ::
@@ECHO@ cleaning inherit ...
@ -@RMF@ $(g_py_FILES) tinyc_l.g tinyc_p.g TinyCTokenTypes.txt
@ -@RMF@ *.pyc *.tmp *TokenTypes.txt *TokenTypes
### get configured dependencies - for example, just list
### autoconf variable ANTLR_JAR as reference and it will
### be done automatically as stddeps contains appropr.
### rule. For details, checkout scripts/config.vars[.in]
@stddeps@
.PHONY: compile
.PHONY: test1
|