1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 18:18:51 +03:00
mal/groovy/Makefile

52 lines
1.4 KiB
Makefile

CLASSES = types.class reader.class printer.class env.class core.class
SOURCES_BASE = types.groovy reader.groovy printer.groovy
SOURCES_LISP = env.groovy core.groovy stepA_mal.groovy
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
all: ${CLASSES}
dist: mal.jar
step1_read_print.groovy: types.class reader.class printer.class
step2_eval.groovy: types.class reader.class printer.class
step3_env.groovy: types.class reader.class printer.class env.class
step4_if_fn_do.groovy step6_file.groovy step7_quote.groovy step8_macros.groovy step9_try.groovy stepA_mal.groovy: ${CLASSES}
types.class: types.groovy
groovyc $<
env.class: env.groovy
groovyc $<
reader.class: reader.groovy
groovyc $<
printer.class: printer.groovy
groovyc $<
core.class: core.groovy types.class reader.class printer.class
groovyc $<
mal.jar: ${CLASSES}
groovyc stepA_mal.groovy
GROOVY_HOME=/usr/share/groovy groovy GroovyWrapper -d $@ -m stepA_mal
SHELL := bash
mal: mal.jar
cat <(echo -e '#!/bin/sh\nexec java -jar "$$0" "$$@"') mal.jar > $@
chmod +x mal
clean:
rm -f *.class classes/* mal.jar mal
rmdir classes || true
.PHONY: stats tests
stats: $(SOURCES)
@wc $^
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"
stats-lisp: $(SOURCES_LISP)
@wc $^
@printf "%5s %5s %5s %s\n" `grep -E "^[[:space:]]*//|^[[:space:]]*$$" $^ | wc` "[comments/blanks]"