###
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.build obj=
# Usage:
# $(Q)$(MAKE) $(build)=dir
build :=-f $(if$(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
include $(srctree)/scripts/Kbuild.include
# We need some generic definitions (do not try to remake the file).
$(srctree)/scripts/Kbuild.include: ;
include $(srctree)/scripts/Kbuild.include
stub:
@echo "=================================="
@make $(build)=helloworld
all:
@echo "hello world"
#__build
# The filename Kbuild has precedence over Makefile
kbuild-dir := $(if$(filter /%,$(src)),$(src),$(srctree)/$(src))
kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
include $(kbuild-file)
temp:
@echo "---------- $(kbuild-dir) -----------"
@echo "---------- $(kbuild-file) ------------"
[beyes@SLinux linux-2.6.34.9]$ make stub
==================================
---------- /home/beyes/kernel/linux-2.6.34.9/helloworld -----------
---------- /home/beyes/kernel/linux-2.6.34.9/helloworld/Makefile ------------
[beyes@SLinux linux-2.6.34.9]$ make stub
==================================
i am here
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |