hexware-kernel/Makefile
2024-07-26 19:24:18 +03:00

37 lines
1.4 KiB
Makefile

BUILD_DIR=.build
all: kernel qemu
kernel: kernel.build
cp $(BUILD_DIR)/kernel/*.deb $(BUILD_DIR)
qemu: qemu.build
cp $(BUILD_DIR)/qemu/*.deb $(BUILD_DIR)
kernel.build: kernel.prepare
cd $(BUILD_DIR)/kernel && make deb
qemu.build: qemu.prepare
cd $(BUILD_DIR)/qemu && make deb
kernel.prepare:
git submodule update --init --recursive submodules/pve-kernel
mkdir -p $(BUILD_DIR)/kernel/patches/kernel
ln -sf $$(readlink -f submodules/pve-kernel/debian) $(BUILD_DIR)/kernel/
ln -sf $$(readlink -f submodules/pve-kernel/submodules) $(BUILD_DIR)/kernel/
cp -r submodules/pve-kernel/patches/kernel/* $(BUILD_DIR)/kernel/patches/kernel
cp -r patches/kernel/* $(BUILD_DIR)/kernel/patches/kernel
cp submodules/pve-kernel/* $(BUILD_DIR)/kernel/ || true
qemu.prepare:
git submodule update --init submodules/pve-qemu
mkdir -p $(BUILD_DIR)/qemu/debian/
ln -sf $$(readlink -f submodules/pve-qemu/qemu) $(BUILD_DIR)/qemu/
cp -r submodules/pve-qemu/debian/* $(BUILD_DIR)/qemu/debian
cp -r patches/qemu/* $(BUILD_DIR)/qemu/debian/patches/pve
cd $(BUILD_DIR)/qemu/debian/patches && find pve -type f | grep 'pve/9' >> series && cd -
cp submodules/pve-qemu/* $(BUILD_DIR)/qemu/ || true
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)