How to build modules on TX2?

When I build a kernel modules on TX2,I receive error message like this:

./arch/arm64/include/asm/opcodes.h:5:43: fatal error: …/…/arm/include/asm/opcodes.h: No such file or directory

and I find a ‘Readme’ file which in /usr/src/linux-headers-4.4.15-tegra , tell me do “sudo make modules_prepare”, but I receive error message like this:

CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[1]: *** No rule to make target ‘arch/arm/tools/gen-mach-types’, needed by ‘include/generated/mach-types.h’. Stop.
arch/arm64/Makefile:93: recipe for target ‘archprepare’ failed
make: *** [archprepare] Error 2

anyone can tell me how to solve it?

Jetsonhacks is an excellent resource

Also, what was your starting config (e.g., from “make tegra18_defconfig” or from “/proc/config.gz”)?