Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8b0618c authored by Cheng Renquan's avatar Cheng Renquan Committed by Sam Ravnborg
Browse files

kbuild: remove extra ifdef/endif of top Makefile



The GNU make's origin function know undefined variable well,
so the outer ifdef/endif conditional checking is unneeded.

From `info make` documentation, origin will return

  `undefined'
     if VARIABLE was never defined.
  `command line'
     if VARIABLE was defined on the command line.
   ...

Therefore, $(origin V) will get a value anyway, killing ifdef/endif is
viable and safe.

Furthermore, I've checked the minimal requirements from
Documentation/Changes is GNU make 3.79.1, and that version of GNU make
has support of origin function well already, so now it's safe to kill
the outer conditional checking, without upgrading the minimal
requirements.

Signed-off-by: default avatarCheng Renquan <crq@kernel.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 3e56f08b
Loading
Loading
Loading
Loading
+9 −17
Original line number Diff line number Diff line
@@ -35,11 +35,9 @@ MAKEFLAGS += -rR --no-print-directory
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands

ifdef V
ifeq ("$(origin V)", "command line")
  KBUILD_VERBOSE = $(V)
endif
endif
ifndef KBUILD_VERBOSE
  KBUILD_VERBOSE = 0
endif
@@ -54,11 +52,9 @@ endif
# See the file "Documentation/sparse.txt" for more details, including
# where to get the "sparse" utility.

ifdef C
ifeq ("$(origin C)", "command line")
  KBUILD_CHECKSRC = $(C)
endif
endif
ifndef KBUILD_CHECKSRC
  KBUILD_CHECKSRC = 0
endif
@@ -69,12 +65,10 @@ endif
ifdef SUBDIRS
  KBUILD_EXTMOD ?= $(SUBDIRS)
endif
ifdef M

ifeq ("$(origin M)", "command line")
  KBUILD_EXTMOD := $(M)
endif
endif


# kbuild supports saving output files in a separate directory.
# To locate output files in a separate directory two syntaxes are supported.
@@ -98,11 +92,9 @@ ifeq ($(KBUILD_SRC),)

# OK, Make called in directory where kernel src resides
# Do we want to locate output files in a separate directory?
ifdef O
ifeq ("$(origin O)", "command line")
  KBUILD_OUTPUT := $(O)
endif
endif

# That's our default target when none is given on the command line
PHONY := _all