1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-21 10:37:58 +03:00
mal/clojure/Makefile

41 lines
1023 B
Makefile
Raw Normal View History

CLJ_MODE ?= clj
SOURCES_UTIL = src/mal/readline.$(CLJ_MODE)
SOURCES_BASE = $(SOURCES_UTIL) 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)
all: $(if $(filter cljs,$(CLJ_MODE)),node_modules,deps)
dist: mal.jar mal
2016-02-15 05:57:31 +03:00
deps:
lein deps
2016-02-15 05:57:31 +03:00
mal.jar: $(SOURCES)
lein with-profile stepA uberjar
2016-02-15 05:57:31 +03:00
cp target/mal-0.0.1-SNAPSHOT-standalone.jar $@
SHELL := bash
mal: mal.jar
cat <(echo -e '#!/bin/sh\nexec java -jar "$$0" "$$@"') mal.jar > $@
chmod +x mal
target/%.jar: src/mal/%.cljc $(SRCS)
lein with-profile $(word 1,$(subst _, ,$*)) uberjar
node_modules:
npm install
clean:
rm -rf target/ mal.jar mal
2016-02-15 05:57:31 +03:00
.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]"