1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/build/mkdocker/defaults.mk
nosamad 979ff1e689 refactor(mkdockerbuild): extracts common parts (#24)
* fixes mount of project in wrapper scripts, when not running in container

* refactors makefile in preparation to extract common parts

* refactors makefiles and scripts

* fix git ignore matches

* adds support to disable fetch

* update

* fixes docker warning about unused build argument

* adds support to force offline build

fixes shell escaping
changes paths to relative where possible

* moves make docker builder support files

* removes unnecessary configuration elements

* fixes initial download directory creation

* adds missing rule for initial download directory creation

* fixes docker error: unable to prepare context

copies dockerfile to build context, in order to remove dependency to
unsupported/new docker feature
2019-04-17 17:25:56 +02:00

58 lines
1.8 KiB
Makefile

CURRENT_MAKEFILE := $(lastword $(MAKEFILE_LIST)))
_INCLUDE_DEFAULTS := T
#######################################################################################################################
# Overridable common defaults
# NOTE: default assumes first loaded makefile is located in root directory of project
MAKEFILE ?= $(firstword $(MAKEFILE_LIST))
MAKEFILE := $(MAKEFILE)
PROJECTDIR ?= $(patsubst %/,%,$(dir $(MAKEFILE)))
SCRIPTDIR ?= $(patsubst %/,%,$(dir $(CURRENT_MAKEFILE)))
OUTDIR ?= $(PROJECTDIR)/.build
BUILDTYPE ?= Debug
BUILDVERBOSE ?=
BUILDSILENT := $(if $(BUILDVERBOSE),,1)
VERSION ?= $(shell cat $(PROJECTDIR)/VERSION)
VERSION := $(VERSION)
USERID ?= $(shell id -u)
USERID := $(USERID)
HOST_MARCH ?= $(shell dpkg --print-architecture 2>/dev/null)
HOST_CONTAINER ?= $(shell $(SCRIPTDIR)/bin/get_container_id.sh)
HOST_CONTAINER := $(HOST_CONTAINER)
$(HOST_CONTAINER)PORTABLE_WORSPACE ?=
CONTAINER_PROJECTDIR ?= /workspace/src
CONTAINER_SCRIPTDIR ?= /workspace/bin
CONTAINER_OUTDIR ?= /workspace/out
$(PORTABLE_WORSPACE)CONTAINER_PROJECTDIR = $(abspath $(PROJECTDIR))
$(PORTABLE_WORSPACE)CONTAINER_SCRIPTDIR = $(abspath $(SCRIPTDIR))
$(PORTABLE_WORSPACE)CONTAINER_OUTDIR = $(abspath $(OUTDIR))
SOURCE_DATE_EPOCH ?= $(shell $(SCRIPTDIR)/bin/get_source_date_epoch.sh)
SOURCE_DATE_EPOCH := $(SOURCE_DATE_EPOCH)
export SOURCE_DATE_EPOCH
BUILDTIME ?= $(shell date -u -d '@$(SOURCE_DATE_EPOCH)' --rfc-3339 ns 2>/dev/null | sed -e 's/ /T/')
BUILDTIME := $(BUILDTIME)
export BUILDTIME
VERBOSE ?=
PARALLELMFLAGS ?=
NPROC ?= $(shell echo '$(PARALLELMFLAGS)' | sed -n -e 's@.*-j.*\([0-9]\+\)@\1@p')
#######################################################################################################################
# Makefile dependencies
MAKEFILE_DEPS += cat
MAKEFILE_DEPS += id
MAKEFILE_DEPS += echo
MAKEFILE_DEPS += sed