xref: /dragonfly/gnu/lib/gcc47/libstdc++/Makefile (revision ae071d8d)
1.include "../Makefile.inc"
2.include "../libsupc++/Makefile.src"
3.include "Makefile.headers"
4SRCDIR=	${GCCDIR}/libstdc++-v3
5.PATH:	${SRCDIR}
6.PATH:	${SRCDIR}/libsupc++
7.PATH:	${SRCDIR}/src
8.PATH:	${SRCDIR}/src/c++11
9.PATH:	${SRCDIR}/src/c++98
10.PATH:	${SRCDIR}/libmath
11.PATH:	${SRCDIR}/config/io
12.PATH:	${SRCDIR}/config/locale/dragonfly
13.PATH:	${SRCDIR}/config/locale/generic
14.PATH:	${GCCDIR}/gcc
15.PATH:	${GCCDIR}/libgcc
16
17# Vendor lists shared lib version as 6, not 9.
18LIB=		stdc++
19SHLIB_MAJOR=	9
20
21CFLAGS+=	-DIN_GLIBCPP_V3 -DHAVE_CONFIG_H
22CFLAGS+=	-I${.CURDIR}
23CFLAGS+=	-I${.OBJDIR}
24CFLAGS+=	-I${GCCDIR}/gcc
25CFLAGS+=	-I${GCCDIR}/libgcc
26CFLAGS+=	-I${GCCDIR}/libiberty
27CFLAGS+=	-I${GCCDIR}/libcpp/include
28CXXFLAGS+=	-fno-implicit-templates
29CXXFLAGS+=	-fdiagnostics-show-location=once
30CXXFLAGS+=	-ffunction-sections -fdata-sections
31CXXFLAGS+=	-Wno-deprecated
32LDFLAGS+=	-Wl,--version-script=${.CURDIR}/libstdc++-symbols.ver
33
34THRLIB= 	${.OBJDIR}/../../../../lib/libpthread/libpthread.so
35LDADD+= 	${THRLIB} -lm
36DPADD+= 	${THRLIB} ${LIBM}
37
38# Slightly modified from libstdc++/src/c++98/Makefile.in
39# sources_1998 is the equivalent of libc_98convenience.a
40# sources_2011 is the equivalent of libc_11convenience.a
41host_sources_1998 = \
42	atomicity.cc \
43	codecvt_members.cc \
44	collate_members.cc \
45	ctype_configure_char.cc \
46	ctype_members.cc \
47	messages_members.cc \
48	monetary_members.cc \
49	numeric_members.cc \
50	time_members.cc
51
52parallel_sources_1998 =
53
54inst_sources_1998 = \
55	allocator-inst.cc \
56	concept-inst.cc \
57	ext-inst.cc \
58	ios-inst.cc \
59	iostream-inst.cc \
60	istream-inst.cc \
61	locale-inst.cc \
62	misc-inst.cc \
63	ostream-inst.cc \
64	sstream-inst.cc \
65	streambuf-inst.cc \
66	wlocale-inst.cc
67
68host_sources_extra_1998 = \
69	basic_file.cc \
70	c++locale.cc \
71	${inst_sources_1998} \
72	${parallel_sources_1998}
73
74sources_1998 = \
75	bitmap_allocator.cc \
76	pool_allocator.cc \
77	mt_allocator.cc \
78	codecvt.cc \
79	complex_io.cc \
80	ctype.cc \
81	globals_io.cc \
82	hash_tr1.cc \
83	hashtable_tr1.cc \
84	ios.cc \
85	ios_failure.cc \
86	ios_init.cc \
87	ios_locale.cc \
88	list.cc \
89	locale.cc \
90	locale_init.cc \
91	locale_facets.cc \
92	localename.cc \
93	math_stubs_float.cc \
94	math_stubs_long_double.cc \
95	stdexcept.cc \
96	strstream.cc \
97	tree-cxx.cc \
98	istream.cc \
99	streambuf.cc \
100	valarray.cc \
101	${host_sources_1998} \
102	${host_sources_extra_1998}
103
104inst_sources_2011 = \
105	fstream-inst.cc \
106	string-inst.cc \
107	wstring-inst.cc
108
109sources_2011 = \
110	chrono.cc \
111	condition_variable.cc \
112	debug-cxx.cc \
113	functexcept.cc \
114	functional.cc \
115	future.cc \
116	hash_c++0x.cc \
117	hashtable_c++0x.cc \
118	limits.cc \
119	mutex.cc \
120	placeholders.cc \
121	regex.cc \
122	shared_ptr.cc \
123	system_error.cc \
124	thread.cc \
125	${inst_sources_2011}
126
127ldbl_compat_sources =
128parallel_compat_sources =
129
130cxx98_sources = \
131	compatibility.cc \
132	compatibility-debug_list.cc \
133	compatibility-debug_list-2.cc \
134	compatibility-list.cc \
135	compatibility-list-2.cc \
136	${ldbl_compat_sources} \
137	${parallel_compat_sources}
138
139cxx11_sources = \
140	compatibility-c++0x.cc \
141	compatibility-atomic-c++0x.cc \
142	compatibility-thread-c++0x.cc
143
144SRCS+=	${SUPCXX} \
145	cp-demangle.c \
146	${sources_1998} \
147	${sources_2011} \
148	${cxx98_sources} \
149	${cxx11_sources}
150
151FLAGS_GROUPS=		gnu0x gnu11
152gnu0x_FLAGS=		-std=gnu++0x
153gnu11_FLAGS=		-std=gnu++11
154gnu0x_FLAGS_FILES=	eh_ptr.cc \
155			eh_throw.cc \
156			guard.cc \
157			nested_exception.cc
158gnu11_FLAGS_FILES=	chrono.cc \
159			condition_variable.cc \
160			debug-cxx.cc \
161			functexcept.cc \
162			functional.cc \
163			future.cc \
164			hash_c++0x.cc \
165			hashtable_c++0x.cc \
166			limits.cc \
167			mutex.cc \
168			placeholders.cc \
169			regex.cc \
170			shared_ptr.cc \
171			system_error.cc \
172			thread.cc \
173			fstream-inst.cc \
174			string-inst.cc \
175			wstring-inst.cc \
176			compatibility-c++0x.cc \
177			compatibility-atomic-c++0x.cc \
178			compatibility-thread-c++0x.cc
179
180#generated sources
181SRCS+=	unwind.h \
182	unwind-cxx.h \
183	cxxabi_forced.h \
184	${CONF_HEADERS:T}
185
186HD=	${INCLUDEDIR}/c++/${GCCPOINTVER}
187
188# These sections are detailed in Makefile.headers
189# parallel section is empty, skip it
190# make buildincludes, make installincludes before make depend
191glibcxx_srcdir=	${SRCDIR}
192HSECT=	std bits bits_sup backward ext ext_compat tr1 tr2 decimal \
193	c_base c_compatibility debug profile profile_impl host supc
194PBSECT=	1 2 3 4 5 6 7
195
196.for i in ${HSECT}
197INCSGROUPS+=	 	${i}_headers
198${i}_headersDIR= 	${HD}/${${i}_builddir}
199.endfor
200
201PATHGROUP=
202.for i in ${PBSECT}
203.  for k in ${pb_headers${i}}
204.    if ${PATHGROUP:M${k:H:T}} == ""
205PATHGROUP+=${k:H:T}
206PATH_${k:H:T}=${k:H:T}
207.    endif
208PBG_${k:H:T}+=${k}
209.  endfor
210.endfor
211
212INCSGROUPS+=		PBG_pb_ds
213PBG_pb_dsDIR=		${HD}/${pb_builddir}
214
215INCSGROUPS+=		PBG_detail
216PBG_detailDIR=		${HD}/${pb_builddir}/detail
217
218.for k in ${PATHGROUP:Npb_ds:Ndetail}
219INCSGROUPS+=		PBG_${k}
220PBG_${k}DIR=		${HD}/${pb_builddir}/detail/${PATH_${k}}
221.endfor
222
223INCSGROUPS+=		host_headers_extra
224host_headers_extraDIR=	${HD}/bits
225host_headers_extraNAME_basic_file_stdio.h=	basic_file.h
226host_headers_extraNAME_c_locale.h=		c++locale.h
227host_headers_extraNAME_c_io_stdio.h+=		c++io.h
228host_headers_extraNAME_new_allocator_base.h=	c++allocator.h
229
230CONF_HEADERS=	locale/generic/c++locale_internal.h \
231		abi/compatibility.h
232
233atomicity.cc: ${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h
234	cp ${.ALLSRC} ${.TARGET}
235
236ctype_configure_char.cc: ${SRCDIR}/config/os/bsd/dragonfly/${.TARGET}
237	cp ${.ALLSRC} ${.TARGET}
238
239basic_file.cc: ${SRCDIR}/config/io/basic_file_stdio.cc
240	cp ${.ALLSRC} ${.TARGET}
241
242c++locale.cc: ${SRCDIR}/config/locale/dragonfly/c_locale.cc
243	cp ${.ALLSRC} ${.TARGET}
244
245unwind.h: unwind-generic.h
246	cp ${.ALLSRC} ${.TARGET}
247
248unwind-cxx.h: ${SRCDIR}/libsupc++/unwind-cxx.h
249	cp ${.ALLSRC} ${.TARGET}
250
251cxxabi_forced.h: ${SRCDIR}/libsupc++/cxxabi_forced.h
252	cp ${.ALLSRC} ${.TARGET}
253
254copybits:
255	mkdir -p bits
256
257.for F in ${CONF_HEADERS}
258${F:T}: copybits
259	cp ${SRCDIR}/config/${F} bits/
260.endfor
261
262# We can't add libiberty to the PATH because it will take the regex.o there
263# before compiling regex.cc into an object file.  Just recompile
264
265cp-demangle.c: ${GCCDIR}/libiberty/${.TARGET}
266	cp ${.ALLSRC} ${.TARGET}
267
268# debug.cc, tree.cc and vec.cc are also getting pre-empted by gcc/ versions
269debug-cxx.cc: ${SRCDIR}/src/c++11/debug.cc
270	cp ${.ALLSRC} ${.TARGET}
271
272tree-cxx.cc: ${SRCDIR}/src/c++98/tree.cc
273	cp ${.ALLSRC} ${.TARGET}
274
275vec-cxx.cc: ${SRCDIR}/libsupc++/vec.cc
276	cp ${.ALLSRC} ${.TARGET}
277
278CLEANDIRS+=	bits
279CLEANFILES+=	atomicity.cc basic_file.cc c++locale.cc \
280		ctype_configure_char.cc unwind.h unwind-cxx.h \
281		cp-demangle.c debug-cxx.cc tree-cxx.cc vec-cxx.cc \
282		cxxabi_forced.h c++config.h gthr.h gthr-default.h
283
284.include <bsd.lib.mk>
285