Example Makefile for Elm with multiple targets
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
# 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