[edk2] [PATCH v2 5/5] BaseTools/Source/C: take EXTRA_LDFLAGS from the caller

Laszlo Ersek posted 5 patches 6 years ago
[edk2] [PATCH v2 5/5] BaseTools/Source/C: take EXTRA_LDFLAGS from the caller
Posted by Laszlo Ersek 6 years ago
Allow the caller of the top-level makefile either to set EXTRA_LDFLAGS in
the environment or to pass EXTRA_LDFLAGS as a macro definition on the
command line. EXTRA_LDFLAGS extends (and potentially overrides) default
link-editing flags set in the makefiles.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1540244
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    v2:
    - do not patch "antlr/makefile" and "dlg/makefile" under
      "BaseTools/Source/C/VfrCompile/Pccts" [Liming]

 BaseTools/Source/C/Makefiles/header.makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile
index 1b4cad5497ec..7f283d6464a8 100644
--- a/BaseTools/Source/C/Makefiles/header.makefile
+++ b/BaseTools/Source/C/Makefiles/header.makefile
@@ -99,6 +99,9 @@ endif
 BUILD_CFLAGS   += $(BUILD_OPTFLAGS)
 BUILD_CXXFLAGS += $(BUILD_OPTFLAGS)
   
+# keep EXTRA_LDFLAGS last
+BUILD_LFLAGS += $(EXTRA_LDFLAGS)
+
 .PHONY: all
 .PHONY: install
 .PHONY: clean
-- 
2.14.1.3.gb7cf6e02401b

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel