a little help beginning (kernel module)
Mon May 2 14:37:00 GMT 2016
I have never really programmed in C or using makefiles before.
Maybe I should say Makefiles ;-).
It seems to me most Linux projects I have ever seen place object files
in the same directories as source files. To me that is rather ugly.
Also I am trying to compile a simple kernel module and unless I am
specifying explicitly this line form the tutorial:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
Then it is impossible to compile anything because you run into a million
(header file inclusion) errors that seem completely unsolvable.
Apparently that build directory contains all the information (I thought
it would be an output directory).
But now just one input file:
Produces in the same output directory 6 other files:
That would be okay if it was a dedicated output directory.
So how can I put my source files in ./src, my output in ./build, and so
Or something of the kind?
Any tutorials that might be helpful?
The makefile references the source via "obj-m += module.o"
Sure I would love specifying output files like that, but I don't know
how to say where they have to go or where the source files are.
More information about the Gcc-help