Message ID | 1399639944-20551-6-git-send-email-mmarek@suse.cz (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/Makefile b/Makefile index 4da1c4b..9872c53 100644 --- a/Makefile +++ b/Makefile @@ -153,7 +153,17 @@ else _all: modules endif -srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),.) +ifeq ($(KBUILD_SRC),) + # building in the source tree + srctree := . +else + ifeq ($(KBUILD_SRC)/,$(dir $(CURDIR))) + # building in a subdirectory of the source tree + srctree := .. + else + srctree := $(KBUILD_SRC) + endif +endif objtree := . src := $(srctree) obj := $(objtree)