1## This file is part of ANTLR (http://www.antlr.org). Have a 2## look into LICENSE.txt for license details. This file has 3## been written by (C) Wolfgang Haefelinger, 2004. 4 5## do not change this value 6subdir=examples/python/exprAST 7 8## get configured (standard) variables - checkout or modify 9## scripts/config.vars[.in] for details. 10@stdvars@ 11 12### how to get rid of damned dos line ending style and -- al- 13### most equally worse -- stupid tab character. 14### dos2unix = perl -p -i.tmp -e 's,\r,,g;s,\t, ,g' 15dos2unix = : 16 17### when running python we invoke python like .. 18python = /bin/sh @abs_this_builddir@/scripts/python.sh 19 20## get configured rules 21@stdmake@ 22 23## By default we compile class files so we are ready to carry 24## out a test. Note that deps have been setup in such a way 25## that you can do a 'make compile' whithout having made 26## antlr.jar before. 27this : compile 28all :: compile 29 30 31g_FILES = \ 32 $(_srcdir)/expr.g \ 33 $(eol) 34 35g_py_FILES = \ 36 expr_l.py \ 37 expr_p.py \ 38 $(eol) 39 40compile : $(g_py_FILES) 41 42%.py : $(_srcdir)/%.py 43 @-@RMF@ $@ &&@CP@ $< $@ 44 45 46test :: test1 47 48test1_deps = \ 49 expr.py \ 50 $(g_py_FILES) \ 51 $(buildtree)/scripts/python.sh \ 52 $(eol) 53 54test1_cmd = \ 55 $(python) expr_l.py < $(_srcdir)/expr.in; \ 56 $(python) expr.py < $(_srcdir)/expr.in; \ 57 $(python) expr_l.py < $(_srcdir)/expr2.in; \ 58 $(python) expr.py < $(_srcdir)/expr2.in; \ 59 $(eol) 60 61test1 : $(test1_deps) 62 @ $(test1_cmd) 63 64$(g_py_FILES) : $(g_FILES) 65 @ @RMF@ $(g_py_FILES) 66 @ @ANTLR_COMPILE_CMD@ $(g_FILES) 67 @ $(dos2unix) $(g_py_FILES) 68 69$(g_py_FILES) : @ANTLR_JAR@ 70$(g_py_FILES) : $(buildtree)/scripts/antlr.sh 71 72### cleanup expr 73clean :: 74 @@ECHO@ cleaning expr ... 75 @ -@RMF@ $(g_py_FILES) 76 @ -@RMF@ *.pyc *.tmp *TokenTypes.txt *TokenTypes 77 78 79 80### get configured dependencies - for example, just list 81### autoconf variable ANTLR_JAR as reference and it will 82### be done automatically as stddeps contains appropr. 83### rule. For details, checkout scripts/config.vars[.in] 84@stddeps@ 85 86.PHONY: compile 87.PHONY: test1 88