systemjs/Makefile
2015-05-31 18:19:13 +02:00

139 lines
3.5 KiB
Makefile
Executable File

VERSION = $(shell cat package.json | sed -n 's/.*"version": "\([^"]*\)",/\1/p')
ESML = node_modules/es6-module-loader/src
define BANNER
/*
* SystemJS v$(VERSION)
*/
endef
export BANNER
define POLYFILLS_BANNER
/*
* SystemJS Polyfills for URL and Promise providing IE8+ Support
*/
endef
export POLYFILLS_BANNER
compile: clean-compile dist/system.src.js dist/system-csp-production.src.js dist/system-register-only.src.js
build: clean dist/system.js dist/system-csp-production.js dist/system-register-only.js dist/system-polyfills.js
version:
@echo $(VERSION)
footprint: build
@cat dist/system.js | gzip -9f | wc -c
@cat dist/system-csp-production.js | gzip -9f | wc -c
@cat dist/system-register-only.js | gzip -9f | wc -c
@cat dist/system-polyfills.js | gzip -9f | wc -c
clean-compile:
@rm -f dist/system.src.js dist/system-csp-production.src.js
clean:
@rm -f dist/*
test: compile
open test/test-traceur.html test/test-traceur-runtime.html
sleep 0.1
open test/test-babel.html test/test-babel-runtime.html
sleep 0.1
open test/test-typescript.html
sleep 0.1
open test/test-csp.html test/test-tracer.html
dist/system-polyfills.js: dist/system-polyfills.src.js
@echo "$$POLYFILLS_BANNER" > $@
cd dist && ../node_modules/.bin/uglifyjs $(subst dist/,,$<) --compress drop_console --mangle --source-map system-polyfills.js.map >> $(subst dist/,,$@) || rm $(subst dist/,,$@)
dist/%.js: dist/%.src.js
@echo "$$BANNER" > $@
cd dist && ../node_modules/.bin/uglifyjs $(subst dist/,,$<) --compress drop_console --mangle --source-map $*.js.map >> $(subst dist/,,$@) || rm $(subst dist/,,$@)
dist/system.src.js: lib/*.js $(ESML)/*.js
@echo "$$BANNER" > $@;
cat \
lib/wrapper-start.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
$(ESML)/system.js \
$(ESML)/system-fetch.js \
$(ESML)/transpiler.js \
lib/global-eval.js \
lib/proto.js \
lib/core.js \
lib/scriptLoader.js \
lib/register.js \
lib/esm.js \
lib/global.js \
lib/global-helpers.js \
lib/cjs.js \
lib/amd-helpers.js \
lib/amd.js \
lib/map.js \
lib/paths.js \
lib/package.js \
lib/plugins.js \
lib/alias.js \
lib/meta.js \
lib/bundles.js \
lib/depCache.js \
lib/conditionals.js \
lib/createSystem.js \
$(ESML)/wrapper-end.js \
lib/wrapper-end.js \
>> $@;
dist/system-csp-production.src.js: lib/*.js $(ESML)/*.js
@echo "$$BANNER" > $@;
cat \
lib/wrapper-start.js \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
$(ESML)/system.js \
lib/proto.js \
lib/core.js \
lib/scriptLoader.js \
lib/scriptOnly.js \
lib/register.js \
lib/global-helpers.js \
lib/amd-helpers.js \
lib/map.js \
lib/paths.js \
lib/package.js \
lib/plugins.js \
lib/alias.js \
lib/meta.js \
lib/bundles.js \
lib/depCache.js \
lib/conditionals.js \
lib/createSystem.js \
$(ESML)/wrapper-end.js \
lib/wrapper-end.js \
>> $@;
dist/system-register-only.src.js: lib/*.js $(ESML)/*.js
@echo "$$BANNER" > $@;
cat \
$(ESML)/wrapper-start.js \
$(ESML)/loader.js \
$(ESML)/dynamic-only.js \
$(ESML)/system.js \
$(ESML)/system-resolve.js \
lib/proto.js \
lib/scriptLoader.js \
lib/scriptOnly.js \
lib/register.js \
lib/createSystem.js \
$(ESML)/wrapper-end.js \
>> $@;
dist/system-polyfills.src.js: lib/*.js $(ESML)/*.js
@echo "$$POLYFILLS_BANNER" > $@;
cat \
$(ESML)/url-polyfill.js \
node_modules/when/es6-shim/Promise.js \
lib/polyfills-bootstrap.js \
>> $@;