Fix for install-headers on Darwin host
@@ -34,6 +34,12 @@ else
CFLAGS = -O2 -DNDEBUG
endif
+ifeq ($(shell uname),Darwin)
+ INSTALLCMD = install
+else
+ INSTALLCMD = install -D
+endif
+
# Compliation options for various architectures
TARGET_FAMILY = $(firstword $(subst -, ,$(TARGET)-))
include Makefile.$(TARGET_FAMILY)
@@ -118,7 +124,7 @@ endif
install-headers: $(EXTERNAL_HEADERS)
@mkdir -p "$(HEADERS_INSTALL_DIR)"; \
for file in $(EXTERNAL_HEADERS); do\
- install -m 644 -D $${file} "$(HEADERS_INSTALL_DIR)/$${file#$(EXTERNAL_HEADERS_DIR)}";\
+ $(INSTALLCMD) -m 644 $${file} "$(HEADERS_INSTALL_DIR)/$${file#$(EXTERNAL_HEADERS_DIR)}";\
done
