Browse Source

Moved kernel build out of world and into kernel subdir

Target for kernel build is once again buildkernel
odin
Nathan Fisher 8 months ago
parent
commit
3bc654a914
  1. 23
      Makefile
  2. 4
      include/mk/toolchain.mk
  3. 4
      include/mk/world.mk
  4. 4
      kernel/Makefile
  5. 0
      kernel/config-aarch64-5.11.5.config
  6. 0
      kernel/config-armv7l-5.11.5.config
  7. 0
      kernel/config-i486-5.11.5.config
  8. 0
      kernel/config-i686-5.11.5.config
  9. 0
      kernel/config-i786-5.11.5.config
  10. 0
      kernel/config-riscv64-5.11.5.config
  11. 0
      kernel/config-x86_64-5.11.5.config
  12. 7
      world/Makefile
  13. 15
      world/linux-headers/Makefile
  14. 51
      world/linux-rpi/Makefile
  15. 7858
      world/linux-rpi/config-rpi4-5.4.45.config

23
Makefile

@ -59,11 +59,25 @@ toolsclean:
.PHONY: toolsclean
buildworld: $(build)/.built $(plists)
buildworld: $(build)/.built
$(info $(grn)=== World build complete ===$(reset))
.PHONY: buildworld
$(build)/.built: $(tooldir)/.built $(build)/.skeleton.built
$(MAKE) -C world
find $(build)/lib $(build)/usr/lib $(build)/usr/lib64 -name '*.la' -delete
touch $@
buildkernel: $(build)/.kernel.built
$(info $(grn)=== Kernel build complete ===$(reset))
.PHONY: buildkernel
$(build)/.kernel.built:
$(MAKE) -C kernel
touch $@
strip: $(build)/.stripped
.PHONY: strip
@ -74,11 +88,6 @@ $(build)/.stripped:
/dev/null 2>&1 || true ; done
touch $@
$(build)/.built: $(tooldir)/.built $(build)/.skeleton.built
$(MAKE) -C world
find $(build)/lib $(build)/usr/lib $(build)/usr/lib64 -name '*.la' -delete
touch $@
$(build)/.skeleton.built: | $(dirs)
install -d -m 0750 $(build)/root
install -dv -m 1777 $(build)/tmp $(build)/var/tmp
@ -87,7 +96,7 @@ $(build)/.skeleton.built: | $(dirs)
#su -c "mknod -m 600 $(build)/dev/console c 5 1 && mknod -m 666 $(build)/dev/null c 1 3"
touch $@
$(plists): $(build)/.built
$(plists): $(build)/.built $(build)/.kernel.built
$(info $(grn)=== Creating plist ===$(reset))
pkgname=base $(MAKE) -C $(build) -f $(include_dir)/create-plist.mk install

4
include/mk/toolchain.mk

@ -9,7 +9,7 @@ logdir ?= $(localstatedir)/log
default_goal ?= install
global_srcdir = $(basedir)/build/src-toolchain
global_objdir = $(basedir)/build/obj-toolchain
global_srcdir = $(basedir)/build/src-toolchain-$(arch)
global_objdir = $(basedir)/build/obj-toolchain-$(arch)
include src-config.mk

4
include/mk/world.mk

@ -20,7 +20,7 @@ else
default_goal ?= finish
endif
global_srcdir = $(basedir)/build/src-world
global_objdir = $(basedir)/build/obj-world
global_srcdir = $(basedir)/build/src-world-$(arch)
global_objdir = $(basedir)/build/obj-world-$(arch)
include src-config.mk

4
world/linux-mainline/Makefile → kernel/Makefile

@ -4,8 +4,8 @@
distname = linux
default_goal = installkernel
include world.mk
srcdir = $(basedir)/build/src-world/linux-$(linux_version)
objdir = $(basedir)/build/obj-world/linux-$(linux_version)
srcdir = $(basedir)/build/src-world-$(arch)/linux-$(linux_version)
objdir = $(basedir)/build/obj-world-$(arch)/linux-$(linux_version)
config ?= $(wkgdir)/config-$(arch)-$(linux_version).config

0
world/linux-mainline/config-aarch64-5.11.5.config → kernel/config-aarch64-5.11.5.config

