Browse Source

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.
dev/timer
Joakim Gebart 8 years ago
parent
commit
8d68afa6e6
  1. 2
      Makefile.base
  2. 6
      Makefile.cflags
  3. 1
      Makefile.vars

2
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)

6
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

1
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.

Loading…
Cancel
Save