Re: makefile

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

 



On Thu, Aug 16, 2007 at 08:01:16AM +0100, hari krishna angadi wrote:
> hi all,
>          i have problem in makefile.for each flags(test case).if i try to insmod i 
>         test1.ko,test.ko,test3.ko i am gettiing the TC= -D_TEST3 for all  
>        modules.
>        if i insmod  test1.ko  i should get TC =-D_TEST1
>       for  test2.ko TC = -D_TEST2 .....
>     based on the flag my program will execute
>             module ex:my makefile
>        
>         EXTRA_CFLAGS = -  -D_TEST1  
>         test1-objs = module.o functions.o
>         obj-m += test1.o
>      make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>         
>     EXTRA_CFLAGS =   -D_TEST2
>       make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>      test2-objs = module.o functions.0
>          obj-m += test2.o
> 
>      EXTRA_CFLAGS =   -D_TEST3
>     make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
>    test3-objs = module.o functions.o
>          obj-m += test3.o

The correct solution is:

CFLAGS_test1	:= -D_TEST1
CFLAGS_test2	:= -D_TEST2
CFLAGS_test3	:= -D_TEST3  

> Thanks,
>  Tom hari

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


--
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