Refactor libcxx makefile. No functional changes intended.

Besides cleaning up the repetition in the installhdrs target, the point of this
change is to provide a separate do-installhdrs target that can be used directly
from clang's runtime/libcxx makefile to install a copy of the headers along
with clang.  <rdar://problem/10397739>


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@145162 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bob Wilson 2011-11-27 05:39:58 +00:00
parent 704f09b212
commit 0dd0b4d758

View File

@ -14,6 +14,9 @@ ifeq (,$(RC_INDIGO))
else else
INSTALL_PREFIX="$(SDKROOT)" INSTALL_PREFIX="$(SDKROOT)"
endif endif
INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX)
.PHONY: help installsrc clean installhdrs do-installhdrs install
help:: help::
echo Use make install DSTROOT=<destination> echo Use make install DSTROOT=<destination>
@ -29,47 +32,30 @@ clean::
installhdrs:: installhdrs::
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext $(MAKE) HEADER_DIR=$(INSTALL_DIR)/usr/include do-installhdrs
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext $(MAKE) HEADER_DIR=$(INSTALL_DIR)/usr/lib do-installhdrs
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext $(MAKE) HEADER_DIR=$(INSTALL_DIR)/usr/clang-ide/lib do-installhdrs
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext $(MAKE) HEADER_DIR=$(INSTALL_DIR)/Developer/usr/lib do-installhdrs
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext $(MAKE) HEADER_DIR=$(INSTALL_DIR)/Developer/Platforms/iPhoneOS.platform/usr/lib do-installhdrs
rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/
rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ # The do-installhdrs target is also used by clang's runtime/libcxx makefile.
rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ do-installhdrs:
rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ mkdir -p $(HEADER_DIR)/c++/v1/ext
rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* \
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++ $(HEADER_DIR)/c++/v1/
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++ chown -R root:wheel $(HEADER_DIR)/c++
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++ chmod 755 $(HEADER_DIR)/c++/v1
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++ chmod 644 $(HEADER_DIR)/c++/v1/*
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++ chmod 755 $(HEADER_DIR)/c++/v1/ext
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1 chmod 644 $(HEADER_DIR)/c++/v1/ext/*
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/*
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/c++/v1/ext/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/clang-ide/lib/c++/v1/ext/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/usr/lib/c++/v1/ext/*
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/Developer/Platforms/iPhoneOS.platform/usr/lib/c++/v1/ext/*
install:: installhdrs $(DESTDIR) install:: installhdrs $(DESTDIR)
cd lib && ./buildit cd lib && ./buildit
ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM $(SYMROOT)/usr/lib/libc++.1.dylib cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM \
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib $(SYMROOT)/usr/lib/libc++.1.dylib
strip -S -o $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib mkdir -p $(INSTALL_DIR)/usr/lib
cd $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib && ln -s libc++.1.dylib libc++.dylib strip -S -o $(INSTALL_DIR)/usr/lib/libc++.1.dylib \
$(SYMROOT)/usr/lib/libc++.1.dylib
cd $(INSTALL_DIR)/usr/lib && ln -s libc++.1.dylib libc++.dylib