[kbuild-devel] Help in Makefile for Kernel module

2005-04-19 Thread suzane miller
Hello,
   I have a Kernel module source tree similar as below:
   |
   |--Makefile
   |
   |--maind
   ||
   ||
   ||-- main.c
   |
   |
   |--foobard
   ||
|
|-- foobar1.c
|
|-- foobar2.c
   The below make file works fine.
##
#
# Linux 2.6 Kernel module Makefile
#
MODULE_NAME = test
$(MODULE_NAME)-objs = maind/main.o foobard/foobar1.o foobard/foobar2.o
ifneq ($(KERNELRELEASE),)
obj-m   := $(MODULE_NAME).o
else
KDIR:= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
   $(MAKE) -C $(KDIR) M=$(PWD) modules
endif
##
   However I would like to know if it is possible to have a Makefile
inside the foobard directory that will link foobar1.o and foobar2.o
into one say foobar.o and have the below line as:
$(MODULE_NAME)-objs = maind/main.o foobard/foobar.o
instead of:
$(MODULE_NAME)-objs = maind/main.o foobard/foobar1.o foobard/foobar2.o
   Thanks for any help
Regards
Suzzane
_
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Help in Makefile for Kernel module

2005-04-19 Thread Sam Ravnborg
Hi Suzzane

However I would like to know if it is possible to have a Makefile
 inside the foobard directory that will link foobar1.o and foobar2.o
 into one say foobar.o and have the below line as:

The lowest granularity the kbuild system works with is a module.
So what you can do is to define a module in the foobard/ directory.
Then you would stick a dependency on this module in your top-level
module in maind/.

The Makefile's would look like this:

Makefile (stripped all the conditional stuff):

obj-m := maind/ foobard/

foobard/Makefile:
obj-m := foobard.o
foobard-y := foobar1.o foobar2.o

maind/Makefile:
obj-m := main.o


Sam



---
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
___
kbuild-devel mailing list
kbuild-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kbuild-devel