[CMAKE]
[reactos.git] / lib / 3rdparty / stlport / build / Makefiles / gmake / unix / rules-install-so.mak
1 # -*- makefile -*- Time-stamp: <07/12/12 01:52:19 ptr>
2 #
3 # Copyright (c) 1997-1999, 2002, 2003, 2005-2007
4 # Petr Ovtchenkov
5 #
6 # Portion Copyright (c) 1999-2001
7 # Parallel Graphics Ltd.
8 #
9 # Licensed under the Academic Free License version 3.0
10 #
11
12 ifndef INSTALL_TAGS
13
14 ifndef _NO_SHARED_BUILD
15 INSTALL_TAGS := install-release-shared
16 else
17 INSTALL_TAGS :=
18 endif
19
20 ifdef _STATIC_BUILD
21 INSTALL_TAGS += install-release-static
22 endif
23
24 ifndef _NO_DBG_BUILD
25 ifndef _NO_SHARED_BUILD
26 INSTALL_TAGS += install-dbg-shared
27 endif
28 ifdef _STATIC_BUILD
29 INSTALL_TAGS += install-dbg-static
30 endif
31 endif
32
33 ifndef _NO_STLDBG_BUILD
34 ifndef WITHOUT_STLPORT
35 ifndef _NO_SHARED_BUILD
36 INSTALL_TAGS += install-stldbg-shared
37 endif
38 ifdef _STATIC_BUILD
39 INSTALL_TAGS += install-stldbg-static
40 endif
41 endif
42 endif
43
44 endif
45
46
47 ifndef INSTALL_STRIP_TAGS
48
49 ifndef _NO_SHARED_BUILD
50 INSTALL_STRIP_TAGS := install-strip-shared
51 else
52 INSTALL_STRIP_TAGS :=
53 endif
54
55 ifdef _STATIC_BUILD
56 INSTALL_STRIP_TAGS += install-release-static
57 endif
58
59 ifndef _NO_DBG_BUILD
60 ifndef _NO_SHARED_BUILD
61 INSTALL_STRIP_TAGS += install-dbg-shared
62 endif
63 ifdef _STATIC_BUILD
64 INSTALL_STRIP_TAGS += install-dbg-static
65 endif
66 endif
67
68 ifndef _NO_STLDBG_BUILD
69 ifndef WITHOUT_STLPORT
70 ifndef _NO_SHARED_BUILD
71 INSTALL_STRIP_TAGS += install-stldbg-shared
72 endif
73 ifdef _STATIC_BUILD
74 INSTALL_STRIP_TAGS += install-stldbg-static
75 endif
76 endif
77 endif
78
79 endif
80
81
82 PHONY += install install-strip install-headers $(INSTALL_TAGS) $(INSTALL_STRIP_TAGS)
83
84 install: $(INSTALL_TAGS) install-headers
85
86 install-strip: $(INSTALL_STRIP_TAGS) install-headers
87
88 # Workaround for GNU make 3.80; see comments in rules-so.mak
89 define do_install_so_links
90 $${INSTALL_LIB_DIR$(1)}/$${SO_NAME$(1)xxx}: $${SO_NAME_OUT$(1)xxx}
91 $$(INSTALL_SO) $${SO_NAME_OUT$(1)xxx} $$(INSTALL_LIB_DIR$(1))
92 @$(call do_so_links_1,$$(INSTALL_LIB_DIR$(1)),$${SO_NAME$(1)xx},$${SO_NAME$(1)xxx})
93 @$(call do_so_links_1,$$(INSTALL_LIB_DIR$(1)),$${SO_NAME$(1)x},$${SO_NAME$(1)xx})
94 @$(call do_so_links_1,$$(INSTALL_LIB_DIR$(1)),$${SO_NAME$(1)},$${SO_NAME$(1)x})
95 endef
96
97 # Workaround for GNU make 3.80; see comments in rules-so.mak
98 define do_install_so_links_wk
99 # expand to nothing, if equal
100 ifneq (${INSTALL_LIB_DIR}/${SO_NAMExxx},${INSTALL_LIB_DIR_STLDBG}/${SO_NAME_STLDBGxxx})
101 # expand to nothing, if WITHOUT_STLPORT
102 ifndef WITHOUT_STLPORT
103 $(call do_install_so_links,$(1))
104 endif
105 endif
106 endef
107
108 # Workaround for GNU make 3.80; see comments in rules-so.mak
109 define do_install_so_links_wk2
110 # expand to nothing, if equal
111 ifneq (${INSTALL_LIB_DIR}/${SO_NAMExxx},${INSTALL_LIB_DIR_DBG}/${SO_NAME_DBGxxx})
112 $(call do_install_so_links,$(1))
113 endif
114 endef
115
116
117 $(eval $(call do_install_so_links,))
118 # ifneq (${INSTALL_LIB_DIR}/${SO_NAMExxx},${INSTALL_LIB_DIR_DBG}/${SO_NAME_DBGxxx})
119 # $(eval $(call do_install_so_links,_DBG))
120 $(eval $(call do_install_so_links_wk2,_DBG))
121 # endif
122 # ifneq (${INSTALL_LIB_DIR}/${SO_NAMExxx},${INSTALL_LIB_DIR_STLDBG}/${SO_NAME_STLDBGxxx})
123 # ifndef WITHOUT_STLPORT
124 $(eval $(call do_install_so_links_wk,_STLDBG))
125 # endif
126 # endif
127
128 install-release-shared: release-shared $(INSTALL_LIB_DIR) $(INSTALL_LIB_DIR)/${SO_NAMExxx} install-headers
129 ${POST_INSTALL}
130
131 install-strip-shared: release-shared $(INSTALL_LIB_DIR) $(INSTALL_LIB_DIR)/${SO_NAMExxx} install-headers
132 ${STRIP} ${_SO_STRIP_OPTION} $(INSTALL_LIB_DIR)/${SO_NAMExxx}
133 ${POST_INSTALL}
134
135 install-dbg-shared: dbg-shared $(INSTALL_LIB_DIR_DBG) $(INSTALL_LIB_DIR_DBG)/${SO_NAME_DBGxxx}
136 ${POST_INSTALL_DBG}
137
138 ifndef WITHOUT_STLPORT
139 install-stldbg-shared: stldbg-shared $(INSTALL_LIB_DIR_STLDBG) $(INSTALL_LIB_DIR_STLDBG)/${SO_NAME_STLDBGxxx}
140 ${POST_INSTALL_STLDBG}
141 endif
142
143 define do_install_headers
144 if [ ! -d $(INSTALL_HDR_DIR) ]; then \
145 $(INSTALL_D) $(INSTALL_HDR_DIR) || { echo "Can't create $(INSTALL_HDR_DIR)"; exit 1; }; \
146 fi; \
147 for dd in $(HEADERS_BASE); do \
148 d=`dirname $$dd`; \
149 h=`basename $$dd`; \
150 f=`cd $$d; find $$h \( -wholename "*/.svn" -prune \) -o \( -type d -print \)`; \
151 for ddd in $$f; do \
152 if [ ! -d $(INSTALL_HDR_DIR)/$$ddd ]; then \
153 $(INSTALL_D) $(INSTALL_HDR_DIR)/$$ddd || { echo "Can't create $(INSTALL_HDR_DIR)/$$ddd"; exit 1; }; \
154 fi; \
155 done; \
156 f=`find $$dd \( -wholename "*/.svn*" -o -name "*~" -o -name "*.bak" \) -prune -o \( -type f -print \)`; \
157 for ff in $$f; do \
158 h=`echo $$ff | sed -e "s|$$d|$(INSTALL_HDR_DIR)|"`; \
159 $(INSTALL_F) $$ff $$h; \
160 done; \
161 done; \
162 for f in $(HEADERS); do \
163 h=`basename $$f`; \
164 $(INSTALL_F) $$f $(INSTALL_HDR_DIR)/$$h || { echo "Can't install $(INSTALL_HDR_DIR)/$$h"; exit 1; }; \
165 done
166 endef
167
168 # find $$dd \( -type f \( \! \( -wholename "*/.svn*" -o -name "*~" -o -name "*.bak" \) \) \) -print
169 # _HEADERS_FROM = $(shell for dd in $(HEADERS_BASE); do find $$dd \( -type f \( \! \( -wholename "*/.svn/*" -o -name "*~" -o -name "*.bak" \) \) \) -print ; done )
170 # _HEADERS_TO = $(foreach d,$(HEADERS_BASE),$(patsubst $(d)/%,$(BASE_INSTALL_DIR)include/%,$(_HEADERS_FROM)))
171
172 install-headers:
173 @$(do_install_headers)