mirror of
https://github.com/kanaka/mal.git
synced 2024-09-21 02:27:10 +03:00
37a33ac72e
The Scala build will create a mal.jar file with all the steps' classes in it. A `run` wrapper script will run that jar with a specific step main class according to the `$STEP` environment variable. Now the jar file is created only once (when testing step0) and then re-used for testing the next steps, which should speed up the build. Moreover, sbt now prepends shell script header to the jar file, so no need to implement this in Makefile (for the `dist` target).
39 lines
783 B
Makefile
39 lines
783 B
Makefile
TESTS =
|
|
|
|
SOURCES_BASE = types.scala reader.scala printer.scala
|
|
SOURCES_LISP = env.scala core.scala stepA_mal.scala
|
|
SOURCES = $(SOURCES_BASE) $(SOURCES_LISP)
|
|
|
|
TARGET_DIR=target/scala-2.11
|
|
|
|
all: $(TARGET_DIR)/mal.jar
|
|
|
|
dist: mal
|
|
|
|
mal: $(TARGET_DIR)/mal.jar
|
|
cp $< $@
|
|
|
|
$(TARGET_DIR)/mal.jar:
|
|
sbt assembly
|
|
|
|
$(TARGET_DIR)/classes/step%.class: step%.scala $(SOURCES)
|
|
sbt assembly
|
|
|
|
clean:
|
|
rm -rf mal target
|
|
|
|
.PHONY: all dist clean stats tests $(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]"
|
|
|
|
tests: $(TESTS)
|
|
|
|
$(TESTS):
|
|
@echo "Running $@"; \
|
|
ruby $@ || exit 1; \
|