Last active
December 15, 2016 19:33
-
-
Save wmakley/c19e6e86f6c8f383ee15f9fc103102e2 to your computer and use it in GitHub Desktop.
Example Makefile for Elm with multiple targets
This file contains hidden or 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
# Assumes 'elm' is in your PATH, and there is a directory called 'src' containing | |
# your Elm source code in the same directory as this file. | |
ELM = elm | |
OUTPUT = ../assets/javascripts/elm # For Rails asset pipeline, but could be anything | |
SRCS = MyApp.elm MyOtherApp.elm | |
TARGETS = $(SRCS:.elm=.js) | |
ELM_STUFF = elm-stuff/exact-dependencies.json | |
all: $(TARGETS) | |
%.js: src/%.elm $(ELM_STUFF) | |
$(ELM) make $< --output $(OUTPUT)/$@ | |
$(ELM_STUFF): elm-package.json | |
$(ELM) package install | |
clean: | |
echo "Removing build artifacts..." | |
rm -rf ./elm-stuff/build-artifacts | |
rm -rf ./elm-linter/build-artifacts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment