blob: 92670233eb4a14642986d18658501e7ca0a40976 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001##
Bob Wilsonf9e75ae2013-04-23 19:26:55 +00002# libc++ Makefile
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00003##
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
Bob Wilson9493e272013-04-23 18:51:51 +000036 (cd $(SRCDIRS)/include && tar cf - --exclude=support .) | \
37 (cd $(HEADER_DIR)/c++/v1 && tar xf -)
Bob Wilson3c6fefd2012-09-21 20:49:54 +000038 chmod 755 $(HEADER_DIR)/c++/v1
39 chmod 644 $(HEADER_DIR)/c++/v1/*
40 chmod 755 $(HEADER_DIR)/c++/v1/ext
41 chmod 644 $(HEADER_DIR)/c++/v1/ext/*
Bill Wendling35080ea2013-11-18 07:01:16 +000042 chmod 755 $(HEADER_DIR)/c++/v1/experimental
43 chmod 644 $(HEADER_DIR)/c++/v1/experimental/*
Howard Hinnant6e4971f2012-01-18 17:44:31 +000044
Howard Hinnantfcf7bd12012-01-17 16:09:32 +000045install::
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000046
47 cd lib && ./buildit
48 ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
Bob Wilson0dd0b4d2011-11-27 05:39:58 +000049 cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM \
50 $(SYMROOT)/usr/lib/libc++.1.dylib
51 mkdir -p $(INSTALL_DIR)/usr/lib
52 strip -S -o $(INSTALL_DIR)/usr/lib/libc++.1.dylib \
53 $(SYMROOT)/usr/lib/libc++.1.dylib
54 cd $(INSTALL_DIR)/usr/lib && ln -s libc++.1.dylib libc++.dylib