2019-08-15 00:48:38 +03:00
|
|
|
include common.mk
|
|
|
|
|
2020-03-11 12:06:42 +03:00
|
|
|
CLI_DIR=$(realpath $(CURDIR)/../cli)
|
|
|
|
ENGINE_DIR=$(realpath $(CURDIR)/../engine)
|
|
|
|
STATIC_VERSION=$(shell static/gen-static-ver $(ENGINE_DIR) $(VERSION))
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2018-08-02 21:32:44 +03:00
|
|
|
# Taken from: https://www.cmcrossroads.com/article/printing-value-makefile-variable
|
|
|
|
print-% : ; @echo $($*)
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: help
|
2017-05-20 08:11:06 +03:00
|
|
|
help: ## show make targets
|
|
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
|
2018-08-02 21:32:44 +03:00
|
|
|
.PHONY: clean-engine
|
|
|
|
clean-engine:
|
2020-05-01 15:21:28 +03:00
|
|
|
[ ! -d $(ENGINE_DIR) ] || docker run --rm -v $(ENGINE_DIR):/v -w /v alpine chown -R $(shell id -u):$(shell id -g) /v
|
2018-08-02 21:32:44 +03:00
|
|
|
rm -rf $(ENGINE_DIR)
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: clean
|
2019-12-05 16:55:10 +03:00
|
|
|
clean: ## remove build artifacts
|
2017-05-20 08:11:06 +03:00
|
|
|
$(MAKE) -C rpm clean
|
|
|
|
$(MAKE) -C deb clean
|
|
|
|
$(MAKE) -C static clean
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: rpm
|
2017-05-20 08:11:06 +03:00
|
|
|
rpm: ## build rpm packages
|
2019-07-01 22:41:08 +03:00
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) rpm
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: deb
|
2017-05-20 08:11:06 +03:00
|
|
|
deb: ## build deb packages
|
2019-07-01 22:41:08 +03:00
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) deb
|
2017-05-20 08:11:06 +03:00
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: static
|
2017-05-20 08:11:06 +03:00
|
|
|
static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win cross-arm
|
|
|
|
static: ## build static-compiled packages
|
|
|
|
for p in $(DOCKER_BUILD_PKGS); do \
|
2018-05-22 01:53:53 +03:00
|
|
|
$(MAKE) -C $@ VERSION=$(VERSION) ENGINE_DIR=$(ENGINE_DIR) CLI_DIR=$(CLI_DIR) GO_VERSION=$(GO_VERSION) $${p}; \
|
2017-05-20 08:11:06 +03:00
|
|
|
done
|