forked from rancher/os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (38 loc) · 1.46 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
include build.conf
FORCE_PULL := 0
DEV_BUILD := 0
installer: minimal
docker build -t $(IMAGE_NAME):$(VERSION) .
bin/rancheros:
mkdir -p $(dir $@)
go build -tags netgo -installsuffix netgo -ldflags "-X github.com/rancher/os/config.VERSION=$(VERSION) -linkmode external -extldflags -static" -o $@
strip --strip-all $@
pwd := $(shell pwd)
include scripts/build-common
assets/docker:
mkdir -p $(dir $@)
curl -L "$(DOCKER_BINARY_URL)" > $@
chmod +x $@
$(DIST)/artifacts/vmlinuz: $(BUILD)/kernel/
mkdir -p $(dir $@)
mv $(BUILD)/kernel/boot/vmlinuz* $@
$(BUILD)/kernel/:
mkdir -p $@
([ -e "$(COMPILED_KERNEL_URL)" ] && cat "$(COMPILED_KERNEL_URL)" || curl -L "$(COMPILED_KERNEL_URL)") | tar -xzf - -C $@
$(BUILD)/images.tar: bin/rancheros
FORCE_PULL=$(FORCE_PULL) ./scripts/mk-images-tar.sh
$(DIST)/artifacts/initrd: bin/rancheros assets/docker $(BUILD)/kernel/ $(BUILD)/images.tar
mkdir -p $(dir $@)
DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) ./scripts/mk-initrd.sh
$(DIST)/artifacts/rancheros.iso: minimal
./scripts/mk-rancheros-iso.sh
$(DIST)/artifacts/iso-checksums.txt: $(DIST)/artifacts/rancheros.iso
./scripts/mk-iso-checksums-txt.sh
version:
@echo $(VERSION)
all: minimal installer iso
minimal: $(DIST)/artifacts/initrd $(DIST)/artifacts/vmlinuz
iso: $(DIST)/artifacts/rancheros.iso $(DIST)/artifacts/iso-checksums.txt
test: minimal
cd tests/integration && tox
.PHONY: build-all minimal iso installer version bin/rancheros integration-tests