diff --git a/Makefile.inc b/Makefile.inc index 1518fac1..d848e2bf 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -219,7 +219,7 @@ ${START}: ${TARGET}/${SUBTARGET}/${START:.o=.S} Makefile ${NORMAL_S} dtb: - ${CC} ${AFLAGS} ${CPPFLAGS} -E -D__ASSEMBLY__ -D__DTS__ -Ulinux -x assembler-with-cpp -o $(DTB_O) $(DTB_I) + ${CC} ${AFLAGS} ${CPPFLAGS} -nostdinc -E -D__ASSEMBLY__ -D__DTS__ -Ulinux -x assembler-with-cpp -o $(DTB_O) $(DTB_I) zpmon: startz.o rm start.o && cp -f startz.o start.o diff --git a/zloader/Makefile.inc b/zloader/Makefile.inc index f4bc0d4e..7bdd6fad 100755 --- a/zloader/Makefile.inc +++ b/zloader/Makefile.inc @@ -150,11 +150,18 @@ ifndef gencode gencode=./genram endif -dtb: - make -C ../Targets/${TARGET}/compile/${TARGETEL}/ DTB_O=`pwd`/${TARGET}.dtb.i DTB_I=`pwd`/../Targets/${TARGET}/conf/${TARGET}.dts dtb +define dtb_rules + make -C ../Targets/${TARGET}/compile/${TARGETEL}/ DTB_O=`pwd`/${TARGET}.dtb.i DTB_I=`pwd`/../Targets/${TARGET}/conf/${TARGET}$(@:dtb%=%).dts dtb ./dtc -I dts -O dtb -o ${TARGET}.dtb ${TARGET}.dtb.i ( echo "#include ";echo NVRAM_OFFS; echo DTB_OFFS; )| make -C ../Targets/${TARGET}/compile/${TARGETEL}/ DTB_O=`pwd`/dtbinfo.txt DTB_I=- dtb [ -f gzrom.bin ] && cp gzrom.bin gzrom-dtb.bin && python ../tools/pmonenv.py -O $$((`tail -n 1 dtbinfo.txt`)) -o $$((`tail -n 2 dtbinfo.txt|head -n 1`)) -f gzrom-dtb.bin -d ${TARGET}.dtb -w al=\(usb0,0\)/boot/vmlinuz al1=\(wd0,0\)/boot/vmlinuz append="'console=ttyS0,115200 console=tty initcall_debug=1 loglevel=20'" FR=1 +endef + +dtb: + $(dtb_rules) +dtb%: + $(dtb_rules) + cleanall: clean make -C ../Targets/${TARGET}/compile/${TARGETEL}/ clean clean: