java, d: add a Makefile for the example

* examples/java/Makefile, examples/d/Makefile: New.
This commit is contained in:
Akim Demaille
2018-12-05 09:01:10 +01:00
parent 156140dfc3
commit 9a5c12f160
5 changed files with 59 additions and 2 deletions

26
examples/java/Makefile Normal file
View File

@@ -0,0 +1,26 @@
# This Makefile is designed to be simple and readable. It does not
# aim at portability. It requires GNU Make.
BISON = bison
JAVAC = javac
JAVA = java
XSLTPROC = xsltproc
all: Calc.class
%.java %.xml %.gv: %.y
$(BISON) $(BISONFLAGS) --xml --graph=$*.gv -o $*.java $<
%.class: %.java
$(JAVAC) $(JAVACFLAGS) $<
run: Calc.class
echo "Type arithmetic expressions. Quit with ctrl-d."
$(JAVA) $(JAVAFLAGS) Calc
html: Calc.html
%.html: %.xml
$(XSLTPROC) $(XSLTPROCFLAGS) -o $@ $$($(BISON) --print-datadir)/xslt/xml2xhtml.xsl $<
clean:
rm -f *.class Calc.java Calc.html Calc.xml Calc.gv

View File

@@ -31,5 +31,5 @@ endif
%D%/Calc.class: %D%/Calc.java
$(AM_V_GEN) $(SHELL) $(top_builddir)/javacomp.sh $<
dist_java_DATA = %D%/Calc.y
dist_java_DATA = %D%/Calc.y %D%/Makefile
CLEANFILES += %D%/Calc.class %D%/Calc.java