-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
47 lines (34 loc) · 941 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
46
47
TAG := docker.pkg.github.com/ponylang/action-testing/test:latest
PACKAGE := http
GET_DEPENDENCIES_WITH := corral fetch
CLEAN_DEPENDENCIES_WITH := corral clean
COMPILE_WITH := corral run -- ponyc
BUILD_DIR ?= build/$(config)
SRC_DIR := $(PACKAGE)
SOURCE_FILES := $(shell find $(SRC_DIR) -name *.pony)
docs_dir := build/$(PACKAGE)-docs
ifdef config
ifeq (,$(filter $(config),debug release))
$(error Unknown configuration "$(config)")
endif
endif
ifeq ($(config),release)
PONYC = $(COMPILE_WITH)
else
PONYC = $(COMPILE_WITH) --debug
endif
all: build push
build:
docker build --pull -t ${TAG} .
pylint: build
docker run --entrypoint pylint --rm ${TAG} /entrypoint.py
push:
docker push ${TAG}
$(docs_dir): $(BUILD_DIR) $(SOURCE_FILES)
rm -rf $(docs_dir)
$(GET_DEPENDENCIES_WITH)
$(PONYC) --docs-public --pass=docs --output build $(SRC_DIR)
docs: $(docs_dir)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
.PHONY: build pylint push