[1] | 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 |
---|
| 6 | subdir=examples/python/xml |
---|
| 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' |
---|
| 15 | dos2unix = : |
---|
| 16 | |
---|
| 17 | ### when running python we invoke python like .. |
---|
| 18 | python = /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. |
---|
| 27 | this : compile |
---|
| 28 | all :: compile |
---|
| 29 | |
---|
| 30 | |
---|
| 31 | g_FILES = \ |
---|
| 32 | $(_srcdir)/xml.g \ |
---|
| 33 | $(eol) |
---|
| 34 | |
---|
| 35 | g_py_FILES = \ |
---|
| 36 | xml_l.py \ |
---|
| 37 | $(eol) |
---|
| 38 | |
---|
| 39 | compile : $(g_py_FILES) |
---|
| 40 | |
---|
| 41 | %.py : $(_srcdir)/%.py |
---|
| 42 | @@RMF@ $@ && @CP@ $< $@ |
---|
| 43 | |
---|
| 44 | |
---|
| 45 | test :: test1 |
---|
| 46 | |
---|
| 47 | test1_deps = \ |
---|
| 48 | xml.py \ |
---|
| 49 | $(g_py_FILES) \ |
---|
| 50 | $(buildtree)/scripts/python.sh \ |
---|
| 51 | $(eol) |
---|
| 52 | |
---|
| 53 | test1_cmd = \ |
---|
| 54 | $(python) xml.py < $(_srcdir)/xml.in \ |
---|
| 55 | $(eol) |
---|
| 56 | |
---|
| 57 | test1 : $(test1_deps) |
---|
| 58 | @ $(test1_cmd) |
---|
| 59 | |
---|
| 60 | $(g_py_FILES) : $(g_FILES) |
---|
| 61 | @ @RMF@ $(g_py_FILES) |
---|
| 62 | @ @ANTLR_COMPILE_CMD@ $(g_FILES) |
---|
| 63 | @ $(dos2unix) $(g_py_FILES) |
---|
| 64 | |
---|
| 65 | $(g_py_FILES) : @ANTLR_JAR@ |
---|
| 66 | $(g_py_FILES) : $(buildtree)/scripts/antlr.sh |
---|
| 67 | |
---|
| 68 | ### cleanup xml |
---|
| 69 | clean :: |
---|
| 70 | @@ECHO@ cleaning xml ... |
---|
| 71 | @ -@RMF@ $(g_py_FILES) |
---|
| 72 | @ -@RMF@ *.pyc *.tmp *TokenTypes.txt *TokenTypes |
---|
| 73 | |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | ### get configured dependencies - for example, just list |
---|
| 77 | ### autoconf variable ANTLR_JAR as reference and it will |
---|
| 78 | ### be done automatically as stddeps contains appropr. |
---|
| 79 | ### rule. For details, checkout scripts/config.vars[.in] |
---|
| 80 | @stddeps@ |
---|
| 81 | |
---|
| 82 | .PHONY: compile |
---|
| 83 | .PHONY: test1 |
---|