Posting here despite being a bit Lakka-related because I'm trying to compile Lakka using LibreELEC's build system. Also, it seems that experts on the build system hang out here more than at the Lakka forums. Apologies in advance (and be ready to do a facepalm).
So I'm trying to create a Lakka build for my S812 device based on patches from LibreELEC. Since Lakka's build system is basically an older version of LibreELEC's (forked from OpenELEC), the existing project/device contents that I got from LibreELEC doesn't exactly work with Lakka's. So I replaced the scripts and tools folder of Lakka's with LibreELEC's, and replaced the packages/linux/package.mk with LibreELEC's too.
Along the way, there were some build errors because of missing packages which I managed to fix by grabbing the relevant package.mk from LibreELEC and some CMake build problems which I fixed by replacing the config/functions with LibreELEC's too. So right now, I have this frankenstein of a build system that ~sorta~ works.
However, I got stumped when compiling the linux kernel, it encountered errors when compiling the DTS:
make[1]: Entering directory '~/Lakka/build.Lakka-S812.arm-devel/linux-263a24f'
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
scripts/Makefile.build:128: kbuild: Makefile.build is included improperly
make[2]: *** No rule to make target 'dtbs'. Stop.
~/Lakka/build.Lakka-S812.arm-devel/linux-263a24f/arch/arm/Makefile:319: recipe for target 'dtbs' failed
make[1]: *** [dtbs] Error 2
make[1]: Leaving directory '~/Lakka/build.Lakka-S812.arm-devel/linux-263a24f'
Makefile:12: recipe for target 'image' failed
make: *** [image] Error 2
Display More
Upon inspecting the relevant lines in arch/arm/Makefile:
dtbs: scripts
$(Q)$(MAKE) $(build)=$(subst $(wildcard $(srctree)//),,$(subst $(join /,$(subst dtb,dts,$@)),,$(firstword $(wildcard $(srctree)/$(boot)/dts/amlogic/$(subst dtb,dts,$@) $(srctree)/$(CUSTOMER_DIR_NAME)/meson/dt/$(subst dtb,dts,$@))))) \
MACHINE=$(MACHINE) \
dtbs
It seems that the $(build)=.... gets resolved to obj=, that is, the entire parameter, for some reason, resolves to nothing. I'm out of ideas on how to proceed but I imagine that I have to pull something again from the LibreELEC build system.
EDIT: btw, the Linux version I'm using is this: GitHub - kszaq/linux at 263a24f2e8e17cdd527e5c4aa462240d5e156edb