blob: 182dcc3b0133127f129cda76fc77faa3dbce32d9 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001##
2# libcpp Makefile
3##
4
5SRCDIRS = .
6DESTDIR = $(DSTROOT)
7
8OBJROOT=.
9SYMROOT=.
Howard Hinnantdb0bc342010-06-28 17:19:47 +000010export TRIPLE=-apple-
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000011
Nick Kledzik8feadca2011-05-24 20:27:31 +000012ifeq (,$(RC_INDIGO))
13 INSTALL_PREFIX=""
14else
15 INSTALL_PREFIX="$(SDKROOT)"
16endif
Bob Wilson0dd0b4d2011-11-27 05:39:58 +000017INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX)
18
Howard Hinnant364e9452012-08-13 16:32:15 +000019.PHONY: help installsrc clean installheaders install
Nick Kledzik8feadca2011-05-24 20:27:31 +000020
Howard Hinnant3c8894b2011-07-04 14:12:27 +000021help::
Nuno Lopes67c80822012-06-25 23:51:05 +000022 @echo "Use make install DSTROOT=<destination>"
Howard Hinnant3c8894b2011-07-04 14:12:27 +000023
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000024installsrc:: $(SRCROOT)
25
26 ditto $(SRCDIRS)/include $(SRCROOT)/include
Nick Kledzikc7e4d822010-09-10 20:42:36 +000027 ditto $(SRCDIRS)/lib $(SRCROOT)/lib
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000028 ditto $(SRCDIRS)/src $(SRCROOT)/src
29 ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile
30
31clean::
32
Bob Wilson3c6fefd2012-09-21 20:49:54 +000033# The installheaders target is used by clang's runtime/libcxx makefile.
Howard Hinnant364e9452012-08-13 16:32:15 +000034installheaders::
Bob Wilson3c6fefd2012-09-21 20:49:54 +000035 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/*
Howard Hinnant6e4971f2012-01-18 17:44:31 +000043
Howard Hinnantfcf7bd12012-01-17 16:09:32 +000044install::
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000045
46 cd lib && ./buildit
47 ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
Bob Wilson0dd0b4d2011-11-27 05:39:58 +000048 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