-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (26 loc) · 1.03 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PHP_VERSION := 8.3.8
IMAGE := php$(PHP_VERSION)-builder
MOUNT := -v ./rpmbuild/SOURCES:/root/rpmbuild/SOURCES \
-v ./rpmbuild/SPECS:/root/rpmbuild/SPECS \
-v ./rpmbuild/RPMS:/root/rpmbuild/RPMS \
-v ./rpmbuild/SRPMS:/root/rpmbuild/SRPMS
SOURCES := rpmbuild/SOURCES/php-$(PHP_VERSION).tar.xz \
rpmbuild/SOURCES/php-$(PHP_VERSION).tar.xz.asc
TARGET := build-arm64 \
build-amd64
all: build
build: $(SOURCES) $(TARGET)
rpmbuild/SOURCES/php-$(PHP_VERSION).tar.xz:
curl -f -o $@ -LO https://www.php.net/distributions/$(@F)
rpmbuild/SOURCES/php-$(PHP_VERSION).tar.xz.asc:
curl -f -o $@ -LO https://www.php.net/distributions/$(@F)
build-%:
docker build --build-arg PLATFORM=linux/$* -t $(IMAGE):$* .
docker run --rm $(MOUNT) $(IMAGE):$*
clean:
-$(RM) -r rpmbuild/{RPMS,SRPMS}
-$(RM) rpmbuild/SOURCES/php-$(PHP_VERSION).tar.xz
-$(RM) rpmbuild/SOURCES/php-$(PHP_VERSION).tar.xz.asc
clean-image:
-docker rmi $(shell docker images --filter=reference="$(IMAGE):*" -q)
.PHONY: all build clean clean-image