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