-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
37 lines (32 loc) · 1 KB
/
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
DOCKER_IMAGE := terrorjack/asterius
DOCKER_WS := /workspace
BUILD_DIR := _build
AHC_CABAL_BUILD_DIR := $(BUILD_DIR)/ahc-cabal
AHC_CABAL_INSTALL_DIR := $(BUILD_DIR)
ASTERIUS_OUTPUT_DIR = $(BUILD_DIR)/asterius
.PHONY: compile
compile:
docker run --rm -v $(CURDIR):$(DOCKER_WS) -w $(DOCKER_WS) $(DOCKER_IMAGE) \
ahc-cabal install \
--builddir $(AHC_CABAL_BUILD_DIR) --installdir $(AHC_CABAL_INSTALL_DIR) \
--install-method copy --overwrite-policy always
.PHONY: link
link: compile
mkdir -p $(ASTERIUS_OUTPUT_DIR)
docker run --rm -v $(CURDIR):$(DOCKER_WS) -w $(DOCKER_WS) $(DOCKER_IMAGE) \
ahc-dist \
--input-exe $(AHC_CABAL_INSTALL_DIR)/wasm-pandoc \
--output-directory $(ASTERIUS_OUTPUT_DIR) \
--input-mjs static/index.mjs --no-main --browser \
--gc-threshold 640
.PHONY: start
start: link
npm install
ASTERIUS_OUTPUT_DIR=$(ASTERIUS_OUTPUT_DIR) npm start
.PHONY: build
build: link
npm install
ASTERIUS_OUTPUT_DIR=$(ASTERIUS_OUTPUT_DIR) npm run build
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)