Re: [kbuild-devel] Link lib to a kernel module
Hallo, Matthias. On 2006-10-24, Matthias Fechner wrote: I tried today to link a lib (.a) to my kernel module but I could not found howto do it. `Documentation/kbuild' directory in your linux sources. `makefiles.txt' about `lib-y', `modules.txt' about modules. Good luck. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kbuild-devel
[kbuild-devel] [patch, rfc] kbuild: implement checksrc without building Cources (was Re: CHECK without C compile?)
On 2006-10-23, Randy Dunlap wrote: Hi Sam, It seem he on vocation, let me get it, since i've started my develife from makefiles. Is there an option/variant of CHECKSRC that does something like make checkall i.e., runs CHECK=sparse on all source files, without also building them with the C compiler? As far as i can see, no, there isn't. I have thing to propose, but something with generated header files will not work yet (e.g kernel/config_data.h). Patch is rfc, of course. --- From: Oleg Verych [EMAIL PROTECTED] Subject: [patch, rfc] kbuild: implement checksrc without building Cources Implementation of configured source chacking without actual building. Cc: Randy Dunlap [EMAIL PROTECTED] Cc: Sam Ravnborg [EMAIL PROTECTED] Signed-off-by: Oleg Verych [EMAIL PROTECTED] --- Configured sources means, some config target must be run already. After that ,-shell | make prepare | make C=something_not_0,1,2 _target_ `-- should run _target_ with checking and without building. -o--=O`C /. .\ #oo'L O o ___=E M^-- scripts/Kbuild.include |6 +++--- scripts/Makefile.build | 21 + 2 files changed, 16 insertions(+), 11 deletions(-) Index: linux-2.6.19-rc3/scripts/Kbuild.include === --- linux-2.6.19-rc3.orig/scripts/Kbuild.include2006-10-24 12:47:09.670676021 + +++ linux-2.6.19-rc3/scripts/Kbuild.include 2006-10-24 12:54:25.823530955 + @@ -153,7 +153,7 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ @set -e; \ $(echo-cmd) $(cmd_$(1)); \ - echo 'cmd_$@ := $(make-cmd)' $(dot-target).cmd) + echo 'cmd_$@ := $(make-cmd)' $(dot-target).cmd, @:) # execute the command and also postprocess generated .d dependencies # file @@ -162,14 +162,14 @@ $(echo-cmd) $(cmd_$(1)); \ scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' $(dot-target).tmp;\ rm -f $(depfile);\ - mv -f $(dot-target).tmp $(dot-target).cmd) + mv -f $(dot-target).tmp $(dot-target).cmd, @:) # Usage: $(call if_changed_rule,foo) # will check if $(cmd_foo) changed, or any of the prequisites changed, # and if so will execute $(rule_foo) if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \ @set -e; \ - $(rule_$(1))) + $(rule_$(1)), @:) ### # why - tell why a a target got build Index: linux-2.6.19-rc3/scripts/Makefile.build === --- linux-2.6.19-rc3.orig/scripts/Makefile.build2006-10-24 12:46:45.161279310 + +++ linux-2.6.19-rc3/scripts/Makefile.build 2006-10-24 13:14:11.947124287 + @@ -87,12 +87,17 @@ # Linus' kernel sanity checking tool ifneq ($(KBUILD_CHECKSRC),0) - ifeq ($(KBUILD_CHECKSRC),2) -quiet_cmd_force_checksrc = CHECK $ - cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $ ; - else + ifeq ($(KBUILD_CHECKSRC),1) quiet_cmd_checksrc = CHECK $ cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $ ; + else +quiet_cmd_force_checksrc = CHECK $ + cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $ ; +ifneq ($(KBUILD_CHECKSRC),2) + if_changed = @: + if_changed_dep = @: + if_changed_rule = @: +endif endif endif @@ -207,8 +212,8 @@ $(single-used-m): %.o: %.c FORCE $(call cmd,force_checksrc) - $(call if_changed_rule,cc_o_c) - @{ echo $(@:.o=.ko); echo $@; } $(MODVERDIR)/$(@F:.o=.mod) + $(call if_changed_rule,cc_o_c) || \ + { echo $(@:.o=.ko); echo $@; } $(MODVERDIR)/$(@F:.o=.mod) quiet_cmd_cc_lst_c = MKLST $@ cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $ \ @@ -310,8 +315,8 @@ $(call if_changed,link_multi-y) $(multi-used-m) : %.o: $(multi-objs-m) FORCE - $(call if_changed,link_multi-m) - @{ echo $(@:.o=.ko); echo $(link_multi_deps); } $(MODVERDIR)/$(@F:.o=.mod) + $(call if_changed,link_multi-m) || \ + { echo $(@:.o=.ko); echo $(link_multi_deps); } $(MODVERDIR)/$(@F:.o=.mod) targets += $(multi-used-y) $(multi-used-m) - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ kbuild-devel mailing list kbuild-devel@lists.sourceforge.net
Re: [kbuild-devel] [patch, rfc] kbuild: implement checksrc without building Cources (was Re: CHECK without C compile?)
On 2006-10-24, Oleg Verych wrote: On 2006-10-23, Randy Dunlap wrote: Hi Sam, * It seems* + $(call if_changed_rule,cc_o_c) || \ + { echo $(@:.o=.ko); echo $@; } $(MODVERDIR)/$(@F:.o=.mod) This doesn't work, use ifs instead. Updated. I have no idea what to do with generated sources and headers. One may be: check target `if_changed' to be %.c or %.h and let it be built. From: Oleg Verych [EMAIL PROTECTED] Subject: [patch, rfc] kbuild: implement checksrc without building Cources Implementation of configured source chacking without actual building. Cc: Randy Dunlap [EMAIL PROTECTED] Cc: Sam Ravnborg [EMAIL PROTECTED] Signed-off-by: Oleg Verych [EMAIL PROTECTED] --- Configured sources means, some config target must be run already. After that ,-shell | make prepare | make C=something_not_0,1,2 _target_ `-- should run _target_ with checking and without building. -o--=O`C /. .\ #oo'L O o ___=E M^-- scripts/Kbuild.include |6 +++--- scripts/Makefile.build | 25 - 2 files changed, 19 insertions(+), 12 deletions(-) Index: linux-2.6.19-rc3/scripts/Kbuild.include === --- linux-2.6.19-rc3.orig/scripts/Kbuild.include2006-10-24 18:45:36.708292246 + +++ linux-2.6.19-rc3/scripts/Kbuild.include 2006-10-24 19:11:29.552783811 + @@ -153,7 +153,7 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)), \ @set -e; \ $(echo-cmd) $(cmd_$(1)); \ - echo 'cmd_$@ := $(make-cmd)' $(dot-target).cmd) + echo 'cmd_$@ := $(make-cmd)' $(dot-target).cmd ;) # execute the command and also postprocess generated .d dependencies # file @@ -162,14 +162,14 @@ $(echo-cmd) $(cmd_$(1)); \ scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' $(dot-target).tmp;\ rm -f $(depfile);\ - mv -f $(dot-target).tmp $(dot-target).cmd) + mv -f $(dot-target).tmp $(dot-target).cmd ;) # Usage: $(call if_changed_rule,foo) # will check if $(cmd_foo) changed, or any of the prequisites changed, # and if so will execute $(rule_foo) if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \ @set -e; \ - $(rule_$(1))) + $(rule_$(1)) ;) ### # why - tell why a a target got build Index: linux-2.6.19-rc3/scripts/Makefile.build === --- linux-2.6.19-rc3.orig/scripts/Makefile.build2006-10-24 18:45:36.720292930 + +++ linux-2.6.19-rc3/scripts/Makefile.build 2006-10-24 19:25:50.977873629 + @@ -87,12 +87,17 @@ # Linus' kernel sanity checking tool ifneq ($(KBUILD_CHECKSRC),0) - ifeq ($(KBUILD_CHECKSRC),2) -quiet_cmd_force_checksrc = CHECK $ - cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $ ; - else + ifeq ($(KBUILD_CHECKSRC),1) quiet_cmd_checksrc = CHECK $ cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $ ; + else +quiet_cmd_force_checksrc = CHECK $ + cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $ ; +ifneq ($(KBUILD_CHECKSRC),2) + if_changed =# + if_changed_dep =# + if_changed_rule =# +endif endif endif @@ -204,11 +209,11 @@ $(call if_changed_rule,cc_o_c) # Single-part modules are special since we need to mark them in $(MODVERDIR) - $(single-used-m): %.o: %.c FORCE $(call cmd,force_checksrc) - $(call if_changed_rule,cc_o_c) - @{ echo $(@:.o=.ko); echo $@; } $(MODVERDIR)/$(@F:.o=.mod) + $(if $(if_changed_rule), \ + $(call if_changed_rule,cc_o_c) \ + { echo $(@:.o=.ko); echo $@; } $(MODVERDIR)/$(@F:.o=.mod)) quiet_cmd_cc_lst_c = MKLST $@ cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $ \ @@ -310,8 +315,10 @@ $(call if_changed,link_multi-y) $(multi-used-m) : %.o: $(multi-objs-m) FORCE - $(call if_changed,link_multi-m) - @{ echo $(@:.o=.ko); echo $(link_multi_deps); } $(MODVERDIR)/$(@F:.o=.mod) + $(if $(if_changed), \ + $(call if_changed,link_multi-m) \ + { echo $(@:.o=.ko); \ + echo $(link_multi_deps); } $(MODVERDIR)/$(@F:.o=.mod)) targets += $(multi-used-y) $(multi-used-m) - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___