blob: 5a7118ea8e54886d7efa5e364178c451082382a7 [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
12installsrc:: $(SRCROOT)
13
14 ditto $(SRCDIRS)/include $(SRCROOT)/include
Nick Kledzikc7e4d822010-09-10 20:42:36 +000015 ditto $(SRCDIRS)/lib $(SRCROOT)/lib
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000016 ditto $(SRCDIRS)/src $(SRCROOT)/src
17 ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile
18
19clean::
20
21installhdrs::
22
Nick Kledzik56b373c2010-05-14 20:22:09 +000023 mkdir -p $(DSTROOT)/usr/include/c++/v1/ext
Howard Hinnantdb0bc342010-06-28 17:19:47 +000024 rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/usr/include/c++/v1/
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000025 chown -R root:wheel $(DSTROOT)/usr/include
26 chmod 755 $(DSTROOT)/usr/include/c++/v1
27 chmod 644 $(DSTROOT)/usr/include/c++/v1/*
Howard Hinnantdb0bc342010-06-28 17:19:47 +000028 chmod 755 $(DSTROOT)/usr/include/c++/v1/ext
29 chmod 644 $(DSTROOT)/usr/include/c++/v1/ext/*
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000030
31install:: installhdrs $(DESTDIR)
32
33 cd lib && ./buildit
34 ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
35 cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM $(SYMROOT)/usr/lib/libc++.1.dylib
36 mkdir -p $(DSTROOT)/usr/lib
Nick Kledzik56b373c2010-05-14 20:22:09 +000037 strip -S -o $(DSTROOT)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
Howard Hinnantbc8d3f92010-05-11 19:42:16 +000038 cd $(DSTROOT)/usr/lib && ln -s libc++.1.dylib libc++.dylib