-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
76 lines (60 loc) · 3.6 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
include Makefile.inc
.PHONY: all base android darwin darwin-sdk-extractor freebsd linux windows web
# RUNNER is the CLI used to interact with docker or podman
RUNNER := $(shell 2>/dev/null 1>&2 docker version && echo "docker" || echo "podman")
base: .base
.base: base/Dockerfile
@$(RUNNER) build -f ${CURDIR}/base/Dockerfile -t ${REPOSITORY}:${VERSION}-base .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-base ${REPOSITORY}:base
@touch .base
android: .android
.android: .base android/Dockerfile
@$(RUNNER) build --build-arg FYNE_CROSS_IMAGES_VERSION=${VERSION} --build-arg FYNE_CROSS_REPOSITORY=${REPOSITORY} -f ${CURDIR}/android/Dockerfile -t ${REPOSITORY}:${VERSION}-android .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-android ${REPOSITORY}:android
@touch .android
darwin: .darwin
.darwin: .base darwin/Dockerfile
@$(RUNNER) build --build-arg FYNE_CROSS_IMAGES_VERSION=${VERSION} --build-arg FYNE_CROSS_REPOSITORY=${REPOSITORY} -f ${CURDIR}/darwin/Dockerfile -t ${REPOSITORY}:${VERSION}-darwin .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-darwin ${REPOSITORY}:darwin
@touch .darwin
darwin-sdk-extractor: .darwin-sdk-extractor
.darwin-sdk-extractor: .base darwin-sdk-extractor/Dockerfile
@$(RUNNER) build --build-arg FYNE_CROSS_IMAGES_VERSION=${VERSION} --build-arg FYNE_CROSS_REPOSITORY=${REPOSITORY} -f ${CURDIR}/darwin-sdk-extractor/Dockerfile -t ${REPOSITORY}:${VERSION}-darwin-sdk-extractor .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-darwin-sdk-extractor ${REPOSITORY}:darwin-sdk-extractor
@touch .darwin-sdk-extractor
freebsd-base: .freebsd-base
.freebsd-base: .base freebsd/base/Dockerfile
@$(RUNNER) build --build-arg FYNE_CROSS_IMAGES_VERSION=${VERSION} --build-arg FYNE_CROSS_REPOSITORY=${REPOSITORY} -f ${CURDIR}/freebsd/base/Dockerfile -t ${REPOSITORY}:${VERSION}-freebsd-base .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-freebsd-base ${REPOSITORY}:freebsd-base
@touch .freebsd-base
freebsd-amd64: .freebsd-amd64
.freebsd-amd64: .freebsd-base freebsd/amd64/Dockerfile
@$(RUNNER) build --build-arg FYNE_CROSS_IMAGES_VERSION=${VERSION} --build-arg FYNE_CROSS_REPOSITORY=${REPOSITORY} -f ${CURDIR}/freebsd/amd64/Dockerfile -t ${REPOSITORY}:${VERSION}-freebsd-amd64 .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-freebsd-amd64 ${REPOSITORY}:freebsd-amd64
@touch .freebsd-amd64
freebsd-arm64: .freebsd-arm64
.freebsd-arm64: .freebsd-base freebsd/arm64/Dockerfile
@$(RUNNER) build --build-arg FYNE_CROSS_IMAGES_VERSION=${VERSION} --build-arg FYNE_CROSS_REPOSITORY=${REPOSITORY} -f ${CURDIR}/freebsd/arm64/Dockerfile -t ${REPOSITORY}:${VERSION}-freebsd-arm64 .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-freebsd-arm64 ${REPOSITORY}:freebsd-arm64
@touch .freebsd-arm64
freebsd: freebsd-amd64 freebsd-arm64
linux: .linux
.linux: .base linux/Dockerfile
@$(RUNNER) build --build-arg FYNE_CROSS_IMAGES_VERSION=${VERSION} --build-arg FYNE_CROSS_REPOSITORY=${REPOSITORY} -f ${CURDIR}/linux/Dockerfile -t ${REPOSITORY}:${VERSION}-linux .
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-linux ${REPOSITORY}:linux
@touch .linux
web: base
# web image is a tag to the base image
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-base ${REPOSITORY}:${VERSION}-web
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-web ${REPOSITORY}:web
windows: base
# windows image is a tag to the base image
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-base ${REPOSITORY}:${VERSION}-windows
@$(RUNNER) tag ${REPOSITORY}:${VERSION}-windows ${REPOSITORY}:windows
all: base android darwin darwin-sdk-extractor freebsd linux windows web
base-pull:
@$(RUNNER) pull ${REPOSITORY}:${VERSION}-base
touch .base
android-push: android
@$(RUNNER) push ${REPOSITORY}:${VERSION}-android
@$(RUNNER) push ${REPOSITORY}:android