2017-05-20 08:11:06 +03:00
|
|
|
SHELL:=/bin/bash
|
|
|
|
ENGINE_DIR:=$(CURDIR)/../engine
|
|
|
|
CLI_DIR:=$(CURDIR)/../cli
|
2017-12-08 01:25:41 +03:00
|
|
|
VERSION?=0.0.0-dev
|
2017-05-20 08:11:06 +03:00
|
|
|
DOCKER_GITCOMMIT:=abcdefg
|
2018-05-22 01:53:53 +03:00
|
|
|
GO_VERSION:=1.10.2
|
2017-05-20 08:11:06 +03:00
|
|
|
|
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)
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: clean
|
2017-05-20 08:11:06 +03:00
|
|
|
clean: ## remove build artifacts
|
|
|
|
$(MAKE) -C rpm clean
|
|
|
|
$(MAKE) -C deb clean
|
|
|
|
$(MAKE) -C static clean
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: rpm
|
2018-05-15 01:42:03 +03:00
|
|
|
rpm: DOCKER_BUILD_PKGS:=$(shell find rpm -type d | grep ".*-.*" | sed 's/^rpm\///')
|
2017-05-20 08:11:06 +03:00
|
|
|
rpm: ## build rpm 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
|
|
|
|
|
2017-12-28 03:26:04 +03:00
|
|
|
.PHONY: deb
|
2018-05-15 01:42:03 +03:00
|
|
|
deb: DOCKER_BUILD_PKGS:=$(shell find deb -type d | grep ".*-.*" | sed 's/^deb\///')
|
2017-05-20 08:11:06 +03:00
|
|
|
deb: ## build deb 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
|
|
|
|
|
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
|