Last active
August 29, 2015 14:22
-
-
Save npryce/20e293bb65bd300e0a3b to your computer and use it in GitHub Desktop.
Makefile to bootstrap and build a Purescript project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm_bin:=$(shell npm bin) | |
psc=$(npm_bin)/psc | |
bower=$(npm_bin)/bower | |
outdir=target | |
all: $(outdir)/js/HelloWorld.js | |
$(outdir)/js/HelloWorld.js: src/HelloWorld.purs | |
$(outdir)/js/HelloWorld.js: pscflags=--main=$* | |
$(outdir)/js/%.js: psclibsrc=$(shell find bower_components/*/src '*.purs') | |
$(outdir)/js/%.js: $(psc) $(outdir)/bower.installed $(psclibsrc) | |
@mkdir -p $(dir $@) | |
$(psc) $(filter %.purs,$^) --output=$@ --module=$* $(pscflags) | |
$(psc): | |
npm install [email protected] | |
$(bower): | |
npm install [email protected] | |
$(outdir)/bower.installed: $(bower) bower.json | |
$(bower) install | |
@mkdir -p $(dir $@) | |
touch $@ | |
clean: | |
rm -rf $(outdir)/js | |
clean-libs: | |
rm -rf $(outdir) bower_components | |
clean-everything: clean-libs | |
rm -rf node_modules | |
.PHONY: all clean clean-libs clean-everything |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment