how to compile additional module?

Mirco Tischler mt-ml at gmx.de
Tue Aug 23 08:46:24 EDT 2011


2011/8/23 loody <miloody at gmail.com>:
> hi:
> Thanks for your help.
>
>
> 2011/8/23 Mirco Tischler <mt-ml at gmx.de>:
>> 2011/8/23 loody <miloody at gmail.com>:
>>> hi all:
>>> I found if kernel want to build usb modules it will show below:there is
>>> make -f scripts/Makefile.build obj=drivers/usb
>>>
>>> if I have a folder in drivers/miloodytest
>>> how could I generate
>>> make -f scripts/Makefile.build obj=drivers/miloodytest
>>>
>>> BR,
>>>
>>> 2011/8/23 loody <miloody at gmail.com>:
>>>> Dear all:
>>>> I make a module under kernel tree and adding Kconfig for that.
>>>> But I have no idea where I should add that when I type "make modules",
>>>> the modules I add will be compiled.
>>>> Would anyone tell me where the modules list located?
>>>>
>>>>
>>>> --
>>>> Regards,
>>>>
>> Hi
>> It seems you forgot to edit the Makefiles. Take a look at
>> Documentation/kbuild/makefiles.txt for a detailed explanation. Section
>> 3 is probably the most interesting.
>
> I put Makefile in drivers/miloodytest
> I have no idea how to let kbuild jump to there and make modules.
> I guess the secret should be in scripts folder, since it seems some
> tool or shell will generate command as below:
> make -f scripts/Makefile.build obj=drivers/usb
> make -f scripts/Makefile.build obj=drivers/block
> make -f scripts/Makefile.build obj=drivers/cdrom
> make -f scripts/Makefile.build obj=drivers/char
> make -f scripts/Makefile.build obj=drivers/clocksource
> make -f scripts/Makefile.build obj=drivers/firmware
>
> but there is no Makefile in drivers, right?
> Yours,
>
>
>
> --
> Regards,
>
Actually, there is a Makefile in drivers. Just add something like
"obj-$(YOUR_CONFIG_OPTION) += miloodytest/" to drivers/Makefile and
make will descend into miloodytest if YOUR_CONFIG_OPTION evaluates to
m or y



More information about the Kernelnewbies mailing list