pstds/Makefile
2020-09-03 19:35:55 +03:00

67 lines
1.3 KiB
Makefile

REBAR := $(shell which rebar3 2>/dev/null || which ./rebar3)
SUBMODULES = build_utils
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
UTILS_PATH := build_utils
TEMPLATES_PATH := .
# Name of the service
SERVICE_NAME := pstds
# Service image default tag
SERVICE_IMAGE_TAG ?= $(shell git rev-parse HEAD)
# The tag for service image to be pushed with
SERVICE_IMAGE_PUSH_TAG ?= $(SERVICE_IMAGE_TAG)
# Base image for the service
BASE_IMAGE_NAME := service-erlang
BASE_IMAGE_TAG := da0ab769f01b650b389d18fc85e7418e727cbe96
BUILD_IMAGE_TAG := e7eb72b7721443d88a948546da815528a96c6de9
CALL_W_CONTAINER := all submodules compile xref lint dialyze test start devrel release clean distclean
.PHONY: $(CALL_W_CONTAINER)
all: compile
-include $(UTILS_PATH)/make_lib/utils_container.mk
-include $(UTILS_PATH)/make_lib/utils_image.mk
$(SUBTARGETS): %/.git: %
git submodule update --init $<
touch $@
submodules: $(SUBTARGETS)
compile: submodules
$(REBAR) compile
xref: submodules
$(REBAR) xref
lint:
elvis rock
dialyze: submodules
$(REBAR) dialyzer
start: submodules
$(REBAR) run
devrel: submodules
$(REBAR) release
release: submodules distclean
$(REBAR) as prod release
clean:
$(REBAR) clean
distclean:
$(REBAR) clean -a
rm -rf _build
test: submodules
$(REBAR) do eunit,ct