-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMakefile
44 lines (31 loc) · 1001 Bytes
/
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
default: build
COFFEE=node_modules/.bin/coffee --js
SRCDIR = src
SRC = $(shell find $(SRCDIR) -type f -name '*.coffee' | sort)
LIBDIR = lib
LIB = $(SRC:$(SRCDIR)/%.coffee=$(LIBDIR)/%.js)
.PHONY: test dev
$(LIBDIR)/%.js: $(SRCDIR)/%.coffee
@mkdir -p "$(@D)"
cat JS_LICENSE > "$@"
$(COFFEE) <"$<" >>"$@"
public/js/main.js: $(shell find $(SRCDIR)/client -type f -name '*.js' | sort)
@./node_modules/.bin/cjsify -o public/js/main.js lib/client/gleemail.js
# @./node_modules/.bin/npub prep public/js/main.js
setup:
npm install
dev:
node_modules/.bin/cjsify -w -o public/js/main.js src/client/gleemail.coffee
test: build
@./node_modules/.bin/jasmine-node --coffee spec
build: $(LIB) public/js/main.js
# @./node_modules/.bin/npub prep src
prepublish:
# ./node_modules/.bin/npub prep
clean:
@rm -rf "$(LIBDIR)"
@rm -f public/js/main.js
# This will fail if there are unstaged changes in the checkout
test-checkout-clean:
git diff --exit-code
all: setup clean test test-checkout-clean