This is the mail archive of the
mailing list for the GCC project.
a little help beginning (kernel module)
- From: Xen <list at xenhideout dot nl>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 02 May 2016 16:37:37 +0200
- Subject: a little help beginning (kernel module)
- Authentication-results: sourceware.org; auth=none
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.