diff --git a/Makefile.base b/Makefile.base index e16f028f8ba00937b3c847ab935f221209e02c9c..7d0e89aa074fcc63932a3e32098c2c1988eb70f8 100644 --- a/Makefile.base +++ b/Makefile.base @@ -49,7 +49,7 @@ $(BINDIR)$(MODULE)/: $(BINDIR)$(MODULE).a $(OBJ): | $(BINDIR)$(MODULE)/ $(BINDIR)$(MODULE).a: $(OBJ) | ${DIRS:%=ALL--%} - $(AD)$(AR) -rcs $@ $? + $(AD)$(AR) $(ARFLAGS) $@ $? CXXFLAGS = $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS) diff --git a/Makefile.cflags b/Makefile.cflags index 39049324d7cfd1486a37657213fd6dc9547b2133..89381ef4fb55aad3258b7c0698edf3a54d9bc00a 100644 --- a/Makefile.cflags +++ b/Makefile.cflags @@ -50,3 +50,9 @@ endif # Forbid common symbols to prevent accidental aliasing. CFLAGS += -fno-common + +# Default ARFLAGS for platforms which do not specify it. +# Note: make by default provides ARFLAGS=rv which we want to override +ifeq ($(origin ARFLAGS),default) + ARFLAGS = rcs +endif diff --git a/Makefile.vars b/Makefile.vars index 571c625a64ebe3f0fe951d6d69fd7970fdf37ef1..7896e67a0abcab8b538f90268acd16c23dd728af 100644 --- a/Makefile.vars +++ b/Makefile.vars @@ -26,6 +26,7 @@ export CFLAGS # The compiler flags. Must only ever be used with ` export CXXUWFLAGS # (Patters of) flags in CFLAGS, that should not be passed to CXX. export CXXEXFLAGS # Additional flags that should be passed to CXX. export AR # The command to create the object file archives. +export ARFLAGS # Command-line options to pass to AR, default `rcs`. export AS # The assembler. export ASFLAGS # Flags for the assembler. export LINK # The command used to link the files. Must take the same parameters as GCC, i.e. "ld" won't work.