Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | ## |
Bob Wilson | f9e75ae | 2013-04-23 19:26:55 +0000 | [diff] [blame] | 2 | # libc++ Makefile |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 3 | ## |
| 4 | |
| 5 | SRCDIRS = . |
| 6 | DESTDIR = $(DSTROOT) |
| 7 | |
| 8 | OBJROOT=. |
| 9 | SYMROOT=. |
Howard Hinnant | db0bc34 | 2010-06-28 17:19:47 +0000 | [diff] [blame] | 10 | export TRIPLE=-apple- |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 11 | |
Nick Kledzik | 8feadca | 2011-05-24 20:27:31 +0000 | [diff] [blame] | 12 | ifeq (,$(RC_INDIGO)) |
| 13 | INSTALL_PREFIX="" |
| 14 | else |
| 15 | INSTALL_PREFIX="$(SDKROOT)" |
| 16 | endif |
Bob Wilson | 0dd0b4d | 2011-11-27 05:39:58 +0000 | [diff] [blame] | 17 | INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX) |
| 18 | |
Howard Hinnant | 364e945 | 2012-08-13 16:32:15 +0000 | [diff] [blame] | 19 | .PHONY: help installsrc clean installheaders install |
Nick Kledzik | 8feadca | 2011-05-24 20:27:31 +0000 | [diff] [blame] | 20 | |
Howard Hinnant | 3c8894b | 2011-07-04 14:12:27 +0000 | [diff] [blame] | 21 | help:: |
Nuno Lopes | 67c8082 | 2012-06-25 23:51:05 +0000 | [diff] [blame] | 22 | @echo "Use make install DSTROOT=<destination>" |
Howard Hinnant | 3c8894b | 2011-07-04 14:12:27 +0000 | [diff] [blame] | 23 | |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 24 | installsrc:: $(SRCROOT) |
| 25 | |
| 26 | ditto $(SRCDIRS)/include $(SRCROOT)/include |
Nick Kledzik | c7e4d82 | 2010-09-10 20:42:36 +0000 | [diff] [blame] | 27 | ditto $(SRCDIRS)/lib $(SRCROOT)/lib |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 28 | ditto $(SRCDIRS)/src $(SRCROOT)/src |
| 29 | ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile |
| 30 | |
| 31 | clean:: |
| 32 | |
Bob Wilson | 3c6fefd | 2012-09-21 20:49:54 +0000 | [diff] [blame] | 33 | # The installheaders target is used by clang's runtime/libcxx makefile. |
Howard Hinnant | 364e945 | 2012-08-13 16:32:15 +0000 | [diff] [blame] | 34 | installheaders:: |
Bob Wilson | 3c6fefd | 2012-09-21 20:49:54 +0000 | [diff] [blame] | 35 | mkdir -p $(HEADER_DIR)/c++/v1/ext |
Bob Wilson | 9493e27 | 2013-04-23 18:51:51 +0000 | [diff] [blame] | 36 | (cd $(SRCDIRS)/include && tar cf - --exclude=support .) | \ |
| 37 | (cd $(HEADER_DIR)/c++/v1 && tar xf -) |
Bob Wilson | 3c6fefd | 2012-09-21 20:49:54 +0000 | [diff] [blame] | 38 | 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 Wendling | 35080ea | 2013-11-18 07:01:16 +0000 | [diff] [blame] | 42 | chmod 755 $(HEADER_DIR)/c++/v1/experimental |
| 43 | chmod 644 $(HEADER_DIR)/c++/v1/experimental/* |
Howard Hinnant | 6e4971f | 2012-01-18 17:44:31 +0000 | [diff] [blame] | 44 | |
Howard Hinnant | fcf7bd1 | 2012-01-17 16:09:32 +0000 | [diff] [blame] | 45 | install:: |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 46 | |
| 47 | cd lib && ./buildit |
| 48 | ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib |
Bob Wilson | 0dd0b4d | 2011-11-27 05:39:58 +0000 | [diff] [blame] | 49 | 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 |