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/java/lexRewrite 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## get configured rules 18@stdmake@ 19 20## By default we compile class files so we are ready to carry 21## out a test. Note that deps have been setup in such a way 22## that you can do a 'make compile' whithout having made 23## antlr.jar before. 24this : compile 25all :: compile 26compile : .java 27test :: test1 28 29 30## My *.g files 31g_FILES = \ 32 $(_srcdir)/rewrite.g \ 33 $(eol) 34 35## Java files generated by *.g 36g_src_FILES = \ 37 $(thisdir)/Rewrite.java \ 38 $(thisdir)/RewriteTokenTypes.java \ 39 $(eol) 40 41## Text files generated by *.g 42g_txt_FILES = \ 43 $(thisdir)/DataParserTokenTypes.txt \ 44 $(eol) 45 46## All generated files by *.g 47g_gen_FILES = \ 48 $(g_src_FILES) \ 49 $(g_txt_FILES) \ 50 $(eol) 51 52# All Java files 53j_src_FILES = \ 54 $(g_src_FILES) \ 55 $(_srcdir)/Main.java \ 56 $(eol) 57 58## Dependencies of test 1 59test1_deps = \ 60 .java \ 61 $(buildtree)/scripts/javac.sh \ 62 $(eol) 63 64## Test 1 65test1_cmd = \ 66 @ @JAVA_CMD@ Main < $(_srcdir)/test.in \ 67 $(eol) 68 69## Tests 70test1 : $(test1_deps) 71 @ $(test1_cmd) 72 73 74## How to generated *.java .. 75$(g_src_FILES) : $(g_FILES) 76 @ @RMF@ $(g_src_FILES) 77 @ @ANTLR_COMPILE_CMD@ $(g_FILES) 78 @ $(dos2unix) $(g_src_FILES) 79 80$(g_src_FILES) : @ANTLR_JAR@ 81$(g_src_FILES) : $(buildtree)/scripts/antlr.sh 82 83## How to generate class files 84.java : $(j_src_FILES) 85 @-@RMF@ $@ 86 @@JAVA_COMPILE_CMD@ $(j_src_FILES) && @ECHO@ > $@ 87 88.java : $(buildtree)/scripts/javac.sh 89 90### cleanup astsupport 91clean :: 92 @@ECHO@ cleaning $(subdir) ... 93 @ -@RMF@ .java *.class $(g_gen_FILES) tinybasic 94 @ -@RMF@ *.pyc *.tmp *TokenTypes.txt *TokenTypes 95 96 97 98### get configured dependencies - for example, just list 99### autoconf variable ANTLR_JAR as reference and it will 100### be done automatically as stddeps contains appropr. 101### rule. For details, checkout scripts/config.vars[.in] 102@stddeps@ 103 104.PHONY: compile 105.PHONY: test1 106