forked from compiler-explorer/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (44 loc) · 1.78 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
.NOTPARALLEL:
all: docker-images
DOCKER := sudo docker
PACKER ?= ../packer
BUILD_OPT = $${https_proxy:+--build-arg https_proxy=$$https_proxy} $${http_proxy:+--build-arg http_proxy=$$http_proxy}
define add-image
DOCKER_IMAGES += $(2)-image
$(2)-image: base-image
$(DOCKER) build $(BUILD_OPT) -t "mattgodbolt/compiler-explorer:$(1)" docker/$(2)
endef
base-image:
$(DOCKER) build $(BUILD_OPT) -t "mattgodbolt/compiler-explorer:base" docker/base
$(eval $(call add-image,d,d-explorer))
$(eval $(call add-image,gcc,gcc-explorer))
$(eval $(call add-image,go,go-explorer))
$(eval $(call add-image,rust,rust-explorer))
$(eval $(call add-image,cppx,cppx-explorer))
$(eval $(call add-image,ispc,ispc-explorer))
$(eval $(call add-image,haskell,haskell-explorer))
$(eval $(call add-image,swift,swift-explorer))
exec-image:
$(DOCKER) build $(BUILD_OPT) -t "mattgodbolt/compiler-explorer:exec" exec
DOCKER_IMAGES += exec-image
docker-images: $(DOCKER_IMAGES)
config.json: make_json.py
python make_json.py
packer: config.json
$(PACKER) build -var-file=config.json packer.json
publish: docker-images
$(DOCKER) push $(BUILD_OPT) mattgodbolt/compiler-explorer
build-compiler-images:
$(DOCKER) build $(BUILD_OPT) -t mattgodbolt/clang-builder clang
$(DOCKER) push mattgodbolt/clang-builder
$(DOCKER) build $(BUILD_OPT) -t mattgodbolt/gcc-builder gcc
$(DOCKER) push mattgodbolt/gcc-builder
$(DOCKER) build $(BUILD_OPT) -t mattgodbolt/gcc-cross gcc-cross
$(DOCKER) push mattgodbolt/gcc-cross
update-compilers:
$(DOCKER) build $(BUILD_OPT) -t mattgodbolt/gcc-builder:update update_compilers
$(DOCKER) push mattgodbolt/gcc-builder:update
python update_efs_compilers.py
clean:
echo nothing to clean yet
.PHONY: all clean docker-images base-image $(DOCKER_IMAGES) publish packer update-compilers build-compiler-images