Conditionalize make behavior e.g. disable --gc-sections

Peter Dufault dufault at hda.com
Tue May 7 09:03:39 UTC 2019


What is best practice to change build behavior?  e.g. I need to use --whole-archive/--no-whole-archive in one place but --gc-sections breaks it and that's turned on for the BSP (xilinx_zynq_a9_qemu).

I’ve done this in the .cfg files for the BSP:

ifneq ($(RTEMS_GC_SECTIONS_DISABLE),1)
LDFLAGS_GC_SECTIONS_DISABLE = -Wl,--gc-sections
endif

(...)

LDFLAGS = $(LDFLAGS_GC_SECTIONS_DISABLE)

and then I set RTEMS_GC_SECTIONS_DISABLE=1 in the one Makefile where I need it.  I don’t see similar patterns, is this the way to do it?

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering

This email is delivered through the public internet using protocols subject to interception and tampering.



More information about the devel mailing list