Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (32 sloc) 1.142 kB
CLJ_SRC = src/clj
CLJS_SRC = src
CLJ_DEPS = $(shell find "${CLJ_SRC}" -name "*.clj")
CLJS_DEPS = $(shell find "${CLJS_SRC}" -name "*.cljs")
DEPS = ${CLJS_DEPS} ${CLJ_DEPS}
MAIN_JS = game_of_life.js
OUTPUT_DIR = cljs-out
NOTIFY_COMMAND = -b
UNAMEOS = $(shell uname)
ifeq ($(UNAMEOS),Linux)
NOTIFY_COMMAND = -c 'kdialog --passivepopup cljs-compile-done 3'
endif
ifeq ($(UNAMEOS),Darwin)
NOTIFY_COMMAND = -c 'growlnotify -m compile-done cljs-watch'
endif
ADDITIONAL_CLASSPATH = ${PWD}/${CLJ_SRC}
# CLJS_ARGS = :optimizations :simple :pretty-print true
CLJS_ARGS =
ifdef PROD
CLJS_ARGS = :optimizations :advanced
endif
all: ${MAIN_JS}
# cljsc -cp requires a modified version of cljsc, see dedeibel@github
${MAIN_JS}: ${DEPS}
@export CLASSPATH=${CLASSPATH}:${ADDITIONAL_CLASSPATH}; cljsc "${CLJS_SRC}" '{${CLJS_ARGS}:output-dir "${OUTPUT_DIR}" :output-to "$@"}'
.PHONY: watch
watch: ${DEPS}
@export CLASSPATH=${CLASSPATH}:${ADDITIONAL_CLASSPATH}; cljs-watch -s "${CLJS_SRC}" ${NOTIFY_COMMAND} '{${CLJS_ARGS}:output-dir "${OUTPUT_DIR}" :output-to "${MAIN_JS}"}'
.PHONY: clean
clean:
rm -f "${MAIN_JS}"
rm -fr "${OUTPUT_DIR}"
Jump to Line
Something went wrong with that request. Please try again.