1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 06:11:12 +00:00
Files
os/Makefile

105 lines
2.4 KiB
Makefile
Raw Normal View History

FORCE_PULL := 0
DEV_BUILD := 0
HOST_ARCH := amd64
ARCH := amd64
SUFFIX := $(if $(filter-out amd64,$(ARCH)),_$(ARCH))
2015-07-23 18:53:01 +05:00
include build.conf
include build.conf.$(ARCH)
2015-07-23 18:53:01 +05:00
bin/ros:
mkdir -p $(dir $@)
ARCH=$(ARCH) VERSION=$(VERSION) ./scripts/mk-ros.sh $@
2015-08-06 00:04:46 -07:00
build/host_ros: bin/ros
mkdir -p $(dir $@)
ifeq "$(ARCH)" "$(HOST_ARCH)"
ln -sf ../bin/ros $@
else
ARCH=$(HOST_ARCH) TOOLCHAIN= VERSION=$(VERSION) ./scripts/mk-ros.sh $@
endif
2015-07-23 18:53:01 +05:00
assets/docker:
mkdir -p $(dir $@)
wget -O - "$(DOCKER_BINARY_URL)" > $@
chmod +x $@
2015-08-06 00:04:46 -07:00
2016-02-19 16:11:32 -08:00
assets/selinux/policy.29:
mkdir -p $(dir $@)
wget -O - "$(SELINUX_POLICY_URL)" > $@
2015-07-23 18:53:01 +05:00
2016-03-31 15:35:45 -07:00
assets/modules.tar.gz:
mkdir -p $(dir $@)
2016-04-01 10:08:32 -07:00
ifeq "$(ARCH)" "amd64"
2016-03-31 15:35:45 -07:00
curl -L "$(VBOX_MODULES_URL)" > $@
2016-04-01 10:08:32 -07:00
else
touch $@
endif
2016-03-31 15:35:45 -07:00
ifdef COMPILED_KERNEL_URL
installer: minimal
docker build -t $(IMAGE_NAME):$(VERSION)$(SUFFIX) -f Dockerfile.$(ARCH) .
2016-02-29 13:26:41 -08:00
dist/artifacts/vmlinuz: build/kernel/
mkdir -p $(dir $@)
mv $(or $(wildcard build/kernel/boot/vmlinuz*), $(wildcard build/kernel/boot/vmlinux*)) $@
2015-07-23 18:53:01 +05:00
2016-02-29 13:26:41 -08:00
build/kernel/:
mkdir -p $@
wget -O - "$(COMPILED_KERNEL_URL)" | tar -xzf - -C $@
2015-07-23 18:53:01 +05:00
2016-03-31 15:35:45 -07:00
dist/artifacts/initrd: bin/ros assets/docker assets/selinux/policy.29 build/kernel/ build/images.tar assets/modules.tar.gz
mkdir -p $(dir $@)
2016-03-31 15:35:45 -07:00
SUFFIX=$(SUFFIX) DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) \
KERNEL_RELEASE=$(KERNEL_RELEASE) ARCH=$(ARCH) ./scripts/mk-initrd.sh $@
2015-07-23 18:53:01 +05:00
2016-02-29 13:26:41 -08:00
dist/artifacts/rancheros.iso: minimal
./scripts/mk-rancheros-iso.sh
all: minimal installer iso
2016-02-29 13:26:41 -08:00
initrd: dist/artifacts/initrd
2016-02-29 13:26:41 -08:00
minimal: initrd dist/artifacts/vmlinuz
2016-02-29 13:26:41 -08:00
iso: dist/artifacts/rancheros.iso dist/artifacts/iso-checksums.txt
test: minimal
2016-04-13 11:23:21 -07:00
./scripts/unit-test
cd tests/integration && HOST_ARCH=$(HOST_ARCH) ARCH=$(ARCH) tox
.PHONY: all minimal initrd iso installer test
endif
2016-02-23 19:06:14 -08:00
build/os-config.yml: build/host_ros
ARCH=$(ARCH) VERSION=$(VERSION) ./scripts/gen-os-config.sh $@
2016-02-29 13:26:41 -08:00
build/images.tar: build/host_ros build/os-config.yml
ARCH=$(ARCH) FORCE_PULL=$(FORCE_PULL) ./scripts/mk-images-tar.sh
2016-03-31 15:35:45 -07:00
dist/artifacts/rootfs.tar.gz: bin/ros assets/docker build/images.tar assets/selinux/policy.29 assets/modules.tar.gz
mkdir -p $(dir $@)
SUFFIX=$(SUFFIX) DFS_IMAGE=$(DFS_IMAGE) DEV_BUILD=$(DEV_BUILD) IS_ROOTFS=1 ./scripts/mk-initrd.sh $@
2016-02-29 13:26:41 -08:00
dist/artifacts/iso-checksums.txt: dist/artifacts/rancheros.iso
./scripts/mk-iso-checksums-txt.sh
2015-07-23 18:53:01 +05:00
version:
@echo $(VERSION)
2016-02-29 13:26:41 -08:00
rootfs: dist/artifacts/rootfs.tar.gz
.PHONY: rootfs version bin/ros