summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: ab7b5b603a04d83bc8f10face76774c8635ad2d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
##
# libc++ Makefile
##

SRCDIRS = .
DESTDIR = $(DSTROOT)

OBJROOT=.
SYMROOT=.
export TRIPLE=-apple-

ifeq (,$(RC_INDIGO))
	INSTALL_PREFIX=""
else
	INSTALL_PREFIX="$(SDKROOT)"
endif
INSTALL_DIR=$(DSTROOT)/$(INSTALL_PREFIX)

.PHONY: help installsrc clean installheaders install

help::
	@echo "Use make install DSTROOT=<destination>"

installsrc:: $(SRCROOT)

	ditto $(SRCDIRS)/include $(SRCROOT)/include
	ditto $(SRCDIRS)/lib $(SRCROOT)/lib
	ditto $(SRCDIRS)/src $(SRCROOT)/src
	ditto $(SRCDIRS)/Makefile $(SRCROOT)/Makefile

clean::

# The installheaders target is used by clang's runtime/libcxx makefile.
installheaders::
	mkdir -p $(HEADER_DIR)/c++/v1/ext
	(cd $(SRCDIRS)/include && \
	  tar cf - --exclude=".*" --exclude=support \
	           --exclude=CMakeLists.txt *) | \
	  (cd $(HEADER_DIR)/c++/v1 && tar xf -)
	chmod 755 $(HEADER_DIR)/c++/v1
	chmod 644 $(HEADER_DIR)/c++/v1/*
	chmod 755 $(HEADER_DIR)/c++/v1/ext
	chmod 644 $(HEADER_DIR)/c++/v1/ext/*
	chmod 755 $(HEADER_DIR)/c++/v1/experimental
	chmod 644 $(HEADER_DIR)/c++/v1/experimental/*

install::

	cd lib && ./buildit
	ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
	cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM \
	  $(SYMROOT)/usr/lib/libc++.1.dylib
	mkdir -p $(INSTALL_DIR)/usr/lib
	strip -S -o $(INSTALL_DIR)/usr/lib/libc++.1.dylib \
	  $(SYMROOT)/usr/lib/libc++.1.dylib
	cd $(INSTALL_DIR)/usr/lib && ln -s libc++.1.dylib libc++.dylib