Rename the buildroot output, so I can have two of them
This commit is contained in:
40
Makefile
40
Makefile
@ -13,11 +13,12 @@ toolchain_wrkdir := $(wrkdir)/riscv-gnu-toolchain
|
||||
toolchain_dest := $(CURDIR)/toolchain
|
||||
|
||||
buildroot_srcdir := $(srcdir)/buildroot
|
||||
buildroot_wrkdir := $(wrkdir)/buildroot
|
||||
buildroot_tar := $(buildroot_wrkdir)/images/rootfs.tar
|
||||
buildroot_initramfs_wrkdir := $(wrkdir)/buildroot_initramfs
|
||||
buildroot_initramfs_tar := $(buildroot_initramfs_wrkdir)/images/rootfs.tar
|
||||
buildroot_initramfs_config := $(confdir)/buildroot_initramfs_config
|
||||
|
||||
sysroot_stamp := $(wrkdir)/.sysroot
|
||||
sysroot := $(wrkdir)/sysroot
|
||||
buildroot_initramfs_sysroot_stamp := $(wrkdir)/.buildroot_initramfs_sysroot
|
||||
buildroot_initramfs_sysroot := $(wrkdir)/buildroot_initramfs_sysroot
|
||||
|
||||
linux_srcdir := $(srcdir)/linux
|
||||
linux_wrkdir := $(wrkdir)/linux
|
||||
@ -66,17 +67,22 @@ $(toolchain_dest)/bin/$(target)-gcc: $(toolchain_srcdir)
|
||||
$(MAKE) -C $(toolchain_wrkdir)
|
||||
sed 's/^#define LINUX_VERSION_CODE.*/#define LINUX_VERSION_CODE 263682/' -i $(toolchain_dest)/sysroot/usr/include/linux/version.h
|
||||
|
||||
$(buildroot_tar): $(buildroot_srcdir) $(RISCV)/bin/$(target)-gcc
|
||||
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_wrkdir) riscv64_defconfig
|
||||
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_wrkdir)
|
||||
$(buildroot_initramfs_wrkdir)/.config: $(buildroot_srcdir)
|
||||
rm -rf $(dir $@)
|
||||
mkdir -p $(dir $@)
|
||||
cp $(buildroot_initramfs_config) $@
|
||||
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_initramfs_wrkdir) olddefconfig
|
||||
|
||||
.PHONY: buildroot-menuconfig
|
||||
buildroot-menuconfig: $(buildroot_srcdir)
|
||||
$(MAKE) -C $< O=$(buildroot_wrkdir) menuconfig
|
||||
$(buildroot_initramfs_tar): $(buildroot_srcdir) $(buildroot_initramfs_wrkdir)/.config $(RISCV)/bin/$(target)-gcc $(buildroot_initramfs_config)
|
||||
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_initramfs_wrkdir)
|
||||
|
||||
$(sysroot_stamp): $(buildroot_tar)
|
||||
mkdir -p $(sysroot)
|
||||
tar -xpf $< -C $(sysroot) --exclude ./dev --exclude ./usr/share/locale
|
||||
.PHONY: buildroot_initramfs-menuconfig
|
||||
buildroot_initramfs-menuconfig: $(buildroot_srcdir)
|
||||
$(MAKE) -C $< O=$(buildroot_initramfs_wrkdir) menuconfig
|
||||
|
||||
$(buildroot_initramfs_sysroot_stamp): $(buildroot_initramfs_tar)
|
||||
mkdir -p $(buildroot_initramfs_sysroot)
|
||||
tar -xpf $< -C $(buildroot_initramfs_sysroot) --exclude ./dev --exclude ./usr/share/locale
|
||||
touch $@
|
||||
|
||||
$(linux_wrkdir)/.config: $(linux_defconfig) $(linux_srcdir)
|
||||
@ -95,9 +101,9 @@ ifeq ($(ISA),$(filter rv32%,$(ISA)))
|
||||
$(MAKE) -C $(linux_srcdir) O=$(linux_wrkdir) ARCH=riscv olddefconfig
|
||||
endif
|
||||
|
||||
$(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(sysroot_stamp)
|
||||
$(vmlinux): $(linux_srcdir) $(linux_wrkdir)/.config $(buildroot_initramfs_sysroot_stamp)
|
||||
$(MAKE) -C $< O=$(linux_wrkdir) \
|
||||
CONFIG_INITRAMFS_SOURCE="$(confdir)/initramfs.txt $(sysroot)" \
|
||||
CONFIG_INITRAMFS_SOURCE="$(confdir)/initramfs.txt $(buildroot_initramfs_sysroot)" \
|
||||
CONFIG_INITRAMFS_ROOT_UID=$(shell id -u) \
|
||||
CONFIG_INITRAMFS_ROOT_GID=$(shell id -g) \
|
||||
ARCH=riscv \
|
||||
@ -162,8 +168,8 @@ $(rootfs):
|
||||
truncate --size=1G $@
|
||||
mkfs.ext4 $@
|
||||
|
||||
.PHONY: sysroot vmlinux bbl
|
||||
sysroot: $(sysroot)
|
||||
.PHONY: buildroot_initramfs_sysroot vmlinux bbl
|
||||
buildroot_initramfs_sysroot: $(buildroot_initramfs_sysroot)
|
||||
vmlinux: $(vmlinux)
|
||||
bbl: $(bbl)
|
||||
|
||||
|
Reference in New Issue
Block a user