1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Makefile.include: Refactor ar-wrapper test.

llvm-ar does not understand `-rc`, but works for creating empty
archives when called with `rc` (without the leading dash). BSD `ar`
which ships with OSX, which the test is written for, understands the
argument with or without the leading dash (but does not support creating
empty archives.)
This commit is contained in:
Joakim Gebart 2015-01-20 21:05:44 +01:00
parent 7fc721e277
commit 5e2b9f52ba

View File

@ -112,7 +112,7 @@ CFLAGS += -DCPU_$(CPUDEF)=\"$(CPU)\" -DRIOT_CPU=CPU_$(CPUDEF)
CFLAGS += -DMCU_$(MCUDEF)=\"$(MCU)\" -DRIOT_MCU=MCU_$(MCUDEF)
# OSX fails to create empty archives. Provide a wrapper to catch that error.
ifneq (0, $(shell mkdir -p $(BINDIR); $(AR) -rc $(BINDIR)empty-archive.a 2> /dev/null; echo $$?))
ifneq (0, $(shell mkdir -p $(BINDIR); $(AR) rc $(BINDIR)empty-archive.a 2> /dev/null; echo $$?))
AR := $(RIOTBASE)/dist/ar-wrapper $(AR)
endif