Skip to content

Commit

Permalink
kbuild: Use HOST*FLAGS options from the command line
Browse files Browse the repository at this point in the history
Now that we have the rename in place, reuse the HOST*FLAGS options as
something that can be set from the command line and included with the
rest of the flags.

Signed-off-by: Laura Abbott <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
labbott authored and masahir0y committed Jul 17, 2018
1 parent 8377bd2 commit f92d19e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
16 changes: 16 additions & 0 deletions Documentation/kbuild/kbuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ LDFLAGS_MODULE
--------------------------------------------------
Additional options used for $(LD) when linking modules.

HOSTCFLAGS
--------------------------------------------------
Additional flags to be passed to $(HOSTCC) when building host programs.

HOSTCXXFLAGS
--------------------------------------------------
Additional flags to be passed to $(HOSTCXX) when building host programs.

HOSTLDFLAGS
--------------------------------------------------
Additional flags to be passed when linking host programs.

HOSTLDLIBS
--------------------------------------------------
Additional libraries to link against when building host programs.

KBUILD_KCONFIG
--------------------------------------------------
Set the top-level Kconfig file to the value of this environment
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,11 @@ HOST_LFS_LIBS := $(shell getconf LFS_LIBS 2>/dev/null)
HOSTCC = gcc
HOSTCXX = g++
KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS)
KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS)
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS)
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS)
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
$(HOSTCFLAGS)
KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)

# Make variables (CC, etc...)
AS = $(CROSS_COMPILE)as
Expand Down

0 comments on commit f92d19e

Please sign in to comment.