Download:
child 294:219b5038ba35
parent 292:ad418a21d2f1
293:6635f14613ba
Anton Shestakov <av6@dwimlabs.net>, Wed, 01 Nov 2017 00:50:57 +0800
Makefile: use file targets more, results in incremental building Less work to do when only some files get changed, but more work when building from scratch. But, multiple compilers can run in parallel.

1 файлов изменено, 14 вставок(+), 5 удалений(-) [+]
Makefile file | annotate | diff | comparison | revisions
--- a/Makefile Mon Oct 30 11:56:07 2017 +0800
+++ b/Makefile Wed Nov 01 00:50:57 2017 +0800
@@ -1,13 +1,22 @@
+coffeefiles := $(wildcard coffee/*.coffee)
+jsfiles := $(coffeefiles:coffee/%.coffee=js/%.js)
+mapfiles := $(jsfiles:.js=.js.map)
+npm := npm update && sed -i -e 's@^\#!/usr/bin/env node$$@&js@' ./node_modules/coffee-script/bin/coffee
+
+
+
.PHONY: all
all: build
-
.PHONY: devel
devel:
- npm update
- sed -i -e 's@^#!/usr/bin/env node$$@&js@' ./node_modules/coffee-script/bin/coffee
+ $(npm)
+node_modules/.bin/coffee:
+ $(npm)
+
+js/%.js js/%.js.map: coffee/%.coffee node_modules/.bin/coffee
+ ./node_modules/.bin/coffee -o ./js/ -cm $<
.PHONY: build
-build:
- ./node_modules/.bin/coffee -o ./js/ -cm ./coffee/
+build: $(jsfiles) $(mapfiles)