Since driver compiling relies on the kernel, if you need to compile our source code, you should modify the related Makefile according to your own kernel path, then execute:
# make
For more info, please refer to the appendix of the document Drivers Porting and Configuration.