-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
45 lines (29 loc) · 818 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
ELM_MAIN = TodoMVC
ELM_OUTPUT = elm.js
STATIC = index.html css
BROWSER_TARGET = index.html
SOURCE_DIR = src
BUILD_DIR = build
###
ELM_SOURCE = $(SOURCE_DIR)/$(ELM_MAIN).elm
ELM_BUILD = $(BUILD_DIR)/$(ELM_OUTPUT)
STATIC_SOURCES = $(STATIC:%=$(SOURCE_DIR)/%)
###
.PHONY: all open clean clean-build clean-all static elm new
all: $(BUILD_DIR) $(ELM_BUILD) static
new: clean-build all
$(ELM_BUILD): elm
elm:
elm make --yes --output $(ELM_BUILD) $(ELM_SOURCE)
open:
xdg-open $(BUILD_DIR)/$(BROWSER_TARGET) 2>/dev/null
static: # : $(BUILD_DIR)/% : $(SOURCE_DIR)/% $(BUILD_DIR)
rsync -rpE --ignore-missing-args stopgap $(STATIC_SOURCES) $(BUILD_DIR)
$(BUILD_DIR):
mkdir $(BUILD_DIR)
clean:
rm -rf elm-stuff
clean-build:
rm -rf $(BUILD_DIR)
rm -rf elm-stuff/build-artifacts
clean-all: clean-build clean