[SeaBIOS] [PATCH] build: allow setting tools path from the environment

Roger Pau Monne posted 1 patch 6 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/seabios tags/patchew/20180123153416.75513-1-roger.pau@citrix.com
Makefile | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
[SeaBIOS] [PATCH] build: allow setting tools path from the environment
Posted by Roger Pau Monne 6 years, 2 months ago
Allow setting the path to as, ld, objcopy, objdump, strip and python
from the environment.

This is required for building SeaBIOS on FreeBSD, which will switch
the default ld to lld very soon, and lld is not capable of building
SeaBIOS at the moment.

Building SeaBIOS on FreeBSD after the switch to lld will require
setting LD=/path/to/gnu/ld at build time.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Kevin O'Connor <kevin@koconnor.net>
Cc: Ed Maste <emaste@freebsd.org>
---
 Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index eb8ad58..0fcb1bf 100644
--- a/Makefile
+++ b/Makefile
@@ -17,12 +17,12 @@ CROSS_PREFIX=
 ifneq ($(CROSS_PREFIX),)
 CC=$(CROSS_PREFIX)gcc
 endif
-AS=$(CROSS_PREFIX)as
-LD=$(CROSS_PREFIX)ld
-OBJCOPY=$(CROSS_PREFIX)objcopy
-OBJDUMP=$(CROSS_PREFIX)objdump
-STRIP=$(CROSS_PREFIX)strip
-PYTHON=python
+AS?=$(CROSS_PREFIX)as
+LD?=$(CROSS_PREFIX)ld
+OBJCOPY?=$(CROSS_PREFIX)objcopy
+OBJDUMP?=$(CROSS_PREFIX)objdump
+STRIP?=$(CROSS_PREFIX)strip
+PYTHON?=python
 CPP=cpp
 IASL:=iasl
 LD32BIT_FLAG:=-melf_i386
-- 
2.15.1


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios
Re: [SeaBIOS] [PATCH] build: allow setting tools path from the environment
Posted by Kevin O'Connor 6 years, 1 month ago
On Tue, Jan 23, 2018 at 03:34:16PM +0000, Roger Pau Monne wrote:
> Allow setting the path to as, ld, objcopy, objdump, strip and python
> from the environment.
> 
> This is required for building SeaBIOS on FreeBSD, which will switch
> the default ld to lld very soon, and lld is not capable of building
> SeaBIOS at the moment.
> 
> Building SeaBIOS on FreeBSD after the switch to lld will require
> setting LD=/path/to/gnu/ld at build time.

Thanks Roger, however, I find it a bit confusing for the makefile
rules to implicitly pull in variables from the environment.  (It makes
it hard to track down build failures as the dependency on the
environment can be complex.)  So, I think if a make variable is to be
overridden it should be done on the command line (eg, make LD=xyz).

-Kevin

_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
https://mail.coreboot.org/mailman/listinfo/seabios