-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (61 loc) · 2.67 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
77
78
LLVM_CONFIG ?= llvm-config
CGO_CFLAGS=
CGO_LDFLAGS=$(strip -L$(shell ${LLVM_CONFIG} --libdir) -Wl,-rpath,$(shell ${LLVM_CONFIG} --libdir))
go-clang-gen-$*: build/%
build/%:
CGO_CFLAGS='${CGO_CFLAGS}' CGO_LDFLAGS='${CGO_LDFLAGS}' go build -v -x -o go-clang-gen-$* ./cmd/go-clang-gen
gen/%:
cd $(shell go env GOPATH)/src/github.com/go-clang/clang-v$*; \
$(shell go env GOPATH)/src/github.com/go-clang/gen/go-clang-gen-$* -llvm-root=$(shell ${LLVM_CONFIG} --prefix)
GOLANG_VERSION=1.19
TARGET=llvm
DOCKER_FLAGS=--rm --pull --label=org.opencontainers.image.revision=$(shell git rev-parse --verify HEAD | cut -c -12)
ifeq ($V,1)
DOCKER_FLAGS+=--progress=plain
endif
define docker_build_4_10
docker builder build $(strip ${DOCKER_FLAGS}) --target=${TARGET} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg LLVM_VERSION=${1} --build-arg GOLANG_VERSION=${GOLANG_VERSION} --output=type=docker -t ghcr.io/go-clang/base:${2} -f ${3} ./base
endef
define docker_build_11_14
docker builder build $(strip ${DOCKER_FLAGS}) --target=${TARGET} --build-arg LLVM_VERSION=${1} --build-arg GOLANG_VERSION=${GOLANG_VERSION} --output=type=docker -t ghcr.io/go-clang/base:${2} -f ${3} ./base
endef
.PHONY: docker/build/4.0.0
docker/build/4.0.0: UBUNTU_VERSION=18.04
docker/build/4.0.0:
$(call docker_build_4_10,4,4.0.0,./base/llvm-4-10.dockerfile)
.PHONY: docker/build/5.0.0
docker/build/5.0.0: UBUNTU_VERSION=18.04
docker/build/5.0.0:
$(call docker_build_4_10,5,5.0.0,./base/llvm-4-10.dockerfile)
.PHONY: docker/build/6.0.0
docker/build/6.0.0: UBUNTU_VERSION=18.04
docker/build/6.0.0:
$(call docker_build_4_10,6,6.0.0,./base/llvm-4-10.dockerfile)
.PHONY: docker/build/7.0.0
docker/build/7.0.0: UBUNTU_VERSION=20.04
docker/build/7.0.0:
$(call docker_build_4_10,7,7.0.0,./base/llvm-4-10.dockerfile)
.PHONY: docker/build/8.0.0
docker/build/8.0.0: UBUNTU_VERSION=20.04
docker/build/8.0.0:
$(call docker_build_4_10,8,8.0.0,./base/llvm-4-10.dockerfile)
.PHONY: docker/build/9.0.0
docker/build/9.0.0: UBUNTU_VERSION=20.04
docker/build/9.0.0:
$(call docker_build_4_10,9,9.0.0,./base/llvm-4-10.dockerfile)
.PHONY: docker/build/10.0.0
docker/build/10.0.0: UBUNTU_VERSION=20.04
docker/build/10.0.0:
$(call docker_build_4_10,10,10.0.0,./base/llvm-4-10.dockerfile)
.PHONY: docker/build/11.1.0
docker/build/11.1.0:
$(call docker_build_11_14,11,11.1.0,./base/llvm-11-14.dockerfile)
.PHONY: docker/build/12.0.1
docker/build/12.0.1:
$(call docker_build_11_14,12,12.0.1,./base/llvm-11-14.dockerfile)
.PHONY: docker/build/13.0.1
docker/build/13.0.1:
$(call docker_build_11_14,13,13.0.1,./base/llvm-11-14.dockerfile)
.PHONY: docker/build/14.0.6
docker/build/14.0.6:
$(call docker_build_11_14,14,14.0.6,./base/llvm-11-14.dockerfile)