0
world/linux-mainline/config-armv7l-5.11.5.config → kernel/config-armv7l-5.11.5.config

0
world/linux-mainline/config-i486-5.11.5.config → kernel/config-i486-5.11.5.config

0
world/linux-mainline/config-i686-5.11.5.config → kernel/config-i686-5.11.5.config

0
world/linux-mainline/config-i786-5.11.5.config → kernel/config-i786-5.11.5.config

0
world/linux-mainline/config-riscv64-5.11.5.config → kernel/config-riscv64-5.11.5.config

0
world/linux-mainline/config-x86_64-5.11.5.config → kernel/config-x86_64-5.11.5.config

7
world/Makefile

@ -5,12 +5,6 @@
default_goal = all
include src-config.mk
ifeq (${rpi},true)
kernel = linux-rpi
else
kernel = linux-mainline
endif
subdirs += fs_skeleton
subdirs += man-pages
subdirs += iana-etc
@ -88,7 +82,6 @@ subdirs += bin
subdirs += sbin
subdirs += usr.bin
subdirs += usr.sbin
subdirs += $(kernel)
ifeq ($(arch),x86_64)
subdirs += grub

15
world/linux-headers/Makefile

@ -1,15 +0,0 @@
# Makefile - hhl - /usr/src/world/linux-headers
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
#
distname = linux
config_tgt = ${objdir}/Makefile
include world.mk
config_cmd = $(MAKE) -C ${srcdir} mrproper
build_cmd = KBUILD_OUTPUT=${objdir} $(MAKE) -C ${srcdir} headers
define post_build
find ${objdir}/usr/include -name '.*' -delete
rm -rf ${objdir}/usr/include/Makefile || true
endef
install_cmd = cp -r ${objdir}/usr/include/* /usr/include
include targets.mk

51
world/linux-rpi/Makefile

@ -1,51 +0,0 @@
# Makefile - hhl - /usr/src/world/linux-rpi
# Copyright 2020 Nathan Fisher <nfisher.sr@gmail.com>
distname = linux_rpi
default_goal = installkernel
include world.mk
srcdir = /src/linux_rpi-${linux_rpi_version}
objdir = /obj/linux_rpi-${linux_rpi_version}
config ?= ${wkgdir}/config-rpi4-5.4.45.config
installkernel: ${objdir}/.installed
buildkernel: ${objdir}/.built
${objdir}/.mrproper: ${srcdir}/.dirstamp ${objdir}/.dirstamp
$(MAKE) -C ${srcdir} mrproper
touch $@
${objdir}/.config: ${objdir}/.mrproper
$(info === Applying default kernel config ===)
cat ${config} > ${objdir}/.config
KBUILD_OUTPUT=${objdir} $(MAKE) -C ${srcdir} olddefconfig
${objdir}/.built: ${objdir}/.config
$(info === Building Linux kernel ===)
KBUILD_OUTPUT=${objdir} $(MAKE) ${makeflags} -C ${srcdir}
touch $@
${objdir}/.installed: ${objdir}/.built
$(info === Installing kernel modules ===)
KBUILD_OUTPUT=${objdir} $(MAKE) -C ${srcdir} modules_install
$(info === Installing kernel modules ===)
KBUILD_OUTPUT=${objdir} $(MAKE) -C ${srcdir} modules_install
$(info === Installing kernel ===)
install -m644 ${objdir}/arch/arm/boot/zImage /boot/vmlinuz-${linux_version}-${os_abbrev}-${os_version}
install -m644 ${objdir}/System.map /boot/System.map-${linux_version}
install -m644 ${objdir}/.config /boot/config-${linux_version}
$(info === Installing kernel documentation ===)
install -d ${docdir}/linux-${linux_rpi_version}
cp -r ${srcdir}/Documentation/* ${docdir}/linux-${linux_rpi_version}
touch $@
${objdir}/.dirstamp:
install -d ${objdir}
touch $@
${srcdir}/.dirstamp:
$(info === Extracting ${distlocal} ===)
tar -xJf ${distlocal} -C /src
touch $@
.PHONY: buildkernel installkernel

7858
world/linux-rpi/config-rpi4-5.4.45.config
File diff suppressed because it is too large
View File

Loading…
Cancel
Save