tutor/www/Makefile

32 lines
561 B
Makefile
Raw Permalink Normal View History

2021-07-08 01:48:58 +00:00
.PHONY: all node-deps clean run
TARGET=public/elm.js
SOURCE=src/App.elm
ELM_FILES = $(shell find src -type f -name '*.elm')
2023-01-10 05:31:30 +00:00
ELM = ./bin/elm
2021-07-08 01:48:58 +00:00
ELMMAKE_FLAGS =
ifeq ($(DEBUG),1)
ELMMAKE_FLAGS += --debug
endif
2023-01-10 05:31:30 +00:00
all: $(TARGET)
2021-07-08 01:48:58 +00:00
2023-01-10 05:31:30 +00:00
$(ELM):
mkdir -p ./bin
curl -sL https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz \
| gunzip > $@
chmod +x $@
2021-07-08 01:48:58 +00:00
2023-01-10 05:31:30 +00:00
$(TARGET): $(ELM_FILES) $(ELM)
2021-07-08 01:48:58 +00:00
$(ELM) make $(ELMMAKE_FLAGS) $(SOURCE) --output $@
clean-deps:
2023-01-10 05:31:30 +00:00
rm -rf bin
2021-07-08 01:48:58 +00:00
rm -rf elm-stuff
clean:
rm -f $(TARGET)
rm -rf elm-stuff/build-artifacts