make: Don't use install -D. Added -p option to install
@@ -34,12 +34,6 @@ 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)
@@ -124,7 +118,8 @@ endif
install-headers: $(EXTERNAL_HEADERS)
@mkdir -p "$(HEADERS_INSTALL_DIR)"; \
for file in $(EXTERNAL_HEADERS); do\
- $(INSTALLCMD) -m 644 $${file} "$(HEADERS_INSTALL_DIR)/$${file#$(EXTERNAL_HEADERS_DIR)}";\
+ mkdir -p "$(HEADERS_INSTALL_DIR)/`dirname $${file#$(EXTERNAL_HEADERS_DIR)}`"; \
+ install -p -m 644 $${file} "$(HEADERS_INSTALL_DIR)/$${file#$(EXTERNAL_HEADERS_DIR)}";\
done
