2015-09-08 12:14:06 +05:00
|
|
|
include build.conf
|
|
|
|
FORCE_PULL := 0
|
2015-09-19 20:43:00 +05:00
|
|
|
DEV_BUILD := 0
|
2015-09-24 23:16:48 -07:00
|
|
|
GODEP := godep
|
2015-08-06 00:46:22 +05:00
|
|
|
|
|
|
|
|
2015-08-06 00:04:46 -07:00
|
|
|
bin/rancheros:
|
2015-08-07 19:34:05 +05:00
|
|
|
mkdir -p $(dir $@)
|
2015-10-12 19:50:17 +08:00
|
|
|
$(GODEP) go build -tags netgo -installsuffix netgo -ldflags "-X github.com/rancher/os/config.VERSION $(VERSION) -linkmode external -extldflags -static" -o $@
|
2015-08-06 00:46:22 +05:00
|
|
|
strip --strip-all $@
|
|
|
|
|
|
|
|
|
|
|
|
pwd := $(shell pwd)
|
|
|
|
include scripts/build-common
|
|
|
|
|
|
|
|
|
2015-08-06 00:04:46 -07:00
|
|
|
assets/docker:
|
2015-08-07 19:34:05 +05:00
|
|
|
mkdir -p $(dir $@)
|
2015-08-06 00:04:46 -07:00
|
|
|
curl -L "$(DOCKER_BINARY_URL)" > $@
|
2015-08-06 00:46:22 +05:00
|
|
|
chmod +x $@
|
|
|
|
|
2015-08-06 00:04:46 -07:00
|
|
|
|
2015-08-07 19:34:05 +05:00
|
|
|
$(DIST)/artifacts/vmlinuz: $(BUILD)/kernel/
|
|
|
|
mkdir -p $(dir $@)
|
|
|
|
mv $(BUILD)/kernel/boot/vmlinuz* $@
|
2015-08-06 00:46:22 +05:00
|
|
|
|
|
|
|
|
2015-08-07 19:34:05 +05:00
|
|
|
$(BUILD)/kernel/:
|
2015-10-01 15:39:20 -07:00
|
|
|
mkdir -p $@
|
|
|
|
([ -e "$(COMPILED_KERNEL_URL)" ] && cat "$(COMPILED_KERNEL_URL)" || curl -L "$(COMPILED_KERNEL_URL)") | tar -xzf - -C $@
|
2015-08-06 00:46:22 +05:00
|
|
|
|
|
|
|
|
2015-08-07 19:34:05 +05:00
|
|
|
$(BUILD)/images.tar: bin/rancheros
|
|
|
|
FORCE_PULL=$(FORCE_PULL) ./scripts/mk-images-tar.sh
|
2015-08-06 00:46:22 +05:00
|
|
|
|
2015-08-06 00:04:46 -07:00
|
|
|
|
2015-08-07 19:34:05 +05:00
|
|
|
$(DIST)/artifacts/initrd: bin/rancheros assets/docker $(BUILD)/kernel/ $(BUILD)/images.tar
|
|
|
|
mkdir -p $(dir $@)
|
2015-09-19 20:43:00 +05:00
|
|
|
DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) ./scripts/mk-initrd.sh
|
2015-08-06 00:46:22 +05:00
|
|
|
|
2015-08-06 00:04:46 -07:00
|
|
|
|
2015-09-09 13:25:25 +05:00
|
|
|
$(DIST)/artifacts/rancheros.iso: minimal
|
2015-08-07 19:34:05 +05:00
|
|
|
./scripts/mk-rancheros-iso.sh
|
2015-08-06 00:46:22 +05:00
|
|
|
|
2015-08-06 00:04:46 -07:00
|
|
|
|
2015-08-06 00:46:22 +05:00
|
|
|
$(DIST)/artifacts/iso-checksums.txt: $(DIST)/artifacts/rancheros.iso
|
2015-08-06 01:58:32 +05:00
|
|
|
./scripts/mk-iso-checksums-txt.sh
|
2015-08-06 00:46:22 +05:00
|
|
|
|
2015-08-06 00:04:46 -07:00
|
|
|
|
2015-08-06 00:46:22 +05:00
|
|
|
version:
|
|
|
|
@echo $(VERSION)
|
|
|
|
|
2015-09-09 13:25:25 +05:00
|
|
|
installer: minimal
|
2015-09-08 12:14:06 +05:00
|
|
|
docker build -t $(IMAGE_NAME):$(VERSION) .
|
2015-08-06 00:04:46 -07:00
|
|
|
|
2015-09-09 13:25:25 +05:00
|
|
|
build-all: minimal installer iso
|
|
|
|
|
|
|
|
minimal: $(DIST)/artifacts/initrd $(DIST)/artifacts/vmlinuz
|
|
|
|
|
|
|
|
iso: $(DIST)/artifacts/rancheros.iso $(DIST)/artifacts/iso-checksums.txt
|
2015-08-06 00:46:22 +05:00
|
|
|
|
2015-09-04 14:59:06 +05:00
|
|
|
integration-tests:
|
|
|
|
cd tests/integration && tox
|
2015-08-06 00:46:22 +05:00
|
|
|
|
2015-09-09 13:25:25 +05:00
|
|
|
.PHONY: build-all minimal iso installer version bin/rancheros integration-tests
|