1## 2# libcpp Makefile 3## 4 5SRCDIRS = . 6DESTDIR = $(DSTROOT) 7 8OBJROOT=. 9SYMROOT=. 10export TRIPLE=-apple- 11 12ifeq (,$(RC_INDIGO)) 13 INSTALL_PREFIX="" 14else 15 INSTALL_PREFIX="$(SDKROOT)" 16endif 17INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX) 18 19.PHONY: help installsrc clean installheaders install 20 21help:: 22 @echo "Use make install DSTROOT=<destination>" 23 24installsrc:: $(SRCROOT) 25 26 ditto $(SRCDIRS)/include $(SRCROOT)/include 27 ditto $(SRCDIRS)/lib $(SRCROOT)/lib 28 ditto $(SRCDIRS)/src $(SRCROOT)/src 29 ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile 30 31clean:: 32 33# The installheaders target is used by clang's runtime/libcxx makefile. 34installheaders:: 35 mkdir -p $(HEADER_DIR)/c++/v1/ext 36 rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* \ 37 $(HEADER_DIR)/c++/v1/ 38 chown -R root:wheel $(HEADER_DIR)/c++ 39 chmod 755 $(HEADER_DIR)/c++/v1 40 chmod 644 $(HEADER_DIR)/c++/v1/* 41 chmod 755 $(HEADER_DIR)/c++/v1/ext 42 chmod 644 $(HEADER_DIR)/c++/v1/ext/* 43 44install:: 45 46 cd lib && ./buildit 47 ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib 48 cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM \ 49 $(SYMROOT)/usr/lib/libc++.1.dylib 50 mkdir -p $(INSTALL_DIR)/usr/lib 51 strip -S -o $(INSTALL_DIR)/usr/lib/libc++.1.dylib \ 52 $(SYMROOT)/usr/lib/libc++.1.dylib 53 cd $(INSTALL_DIR)/usr/lib && ln -s libc++.1.dylib libc++.dylib 54