RE: Recursive makefiles for module spanning over multiple dir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It works for me. See below:

[rajat@linux-server module]$ cat Makefile
obj-m := module.o
module-objs := 1/t1.o 2/t2.o

[rajat@linux-server module]$ cat 1/t1.c
#include <linux/init.h>
#include <linux/module.h>

void hello_exit(void)
{
    printk(KERN_ALERT "Goodbye, cruel world\n");
}

[rajat@linux-server module]$ cat 2/t2.c

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

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

extern void hello_exit(void);

module_init(hello_init);
module_exit(hello_exit);

[rajat@linux-server module]$ make -C ../linux-2.6.25/ M=`pwd` modules
make: Entering directory `/netapp_filer/users/rajat/linux/linux-2.6.25'
  CC [M]  /netapp_filer/users/rajat/linux/module/1/t1.o
  CC [M]  /netapp_filer/users/rajat/linux/module/2/t2.o
  LD [M]  /netapp_filer/users/rajat/linux/module/module.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /netapp_filer/users/rajat/linux/module/module.mod.o
  LD [M]  /netapp_filer/users/rajat/linux/module/module.ko
make: Leaving directory `/netapp_filer/users/rajat/linux/linux-2.6.25'
[rajat@linux-server module]$

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux