1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 02:27:10 +03:00
mal/clojure/Makefile
Joel Martin 99472e2576 Clojure: reader/printer instead of monkey patching
Update the Clojure/ClojureScript implementation to have full reader
and printer/pr-str impementation instead of monkey patching Clojure's
reader and print functions.
2019-01-12 15:03:59 -06:00

46 lines
1.1 KiB
Makefile

clojure_MODE ?= clj
SOURCES_UTIL = src/mal/readline.$(clojure_MODE)
SOURCES_BASE = $(SOURCES_UTIL) src/mal/reader.cljc src/mal/printer.cljc
SOURCES_LISP = src/mal/env.cljc src/mal/core.cljc src/mal/stepA_mal.cljc
SRCS = $(SOURCES_BASE) src/mal/env.cljc src/mal/core.cljc
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
DEPS = $(if $(filter cljs,$(clojure_MODE)),node_modules,deps)
dist: $(if $(filter cljs,$(clojure_MODE)),,mal.jar mal)
deps:
lein deps
mal.jar: $(SOURCES)
lein with-profile stepA uberjar
cp target/stepA_mal.jar $@
SHELL := bash
mal: mal.jar
cat <(echo -e '#!/bin/sh\nexec java -jar "$$0" "$$@"') mal.jar > $@
chmod +x mal
src/mal/%.cljc: $(DEPS)
@true
#src/mal/stepA_mal.cljc: $(DEPS)
target/%.jar: src/mal/%.cljc $(SRCS)
lein with-profile $(word 1,$(subst _, ,$*)) uberjar
node_modules:
npm install
clean:
rm -rf target/ mal.jar mal
.PHONY: stats
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]"