More technically accurate test case.
[string-lerp.git] / Makefile
1 #!/usr/bin/make -f
2
3 PKGNAME := string-lerp
4 all:
5 $(info Interesting targets:)
6 $(info lint - validate source (with jshint))
7 $(info test - run tests (with jstest))
8 $(info ugly - generate minified source files)
9 $(info dist - generate redistributables (if git tagged))
10 $(info )
11 $(info (Running these may download packages from npm.))
12 $(info )
13 @:
14
15 include javascript.mk
16
17 GIT ?= git
18 git-describe = $(shell $(GIT) describe --tags --always $1)
19
20 SOURCES := string-lerp.js
21 UGLIFIED := $(call uglify-stampify,$(SOURCES))
22
23 JSHINTCONFIG := tests/jshint.config
24 JSSTAMPDIR := build/stamp
25
26 TESTS := $(wildcard tests/*.js)
27 LINTS := $(call jshint-stampify,$(SOURCES) $(TESTS))
28 TEST_TARGETS = $(patsubst %.js,build/stamp/tests/%.js.test,$(SOURCES))
29
30 .DELETE_ON_ERROR:
31 .PHONY: all check lint test ugly dist clean distclean install .FORCE
32
33 check: lint test
34
35 lint: $(LINTS)
36
37 test: $(TEST_TARGETS)
38
39 ugly: check $(UGLIFIED)
40
41 $(PKGNAME)-%.zip $(PKGNAME)-%.tar.gz: .FORCE
42 @mkdir -p $(@D)
43 $(GIT) archive --prefix=$(PKGNAME)-$(*F)/ --output=$@ $(*F)
44
45 dist: check $(addprefix build/dist/$(PKGNAME)-$(call git-describe),.zip .tar.gz)
46
47 clean:
48 $(RM) -r build
49 $(RM) $(UGLIFIED)
50
51 distclean: clean
52 $(RM) -r node_modules
53
54 install: check
55 $(NPM) install -g .