Yes, anything the Makefile does you can do by hand. In the case of kernel device tree sources, they use C preprocessor commands even though the device tree language and compiler don't support them.
What the kernel does, and you must do also, is to pass the device tree source through the C preprocessor and device tree compiler in sequence, like this:
cpp -Iinclude -E -P -x assembler-with-cpp imx6dl-boardname.dts | dtc -I dts -O dtb -o imx6dl-boardname.dtb -
(This is the command I use myself, with the obvious note that boardname is changed to reflect my hardware -- I pieced it together from Makefile rules and preprocessor error messages)
Preprocessor arguments:
-Iinclude
The kernel device tree sources mostly #include <dt-bindings/interrupt-controller/irq.h>
which is a path relative to arch/arm/boot/dts/include
.
-E
means preprocess only, not sure if that's needed when using the cpp
command
-P
disables source line number comments, which confuse the device tree compiler
-x assembler-with-cpp
forces the preprocessor to run in a certain language mode, which I suppose helps it not get confused by device tree syntax in the same file as the preprocessor directives. I use it because it was in the kernel Makefiles.
imx6dl-boardname.dts
is a placeholder, you must change this to the name of your toplevel device tree source file
Device tree compiler arguments:
-I dts
specifies that the input format is textual device tree source
-O dtb
specifies to create a device tree binary blob
-o imx6dl-boardname.dtb
defines the filename where the output goes, you should replace it with the DTB filename you want.
-
indicates that the input file is stdin