summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2016-01-21 14:39:04 -0800
committerAlexander Early <alexander.early@gmail.com>2016-01-21 14:39:04 -0800
commita191cb4a07a271dd735b5de5438724dc5557e86b (patch)
tree8f47c4ee01dfe8c5f9f80e0a9d52c3b080e9f300 /Makefile
parentd8bdb7a0d38b9b444d63ee7cd139dafb0b1486e2 (diff)
downloadasync-a191cb4a07a271dd735b5de5438724dc5557e86b.tar.gz
clean up makefile, add smoke test to build process
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 26 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 73ea64d..8d98a92 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,7 @@
+# This makefile is meant to be run on OSX/Linux. Make sure any artifacts
+# created here are checked in so people on all platforms can run npm scripts.
+# This build should be run once per release.
+
export PATH := ./node_modules/.bin/:$(PATH):./bin/
PACKAGE = asyncjs
@@ -14,6 +18,7 @@ JS_SRC = $(shell find lib/ -type f -name '*.js') package.json
LINT_FILES = lib/ test/ mocha_test/ $(shell find perf/ -maxdepth 2 -type f) support/ gulpfile.js karma.conf.js
UMD_BUNDLE = $(BUILDDIR)/async.js
+UMD_BUNDLE_MIN = $(BUILDDIR)/async.min.js
CJS_BUNDLE = $(BUILDDIR)/index.js
all: lint test clean build
@@ -21,9 +26,6 @@ all: lint test clean build
test:
npm test
-test-build: build
- mocha support/build.test.js
-
clean:
rm -rf $(BUILDDIR)
rm -rf $(DIST)
@@ -32,7 +34,7 @@ lint:
jshint $(LINT_FILES)
jscs $(LINT_FILES)
-
+# Compile the ES6 modules to singular bundles, and individual bundles
build-bundle: build-modules $(UMD_BUNDLE) $(CJS_BUNDLE)
build-modules:
@@ -44,16 +46,29 @@ $(UMD_BUNDLE): $(JS_SRC)
$(CJS_BUNDLE): $(JS_SRC)
$(BABEL_NODE) $(SCRIPTS)/build/aggregate-cjs.js
-.PHONY: build-modules build-bundle
+# Create the minified UMD versions and copy them to dist/ for bower
+build-dist: $(DIST) $(DIST)/async.js $(DIST)/async.min.js $(UMD_BUNDLE_MIN)
+
+$(DIST):
+ mkdir -p $(DIST)/
-build-dist:
- mkdir -p $(DIST)
- cp $(BUILDDIR)/async.js $(DIST)/async.js
- $(UGLIFY) $(DIST)/async.js -mc \
+$(UMD_BUNDLE_MIN): $(UMD_BUNDLE)
+ $(UGLIFY) $< --mangle --compress \
--source-map $(DIST)/async.min.map \
- -o $(DIST)/async.min.js
+ -o $@
+
+$(DIST)/async.js: $(UMD_BUNDLE)
+ cp $< $@
+
+$(DIST)/async.min.js: $(UMD_BUNDLE_MIN)
+ cp $< $@
+
+test-build:
+ mocha support/build.test.js
+
+.PHONY: build-modules build-bundle build-dist test-build
-build: clean build-bundle build-dist
+build: clean build-bundle build-dist test-build
.PHONY: test lint build all clean