* Makefile for a single source file
@ 2014-09-13 14:34 Kevin Wilson
2014-09-13 14:36 ` Kristofer Hallin
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Kevin Wilson @ 2014-09-13 14:34 UTC (permalink / raw)
To: kernelnewbies
Hi,
I have a single source file which I wrote, implementing a kernel
module: helloworld.c
In order to built it, I prepared the following Makefile:
obj-m += helloworld.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
Is it ok ? or should the obj-m parameter be *different* than the the
source file (without the *.o suffix)
(something like obj-m += hello.o ?)
Regards,
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Makefile for a single source file
2014-09-13 14:34 Makefile for a single source file Kevin Wilson
@ 2014-09-13 14:36 ` Kristofer Hallin
2014-09-13 14:38 ` Kevin Wilson
2014-09-13 15:13 ` Greg KH
2014-09-13 15:13 ` Bruno Guedes Souto
2 siblings, 1 reply; 5+ messages in thread
From: Kristofer Hallin @ 2014-09-13 14:36 UTC (permalink / raw)
To: kernelnewbies
Is this part of the Eudyptula Challenge?
On 13 Sep 2014 16:35, "Kevin Wilson" <wkevils@gmail.com> wrote:
> Hi,
> I have a single source file which I wrote, implementing a kernel
> module: helloworld.c
>
> In order to built it, I prepared the following Makefile:
>
> obj-m += helloworld.o
>
> all:
> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>
> clean:
> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
>
>
>
> Is it ok ? or should the obj-m parameter be *different* than the the
> source file (without the *.o suffix)
> (something like obj-m += hello.o ?)
>
> Regards,
> Kevin
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140913/b798db79/attachment.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Makefile for a single source file
2014-09-13 14:36 ` Kristofer Hallin
@ 2014-09-13 14:38 ` Kevin Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wilson @ 2014-09-13 14:38 UTC (permalink / raw)
To: kernelnewbies
Hi,
No.
This is a newbie question, and I believe this is the right mailing
list to get help.
Regards,
Kevin
On Sat, Sep 13, 2014 at 5:36 PM, Kristofer Hallin
<kristofer.hallin@gmail.com> wrote:
> Is this part of the Eudyptula Challenge?
>
> On 13 Sep 2014 16:35, "Kevin Wilson" <wkevils@gmail.com> wrote:
>>
>> Hi,
>> I have a single source file which I wrote, implementing a kernel
>> module: helloworld.c
>>
>> In order to built it, I prepared the following Makefile:
>>
>> obj-m += helloworld.o
>>
>> all:
>> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>>
>> clean:
>> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
>>
>>
>>
>> Is it ok ? or should the obj-m parameter be *different* than the the
>> source file (without the *.o suffix)
>> (something like obj-m += hello.o ?)
>>
>> Regards,
>> Kevin
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
^ permalink raw reply [flat|nested] 5+ messages in thread
* Makefile for a single source file
2014-09-13 14:34 Makefile for a single source file Kevin Wilson
2014-09-13 14:36 ` Kristofer Hallin
@ 2014-09-13 15:13 ` Greg KH
2014-09-13 15:13 ` Bruno Guedes Souto
2 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2014-09-13 15:13 UTC (permalink / raw)
To: kernelnewbies
On Sat, Sep 13, 2014 at 05:34:11PM +0300, Kevin Wilson wrote:
> Hi,
> I have a single source file which I wrote, implementing a kernel
> module: helloworld.c
>
> In order to built it, I prepared the following Makefile:
>
> obj-m += helloworld.o
>
> all:
> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>
> clean:
> make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
>
>
>
> Is it ok ? or should the obj-m parameter be *different* than the the
> source file (without the *.o suffix)
> (something like obj-m += hello.o ?)
Does the above work for you?
Have you read the kernel documentation about how to write stand-alone
Makefiles? It should answer this question for you, right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Makefile for a single source file
2014-09-13 14:34 Makefile for a single source file Kevin Wilson
2014-09-13 14:36 ` Kristofer Hallin
2014-09-13 15:13 ` Greg KH
@ 2014-09-13 15:13 ` Bruno Guedes Souto
2 siblings, 0 replies; 5+ messages in thread
From: Bruno Guedes Souto @ 2014-09-13 15:13 UTC (permalink / raw)
To: kernelnewbies
Kevin Wilson <wkevils <at> gmail.com> writes:
> Is it ok ? or should the obj-m parameter be *different* than the the
> source file (without the *.o suffix)
> (something like obj-m += hello.o ?)
>
> Regards,
> Kevin
>
Have you tested it? Test exactly what you are asking and see what happens.
That's the best way to learn.
Regards
BGS
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-09-13 15:13 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-13 14:34 Makefile for a single source file Kevin Wilson
2014-09-13 14:36 ` Kristofer Hallin
2014-09-13 14:38 ` Kevin Wilson
2014-09-13 15:13 ` Greg KH
2014-09-13 15:13 ` Bruno Guedes Souto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.