摘要:        
fneq ($(KERNELRELEASE),) obj-m := timer.oelse all: make -C /lib/modules/3.0.8/build M=$(shell pwd) modules.PHONY:cleanclean: rm -rf *.mod.c *.o *.ko *.symvers *.order endif 红色的部分替换成对应的文件名 例如: 当要编译的...    阅读全文
posted @ 2012-05-31 14:54
sky-zhang
阅读(5445)
评论(0)
推荐(0)
        
            
        
        
摘要:        
相关代码(函数名print_encapsule.c): #include <stdio.h> #define DPRINT(fmt,args...) \ printf("%s-%s-%d:"fmt,__FILE__,__func__,__LINE__,args)#define TESTA(a,b) a##b#define TESTB(str) #str int main(){ int x=1...    阅读全文
posted @ 2012-05-31 10:45
sky-zhang
阅读(1424)
评论(1)
推荐(0)
        
            
        
        
摘要:        
示例代码(文件compile_macro_test.c): #include <stdio.h> int main(){ int a = 0;#ifdef DBUG a = 5;#endif printf("=========%d\n",a); return 0;} 对应Makefile文件 all:a.outdebug:b.out mv b.out a.out a.out:...    阅读全文
posted @ 2012-05-31 10:23
sky-zhang
阅读(3577)
评论(1)
推荐(0)
        
 
                    
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号