[Android Software Development] DiamondJohn:
Ha! I have been at that exact same error for ages (well I remember that one one the past). I have tried replacing the recovery into a lineage ROM with TWRP and that did not work (although the ROM was cm-13.0 and TWRP is cm-14.1 so I was surprised how far I did get). Got a little further after a few minor changes, but still no final build. Now my current error is (irrelevant)

build/core/base_rules.mk:320: warning: overriding commands for target `/home/ubuntu/android/twrp_lineage/out/target/product/xt897/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:320: warning: ignoring old commands for target `/home/ubuntu/android/twrp_lineage/out/target/product/xt897/root/res/images/charger/battery_fail.png'
build/core/aapt2.mk:68: warning: overriding commands for target `/home/ubuntu/android/twrp_lineage/out/target/common/obj/APPS/UpdateTestApp_intermediates/src/R.stamp'
build/core/package_internal.mk:369: warning: ignoring old commands for target `/home/ubuntu/android/twrp_lineage/out/target/common/obj/APPS/UpdateTestApp_intermediates/src/R.stamp'
build/core/Makefile:34: warning: overriding commands for target `/home/ubuntu/android/twrp_lineage/out/target/product/xt897/system/bin/aplogd'
build/core/base_rules.mk:320: warning: ignoring old commands for target `/home/ubuntu/android/twrp_lineage/out/target/product/xt897/system/bin/aplogd'
Starting build with ninja
ninja: Entering directory `.'
ninja: error: '/home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libexpat_intermediates/export_includes', needed by '/home/ubuntu/android/twrp_lineage/out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/import_includes', missing and no known rule to make it
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/home/ubuntu/android/twrp_lineage'

Its a little re-assuring knowing that someone else is hitting the same issue and its not just me! So if anyone can help, you would be helping two (at least).

I am not sure what you are doing to start the compile, but I have found that running "brunch lineage_xt897-eng" gives me a clearer error than "mka recoveryimage" (the above is with brunch, whereas mka gives no clue) With these errors I have taken it a few steps further (ie changes to "correct" the errors) But still no final success. mka gives the following

MODPOST 18 modules
make: Leaving directory `/home/ubuntu/android/twrp_lineage/kernel/motorola/msm8960-common'
make: Entering directory `/home/ubuntu/android/twrp_lineage/kernel/motorola/msm8960-common'
INSTALL arch/arm/mach-msm/dma_test.ko
INSTALL arch/arm/mach-msm/msm-buspm-dev.ko
INSTALL arch/arm/mach-msm/reset_modem.ko
INSTALL crypto/ansi_cprng.ko
INSTALL drivers/bluetooth/bluetooth-power.ko
INSTALL drivers/input/evbug.ko
INSTALL drivers/input/evfwd.ko
INSTALL drivers/media/radio/radio-iris-transport.ko
INSTALL drivers/media/video/gspca/gspca_main.ko
INSTALL drivers/misc/config/config.ko
INSTALL drivers/misc/eeprom/eeprom_93cx6.ko
INSTALL drivers/net/ks8851.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
INSTALL drivers/spi/spidev.ko
INSTALL drivers/staging/prima/wlan.ko
INSTALL drivers/video/backlight/lcd.ko
INSTALL net/ipv4/tcp_westwood.ko
INSTALL net/wireless/cfg80211.ko
DEPMOD 3.0.101-gb262fbb
Warning: you may need to install module-init-tools
See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
make: Leaving directory `/home/ubuntu/android/twrp_lineage/kernel/motorola/msm8960-common'
ninja: build stopped: subcommand failed.
make: *** [ninja_wrapper] Error 1
make: Leaving directory `/home/ubuntu/android/twrp_lineage'

#### make failed to build some targets (44 seconds) ####