kbuild: remove src and obj from the top Makefile

Replace $(src) and $(obj) with $(srctree) and $(objtree), respectively.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
Masahiro Yamada 2019-07-06 12:07:11 +09:00
parent b3b3eb9dad
commit 75dd47472b
4 changed files with 11 additions and 14 deletions

View File

@ -248,9 +248,6 @@ endif
export KBUILD_CHECKSRC KBUILD_EXTMOD KBUILD_SRC export KBUILD_CHECKSRC KBUILD_EXTMOD KBUILD_SRC
objtree := . objtree := .
src := $(srctree)
obj := $(objtree)
VPATH := $(srctree) VPATH := $(srctree)
export srctree objtree VPATH export srctree objtree VPATH
@ -1717,7 +1714,7 @@ CHECKSTACK_ARCH := $(ARCH)
endif endif
checkstack: checkstack:
$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \ $(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
$(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH) $(PERL) $(srctree)/scripts/checkstack.pl $(CHECKSTACK_ARCH)
kernelrelease: kernelrelease:
@echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" @echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
@ -1736,11 +1733,11 @@ endif
tools/: FORCE tools/: FORCE
$(Q)mkdir -p $(objtree)/tools $(Q)mkdir -p $(objtree)/tools
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(src)/tools/ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
tools/%: FORCE tools/%: FORCE
$(Q)mkdir -p $(objtree)/tools $(Q)mkdir -p $(objtree)/tools
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(src)/tools/ $* $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
# Single targets # Single targets
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -18,7 +18,7 @@ ifdef CONFIG_ARC_CURR_IN_REG
# any kernel headers, and missing the r25 global register # any kernel headers, and missing the r25 global register
# Can't do unconditionally because of recursive include issues # Can't do unconditionally because of recursive include issues
# due to <linux/thread_info.h> # due to <linux/thread_info.h>
LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h LINUXINCLUDE += -include $(srctree)/arch/arc/include/asm/current.h
endif endif
cflags-y += -fsection-anchors cflags-y += -fsection-anchors

View File

@ -102,8 +102,8 @@ PALO := $(shell if (which palo 2>&1); then : ; \
elif [ -x /sbin/palo ]; then echo /sbin/palo; \ elif [ -x /sbin/palo ]; then echo /sbin/palo; \
fi) fi)
PALOCONF := $(shell if [ -f $(src)/palo.conf ]; then echo $(src)/palo.conf; \ PALOCONF := $(shell if [ -f $(srctree)/palo.conf ]; then echo $(srctree)/palo.conf; \
else echo $(obj)/palo.conf; \ else echo $(objtree)/palo.conf; \
fi) fi)
palo lifimage: vmlinuz palo lifimage: vmlinuz
@ -113,8 +113,8 @@ palo lifimage: vmlinuz
false; \ false; \
fi fi
@if test ! -f "$(PALOCONF)"; then \ @if test ! -f "$(PALOCONF)"; then \
cp $(src)/arch/parisc/defpalo.conf $(obj)/palo.conf; \ cp $(srctree)/arch/parisc/defpalo.conf $(objtree)/palo.conf; \
echo 'A generic palo config file ($(obj)/palo.conf) has been created for you.'; \ echo 'A generic palo config file ($(objree)/palo.conf) has been created for you.'; \
echo 'You should check it and re-run "make palo".'; \ echo 'You should check it and re-run "make palo".'; \
echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \ echo 'WARNING: the "lifimage" file is now placed in this directory by default!'; \
false; \ false; \
@ -144,10 +144,10 @@ vmlinuz: vmlinux
endif endif
install: install:
$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \ $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
$(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)" $(KERNELRELEASE) vmlinux System.map "$(INSTALL_PATH)"
zinstall: zinstall:
$(CONFIG_SHELL) $(src)/arch/parisc/install.sh \ $(CONFIG_SHELL) $(srctree)/arch/parisc/install.sh \
$(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)" $(KERNELRELEASE) vmlinuz System.map "$(INSTALL_PATH)"
CLEAN_FILES += lifimage CLEAN_FILES += lifimage

View File

@ -73,7 +73,7 @@ KBUILD_AFLAGS += $(ARCH_INCLUDE)
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \ USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \
$(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \ $(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \
-D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \ -D_FILE_OFFSET_BITS=64 -idirafter $(srctree)/include \
-idirafter $(obj)/include -D__KERNEL__ -D__UM_HOST__ -idirafter $(objtree)/include -D__KERNEL__ -D__UM_HOST__
#This will adjust *FLAGS accordingly to the platform. #This will adjust *FLAGS accordingly to the platform.
include $(ARCH_DIR)/Makefile-os-$(OS) include $(ARCH_DIR)/Makefile-os-$(OS)