mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Compiling dependent module
@ 2006-10-07 12:12 Devesh Sharma
  2006-10-07 18:19 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Devesh Sharma @ 2006-10-07 12:12 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

Hello all,

I have a situation where, I have one parent module in ../hello/
directory which exports one symbol (g_my_export). I have a dependent
module in ../hello1/ directory. Both have it's own makefiles.
Compiling of parent module (hello.ko) is fine, but during compilation
of dependent module (hello1.ko) I see a warning that g_my_export is
undefined.

On the other hand when I do depmod -a and modprobe, dependent module
inserts successfully in kernel.

I want to remove compile time warning. What should I do?

The source and makefile of both parent and dependent module is
attached with this mail.

Thanks
Devesh.

[-- Attachment #2: hello.c --]
[-- Type: text/x-csrc, Size: 346 bytes --]

#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

int g_my_export = 0xA ;

static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}

EXPORT_SYMBOL(g_my_export) ;

module_init(hello_init);
module_exit(hello_exit);

[-- Attachment #3: Makefile --]
[-- Type: application/octet-stream, Size: 486 bytes --]

# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
obj-m := hello.o
# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build

PWD := $(shell pwd)

default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

endif

[-- Attachment #4: hello1.c --]
[-- Type: text/x-csrc, Size: 382 bytes --]

#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");

extern int g_my_export ;

static int hello_init(void)
{
    printk(KERN_ALERT "Hello, world1\n");
    
    printk("Value in g_my_export=%d\n",g_my_export) ;
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world1\n");
}

module_init(hello_init);
module_exit(hello_exit);

[-- Attachment #5: Makefile --]
[-- Type: application/octet-stream, Size: 487 bytes --]

# If KERNELRELEASE is defined, we've been invoked from the
# kernel build system and can use its language.
ifneq ($(KERNELRELEASE),)
obj-m := hello1.o
# Otherwise we were called directly from the command
# line; invoke the kernel build system.
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build

PWD := $(shell pwd)

default:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

endif

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-10-10  5:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-07 12:12 Compiling dependent module Devesh Sharma
2006-10-07 18:19 ` Sam Ravnborg
2006-10-10  5:26   ` Devesh Sharma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome