Skip to content
Snippets Groups Projects
Commit 8d68afa6 authored by Joakim Nohlgård's avatar Joakim Nohlgård
Browse files

Makefile: Add ARFLAGS for overriding command line options to `ar`

 - Makefile.base: Respect ARFLAGS when building static archives.
 - Makefile.cflags: Add default ARFLAGS.
 - Makefile.vars: Add description for ARFLAGS.
parent 5e2b9f52
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment