Skip to content

Instantly share code, notes, and snippets.

@jteneycke
Forked from rtorr/Makefile
Created August 8, 2016 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jteneycke/9dcceee63ad35003f0fd086b9244cfdb to your computer and use it in GitHub Desktop.
Save jteneycke/9dcceee63ad35003f0fd086b9244cfdb to your computer and use it in GitHub Desktop.
Watch elm files for changes and then recompile
Watch elm files for changes and then recompile
brew install fswatch
make watch
js = $(shell echo $(elm) | tr A-Z a-z)
elm = Main
# Example: make elm=Main js=main watch
watch:
echo "watching *.elm files, outputing $(js).js" && fswatch -0 *.elm | xargs -0 -n 1 -I \{\} elm-make $(elm).elm --output $(js).js
# Example: make elm=Main js=main build
build:
elm-make $(elm).elm --output $(js).js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment