-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (52 loc) · 1.77 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
.SUFFIXES:
.PHONY: all
all: build push
REPO ?= docker.pkg.github.com/dockerware/goapp/go-ndk
PLATFORM ?= linux
ARCH ?= amd64
OPENJDK_VERSION ?= 15
GO_VERSION ?= 1.14.2
GO_FILENAME ?= go$(GO_VERSION).$(PLATFORM)-$(ARCH).tar.gz
GRADLE_VERSION ?= 6.3
GRADLE_FILENAME ?= gradle-$(GRADLE_VERSION)-bin.zip
ANDROID_SDK_TOOLS_VERSION ?= 6200805
ANDROID_SDK_TOOLS_FILENAME ?= commandlinetools-$(PLATFORM)-$(ANDROID_SDK_TOOLS_VERSION)_latest.zip
ANDROID_COMPILE_SDK_VERSION ?= 29
ANDROID_BUILD_TOOLS_VERSION ?= 29.0.3
ANDROID_NDK_VERSION ?= 21.1.6352462 # r21b
TAG ?= $(GO_VERSION)-$(ANDROID_NDK_VERSION)
DOCKERFILE = Dockerfile.$(PLATFORM)-$(TAG)
.PHONY: rebuild
rebuild: clean build
.PHONY: build
build: Dockerfile
docker build \
--force-rm \
--tag $(REPO) \
--tag $(REPO):$(TAG) .
.PHONY: push
push: build
docker push $(REPO):$(TAG)
.PHONY: clean
clean:
rm -f Dockerfile $(DOCKERFILE)
Dockerfile: $(DOCKERFILE)
@rm -f Dockerfile
ln -s $(DOCKERFILE) $(@)
$(DOCKERFILE): Dockerfile.in
m4 \
-DOPENJDK_VERSION=$(OPENJDK_VERSION) \
-DGO_VERSION=$(GO_VERSION) \
-DGO_CHECKSUM=$(shell < checksum.txt grep ${GO_FILENAME} | cut -f1) \
-DGO_FILENAME=$(GO_FILENAME) \
-DGOMOBILE_VERSION=$(GOMOBILE_VERSION) \
-DGRADLE_VERSION=$(GRADLE_VERSION) \
-DGRADLE_CHECKSUM=$(shell < checksum.txt grep ${GRADLE_FILENAME} | cut -f1) \
-DGRADLE_FILENAME=$(GRADLE_FILENAME) \
-DANDROID_SDK_TOOLS_VERSION=$(ANDROID_SDK_TOOLS_VERSION) \
-DANDROID_SDK_TOOLS_CHECKSUM=$(shell < checksum.txt grep ${ANDROID_SDK_TOOLS_FILENAME} | cut -f1) \
-DANDROID_SDK_TOOLS_FILENAME=$(ANDROID_SDK_TOOLS_FILENAME) \
-DANDROID_COMPILE_SDK_VERSION=$(ANDROID_COMPILE_SDK_VERSION) \
-DANDROID_BUILD_TOOLS_VERSION=$(ANDROID_BUILD_TOOLS_VERSION) \
-DANDROID_NDK_VERSION=$(ANDROID_NDK_VERSION) \
Dockerfile.in > $(@)