blob: 0c8177dbb9c2e4882491aa20386a6a18111b0ada [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
Bob Wilson1dd5ccf2012-01-21 06:16:39 +000019.PHONY: help installsrc clean installheaders do-installhdrs 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
Howard Hinnant6e4971f2012-01-18 17:44:31 +000033installheaders:: do-installhdrs
34
Howard Hinnantb9b932f2012-01-17 17:01:18 +000035# The do-installhdrs target is also used by clang's runtime/libcxx makefile.
36do-installhdrs:
37 mkdir -p $(HEADER_DIR)/c++/v1/ext
38 rsync -r --exclude=".*" --exclude="support" $(SRCDIRS)/include/* \
39 $(HEADER_DIR)/c++/v1/
40 chown -R root:wheel $(HEADER_DIR)/c++
41 chmod 755 $(HEADER_DIR)/c++/v1
42 chmod 644 $(HEADER_DIR)/c++/v1/*
43 chmod 755 $(HEADER_DIR)/c++/v1/ext
44 chmod 644 $(HEADER_DIR)/c++/v1/ext/*
45
Howard Hinnantfcf7bd12012-01-17 16:09:32 +000046install::
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000047
48 cd lib && ./buildit
49 ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
Bob Wilson0dd0b4d2011-11-27 05:39:58 +000050 cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM \
51 $(SYMROOT)/usr/lib/libc++.1.dylib
52 mkdir -p $(INSTALL_DIR)/usr/lib
53 strip -S -o $(INSTALL_DIR)/usr/lib/libc++.1.dylib \
54 $(SYMROOT)/usr/lib/libc++.1.dylib
55 cd $(INSTALL_DIR)/usr/lib && ln -s libc++.1.dylib libc++.dylib