diff options
author | Andrew Hsieh <andrewhsieh@google.com> | 2013-01-17 09:00:38 -0800 |
---|---|---|
committer | Andrew Hsieh <andrewhsieh@google.com> | 2013-01-17 09:06:02 -0800 |
commit | 6d9baa3039ea7413169b6d059fa64bbdc0e054b7 (patch) | |
tree | c42e2940e2841b1f5c75d5bf9b1de835e7f9152d | |
parent | ff90ad8552285bacc0569276dc7aa2a623d2cb95 (diff) | |
download | build-6d9baa3039ea7413169b6d059fa64bbdc0e054b7.tar.gz |
Add new flags CFLAGS_FOR_BUILD and LDFLAGS_FOR_BUILD
In canadian cross build CFLAGS/LDFLAGS may contain flags good
for "host" but not valid for "build". Define new flags. eg.
# flags common to both "host" and "build"
CFLAGS_FOR_BUILD="-O2 -s -Wno-error"
LDFLAGS_FOR_BUILD=
# additional flags for "host"
CFLAGS="$CFLAGS_FOR_BUILD $HOST_CFLAGS"
LDFLAGS="$LDFLAGS_FOR_BUILD $HOST_LDFLAGS"
Change-Id: I723d4fa2b62a3945922a027555f30997a66cce48
-rw-r--r-- | Makefile.in | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in index 605574f..9f78f6f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -190,10 +190,14 @@ endif # Define environment variables for canadian cross build. ifneq ($(cur_host),$(cur_build)) +CFLAGS_FOR_BUILD ?= $(CFLAGS) +LDFLAGS_FOR_BUILD ?= $(LDFLAGS) canadian_build_env := \ export CC_FOR_BUILD=$(cur_build)-gcc ; \ export CC=$(cur_build)-gcc ; \ - export CXX=$(cur_build)-g++ ; + export CXX=$(cur_build)-g++ ; \ + export CFLAGS="$(CFLAGS_FOR_BUILD)" ; \ + export LDFLAGS="$(LDFLAGS_FOR_BUILD)" ; CANADIAN_ROOT := $(PWD)/host-${cur_build} canadian_env := \ |