2010-05-11 21:42:16 +02:00
|
|
|
##
|
|
|
|
# libcpp Makefile
|
|
|
|
##
|
|
|
|
|
|
|
|
SRCDIRS = .
|
|
|
|
DESTDIR = $(DSTROOT)
|
|
|
|
|
|
|
|
OBJROOT=.
|
|
|
|
SYMROOT=.
|
2010-06-28 19:19:47 +02:00
|
|
|
export TRIPLE=-apple-
|
2010-05-11 21:42:16 +02:00
|
|
|
|
2011-05-24 22:27:31 +02:00
|
|
|
ifeq (,$(RC_INDIGO))
|
|
|
|
INSTALL_PREFIX=""
|
|
|
|
else
|
|
|
|
INSTALL_PREFIX="$(SDKROOT)"
|
|
|
|
endif
|
2011-11-27 06:39:58 +01:00
|
|
|
INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX)
|
|
|
|
|
|
|
|
.PHONY: help installsrc clean installhdrs do-installhdrs install
|
2011-05-24 22:27:31 +02:00
|
|
|
|
2011-07-04 16:12:27 +02:00
|
|
|
help::
|
|
|
|
echo Use make install DSTROOT=<destination>
|
|
|
|
|
2010-05-11 21:42:16 +02:00
|
|
|
installsrc:: $(SRCROOT)
|
|
|
|
|
|
|
|
ditto $(SRCDIRS)/include $(SRCROOT)/include
|
2010-09-10 22:42:36 +02:00
|
|
|
ditto $(SRCDIRS)/lib $(SRCROOT)/lib
|
2010-05-11 21:42:16 +02:00
|
|
|
ditto $(SRCDIRS)/src $(SRCROOT)/src
|
|
|
|
ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile
|
|
|
|
|
|
|
|
clean::
|
|
|
|
|
|
|
|
installhdrs::
|
|
|
|
|
2011-11-27 06:39:58 +01:00
|
|
|
$(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/*
|
2010-05-11 21:42:16 +02:00
|
|
|
|
|
|
|
install:: installhdrs $(DESTDIR)
|
|
|
|
|
|
|
|
cd lib && ./buildit
|
|
|
|
ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
2011-11-27 06:39:58 +01:00
|
|
|
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
|