build: simplify detection of the target platform
It can be done within the container, rather than having to compute it in the Makefile and then pass it as an argument.
This commit is contained in:
20
Makefile
20
Makefile
@@ -2,20 +2,9 @@ FORCE_REBUILD ?= 0
|
||||
JITSI_RELEASE ?= stable
|
||||
JITSI_BUILD ?= unstable
|
||||
JITSI_REPO ?= jitsi
|
||||
NATIVE_ARCH ?= $(shell uname -m)
|
||||
|
||||
JITSI_SERVICES := base base-java web prosody jicofo jvb jigasi jibri
|
||||
|
||||
ifeq ($(NATIVE_ARCH),x86_64)
|
||||
TARGETPLATFORM := linux/amd64
|
||||
else ifeq ($(NATIVE_ARCH),aarch64)
|
||||
TARGETPLATFORM := linux/arm64
|
||||
else ifeq ($(NATIVE_ARCH),arm64)
|
||||
TARGETPLATFORM := linux/arm64
|
||||
else
|
||||
TARGETPLATFORM := unsupported
|
||||
endif
|
||||
|
||||
BUILD_ARGS := \
|
||||
--build-arg JITSI_REPO=$(JITSI_REPO) \
|
||||
--build-arg JITSI_RELEASE=$(JITSI_RELEASE)
|
||||
@@ -43,19 +32,12 @@ buildx:
|
||||
$(addprefix buildx_,$(JITSI_SERVICES)):
|
||||
$(MAKE) --no-print-directory JITSI_SERVICE=$(patsubst buildx_%,%,$@) buildx
|
||||
|
||||
ifeq ($(TARGETPLATFORM), unsupported)
|
||||
build:
|
||||
@echo "Unsupported native architecture"
|
||||
@exit 1
|
||||
else
|
||||
build:
|
||||
@echo "Building for $(TARGETPLATFORM)"
|
||||
docker build \
|
||||
$(BUILD_ARGS) --build-arg TARGETPLATFORM=$(TARGETPLATFORM) \
|
||||
$(BUILD_ARGS) \
|
||||
--progress plain \
|
||||
--tag $(JITSI_REPO)/$(JITSI_SERVICE) \
|
||||
$(JITSI_SERVICE)
|
||||
endif
|
||||
|
||||
$(addprefix build_,$(JITSI_SERVICES)):
|
||||
$(MAKE) --no-print-directory JITSI_SERVICE=$(patsubst build_%,%,$@) build
|
||||
|
||||
Reference in New Issue
Block a user