2025-01-01 01:50:26 +00:00
|
|
|
SRC_FILES := $(shell find src -name "*.elm")
|
|
|
|
|
|
|
|
all: elm.min.js
|
|
|
|
|
2025-01-30 17:39:22 +00:00
|
|
|
.PHONY: elm.min.js serve
|
2025-01-03 16:09:13 +00:00
|
|
|
|
2025-01-03 13:07:44 +00:00
|
|
|
ifeq ($(DEBUG)$(RELEASE),) # Both are empty
|
|
|
|
$(error You must set exactly one of DEBUG=1 or RELEASE=1)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG)$(RELEASE),11) # Both are set
|
|
|
|
$(error Both DEBUG and RELEASE cannot be set at the same time)
|
|
|
|
endif
|
2025-01-01 02:14:09 +00:00
|
|
|
|
2025-01-03 16:09:13 +00:00
|
|
|
elm.min.js:
|
2025-01-03 13:07:44 +00:00
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
./build.sh --debug src/Main.elm
|
|
|
|
else ifeq ($(RELEASE),1)
|
2025-01-01 02:14:09 +00:00
|
|
|
./build.sh --optimize src/Main.elm
|
2025-01-03 13:29:56 +00:00
|
|
|
endif
|
|
|
|
|
2025-01-30 17:39:22 +00:00
|
|
|
serve:
|
|
|
|
ifeq ($(DEBUG),1)
|
2025-01-31 15:45:50 +00:00
|
|
|
elm-go src/Main.elm --port=8000 --dir=../public --start-page=index.html -- --output=../public/elm.min.js
|
2025-01-30 17:39:22 +00:00
|
|
|
else ifeq ($(RELEASE),1)
|
|
|
|
$(error Cannot use serve target with RELEASE=1)
|
|
|
|
endif
|
|
|
|
|
2025-01-03 13:29:56 +00:00
|
|
|
clean:
|
|
|
|
rm elm.js elm.min.js
|