-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
47 lines (30 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
SRC_COFFEE = $(shell find src -name \*.coffee)
TARGET_JS = $(subst src/, build/, $(addsuffix .js, $(basename $(SRC_COFFEE))))
SPEC_COFFEE = $(shell find spec -name \*.coffee)
SPEC_JS = $(subst spec/, build/, $(addsuffix .js, $(basename $(SPEC_COFFEE))))
DIST = lib/given.js
# RULES
build/%.js: src/%.coffee
@echo COMPILE: $<
@node_modules/coffee-script/bin/coffee --nodejs --no-deprecation -o $(subst src, build, $(dir $@)) -c $<
build/%.js: spec/%.coffee
@echo COMPILE: $<
@node_modules/coffee-script/bin/coffee --nodejs --no-deprecation -o $(subst src, build, $(dir $@)) -c $<
# TARGETS
$(DIST): $(TARGET_JS)
@cat $^ > $@
README.md: README.md.raw spec/given.spec.coffee build/given.spec.js
@bin/make-readme
# TASKS
compile: $(DIST)
spec: $(DIST) $(SPEC_JS)
@echo SPEC: $(SPEC_JS)
@node_modules/jasmine-node/bin/jasmine-node $(SPEC_JS)
clean:
@rm -fr build/* README.md
watch:
-@make spec
@wach -o src/*.coffee,spec/*.coffee, make compile spec
all: compile spec README.md
.PHONY: all compile spec clean watch
.DEFAULT: all