-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 1.1 KB
/
Makefile
File metadata and controls
42 lines (31 loc) · 1.1 KB
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
DOCKER ?= docker
HOST_ARCH := $(shell uname -m)
IMAGE ?= ghcr.io/clangbuiltlinux/llvm-project
.DEFAULT_GOAL := clang
%.svg: %.dot
dot -Tsvg $< > $@
dotfiles: stage2.svg stage1.svg
.PHONY: clang epoch1 epoch2 epoch3
# Argument 1: epoch# (e.g., epoch1; should match the suffix of the Dockerfile)
# Argument 2: Tag (e.g., ghcr.io/clangbuiltlinux/llvm-project:stage2-x86_64)
# Argument 3 (optional): Tag of previous epoch to build current epoch from.
epoch_cmd = \
$(DOCKER) build \
$(if $(3),--build-arg BASE=$(3)) \
--file Dockerfile.$(1) \
--tag $(2) \
.
epoch1:
$(call epoch_cmd,$@,$(IMAGE):stage2-$(HOST_ARCH))
epoch2:
$(call epoch_cmd,$@,$(IMAGE):stage2-$(HOST_ARCH),$(IMAGE):stage2-$(HOST_ARCH))
epoch3:
$(call epoch_cmd,$@,$(IMAGE):stage3-$(HOST_ARCH),$(IMAGE):stage2-$(HOST_ARCH))
epoch4:
$(call epoch_cmd,$@,$(IMAGE):stage4-$(HOST_ARCH),$(IMAGE):stage3-$(HOST_ARCH))
clang: epoch4
$(DOCKER) create --name llvm-project $(IMAGE):stage4-$(HOST_ARCH)
$(DOCKER) cp llvm-project:/usr/local/bin/clang-14 clang
$(DOCKER) rm llvm-project
test: epoch4
bash ../ci/test-clang.sh $(IMAGE):stage4-$(HOST_ARCH)