1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00
falk-werner_webfuse-provider/Makefile

124 lines
4.2 KiB
Makefile
Raw Normal View History

SHELL := /bin/sh
MAKEFILE := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
.PHONY: default
default: all
#######################################################################################################################
# Overridable project defaults
DOBUILD_DOCKERFILE ?= $(PROJECTDIR)/build/%MARCH%-%DISTRIB_ID%-%ID%.dockerfile
2020-06-07 14:21:15 +00:00
DOBUILD_EXTDIR ?= $(PROJECTDIR)/build/dobuild-extensions
DOBUILD_PROJECTDIR ?= $(patsubst %/,%,$(dir $(MAKEFILE)))
2020-06-07 14:21:15 +00:00
DOBUILD_GENERIC_ADAPTER ?= meson
DOBUILDDIR ?= $(PROJECTDIR)/build/dobuild
PROJECTDIR = $(DOBUILD_PROJECTDIR)
include $(DOBUILDDIR)/defaults.mk
#######################################################################################################################
# Project defaults and macros
DEFAULTTARGET = x86_64-ubuntu@bionic+builder@debug
FETCHDIR = $(BUILDDIR)/.deps
dobuild_image_buildargs = \
$(addprefix MARCH=,%MARCH%) \
$(addprefix DISTRIB_VERSION=,%DISTRIB_VERSION%) \
$(addprefix USERID=,$(USERID))
#######################################################################################################################
# Project dependencies
DUMB_INIT_VERSION ?= 1.2.2
IMAGE_BUILDARGS += DUMB_INIT_VERSION=$(DUMB_INIT_VERSION)
FETCH_TARGETS += $(FETCHDIR)/dumb-init-$(DUMB_INIT_VERSION).tar.gz
$(FETCHDIR)/dumb-init-$(DUMB_INIT_VERSION).tar.gz: URL := https://github.com/Yelp/dumb-init/archive/v${DUMB_INIT_VERSION}.tar.gz
$(SKIP_MD5SUM)$(FETCHDIR)/dumb-init-$(DUMB_INIT_VERSION).tar.gz: MD5 := 6166084b05772cdcf615a762c6f3b32e
2020-03-20 16:03:33 +00:00
FUSE_VERSION ?= 3.9.1
IMAGE_BUILDARGS += FUSE_VERSION=$(FUSE_VERSION)
FETCH_TARGETS += $(FETCHDIR)/libfuse-fuse-$(FUSE_VERSION).tar.gz
$(FETCHDIR)/libfuse-fuse-$(FUSE_VERSION).tar.gz: URL := https://github.com/libfuse/libfuse/archive/fuse-$(FUSE_VERSION).tar.gz
2020-03-20 16:03:33 +00:00
$(SKIP_MD5SUM)$(FETCHDIR)/libfuse-fuse-$(FUSE_VERSION).tar.gz: MD5 := 5f7c1062def710d8b60343524a18cc82
2019-12-01 18:01:40 +00:00
QEMU_VERSION ?= v4.1.0-1
IMAGE_BUILDARGS += QEMU_VERSION_=$(QEMU_VERSION)
FETCH_TARGETS += $(FETCHDIR)/qemu-arm-static-$(QEMU_VERSION)
$(FETCHDIR)/qemu-arm-static-$(QEMU_VERSION): URL := https://github.com/multiarch/qemu-user-static/releases/download/$(QEMU_VERSION)/qemu-arm-static
2019-12-01 18:01:40 +00:00
$(SKIP_MD5SUM)$(FETCHDIR)/qemu-arm-static-$(QEMU_VERSION): MD5 := e508e6e4dd7f3a851207aac245a4653f
2019-03-23 03:07:47 +00:00
#######################################################################################################################
2019-03-23 03:07:47 +00:00
# Architecture-specific rule target configuration
2020-06-07 14:21:15 +00:00
GENERIC_TARGETS += $(call target_properties_combine,\
,\
x86_64 arm32v7,\
ubuntu@bionic alpine@3.9,\
,\
,\
builder,\
,\
debug release coverage minsize \
)
2020-06-07 14:21:15 +00:00
DOCKER_TARGETS += $(GENERIC_TARGETS)
#######################################################################################################################
2019-03-23 03:07:47 +00:00
# Common rule target configuration
CURLFLAGS += -s
DOCKER_RUNFLAGS += --device /dev/fuse
DOCKER_RUNFLAGS += --cap-add SYS_ADMIN
DOCKER_RUNFLAGS += --security-opt apparmor:unconfined
DOCKER_RUNFLAGS += --cap-add SYS_PTRACE
DOCKER_RUNFLAGS += --security-opt seccomp=unconfined
OUTDIRS += $(OUTDIR)/src
OUTDIRS += $(OUTDIR)/docker
EXTRACT_TARGETS += $(OUTDIR)/docker/qemu-arm-static-$(QEMU_VERSION)
EXTRACT_TARGETS += $(patsubst $(FETCHDIR)/%.tar.gz,$(OUTDIR)/src/%,$(FETCH_TARGETS))
#######################################################################################################################
# Makefile dependencies
MAKEFILE_DEPS += gzip
MAKEFILE_DEPS += tar
MAKEFILE_DEPS += chmod
MAKEFILE_DEPS += touch
MAKEFILE_DEPS += cp
#######################################################################################################################
# Rules
include $(DOBUILDDIR)/docker.mk
include $(DOBUILDDIR)/standardrules.mk
$(FETCH_TARGETS): | $(FETCHDIR)
$(SILENT)$(call curl,$@,$(URL),$(MD5))
$(OUTDIR)/docker/qemu-arm-static-$(QEMU_VERSION) : $(FETCHDIR)/qemu-arm-static-$(QEMU_VERSION) | $(OUTDIRS)
$(SILENT) \
$(call echo_if_silent_cmd,cp $< $@) \
&& cp $< $@ \
&& chmod +x $@
$(OUTDIR)/src/%: $(FETCHDIR)/%.tar.gz | $(OUTDIRS)
$(SILENT) \
$(call echo_if_silent_cmd,tar -C $(dir $@) -xf $<) \
&& tar -I 'gzip -n' -C $(dir $@) -xf $< \
&& touch $@
$(FETCHDIR):
$(SILENT)mkdir -p $@
.DELETE_ON_ERROR: $(FETCH_TARGETS)