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/treewalk
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 test2
28
29
30## My *.g files
31g_FILES  = \
32 $(_srcdir)/treewalk.g \
33 $(eol)
34
35## Java files generated by *.g
36g_src_FILES = \
37  $(thisdir)/LangLexer.java \
38  $(thisdir)/LangParser.java \
39  $(thisdir)/LangWalker.java \
40  $(thisdir)/LangParserTokenTypes.java \
41  $(eol)
42
43## Text files generated by *.gls
44g_txt_FILES = \
45	$(thisdir)/LangParserTokenTypes.txt \
46	$(eol)
47
48## All generated files by *.g
49g_gen_FILES = \
50	$(g_src_FILES) \
51	$(g_txt_FILES) \
52	$(eol)
53
54# All Java files
55j_src_FILES = \
56	$(g_src_FILES) \
57  $(_srcdir)/Main.java \
58	$(eol)
59
60## Dependencies of test 1
61test1_deps = \
62	.java \
63	$(buildtree)/scripts/javac.sh \
64	$(eol)
65
66## Dependencies of test 1
67test2_deps = \
68	.java \
69	$(buildtree)/scripts/javac.sh \
70	$(eol)
71
72## Test 1
73test1_cmd = \
74	@ @JAVA_CMD@ Main < $(_srcdir)/test.in \
75	$(eol)
76
77## Test 1
78test2_cmd = \
79	@ @JAVA_CMD@ Main < $(_srcdir)/simple.in \
80	$(eol)
81
82
83## Tests
84test1 : $(test1_deps)
85	@ $(test1_cmd)
86
87test2 : $(test2_deps)
88	@ $(test2_cmd)
89
90
91## How to generated *.java ..
92$(g_src_FILES) : $(g_FILES)
93	@ @RMF@ $(g_src_FILES)
94	@ @ANTLR_COMPILE_CMD@ $(g_FILES)
95	@ $(dos2unix) $(g_src_FILES)
96
97$(g_src_FILES) : @ANTLR_JAR@
98$(g_src_FILES) : $(buildtree)/scripts/antlr.sh
99
100## How to generate class files
101.java : $(j_src_FILES)
102	@-@RMF@ $@
103	@@JAVA_COMPILE_CMD@  $(j_src_FILES) && @ECHO@ > $@
104
105.java : $(buildtree)/scripts/javac.sh
106
107### cleanup astsupport
108clean ::
109	@@ECHO@ cleaning $(subdir) ...
110	@ -@RMF@ .java *.class $(g_gen_FILES)
111	@ -@RMF@ *.pyc *.tmp *TokenTypes.txt *TokenTypes
112
113
114
115### get configured dependencies - for example, just list
116### autoconf variable ANTLR_JAR as reference and it will
117### be  done  automatically  as stddeps contains appropr.
118### rule. For details, checkout scripts/config.vars[.in]
119@stddeps@
120
121.PHONY: compile
122.PHONY: test1
123