summaryrefslogtreecommitdiff
path: root/gnu/lib/libstdc++/Makefile
blob: 59a429b5dde04c74904d5e8ba2c176e5e1035ffc (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#	$NetBSD: Makefile,v 1.23 2003/09/02 05:26:43 mrg Exp $

REQUIRETOOLS=	yes
NOLINT=		# defined

.include <bsd.own.mk>

LIB=		stdc++

.if exists(${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk) && ${MKGCC} != "no"
.include "${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk"

SHLIB_MAJOR=	4
SHLIB_MINOR=	0

SUBDIR=		include io config

DIST=		${NETBSDSRCDIR}/gnu/dist/toolchain
GNUHOSTDIST=	${DIST}

SRCS=		${G_OBJS:.o=.cc} ${G_LIBIBERTY_OBJS:.o=.c}
INCS=		_G_config.h
INCSDIR=	/usr/include/g++

# Ugly, but they aren't identified individually in libio/Makefile:
.for f in ${G_LIBIOSTREAM_USE}
.if exists(${DIST}/libio/${f:.o=.c})
SRCS+=		${f:.o=.c}
.else
SRCS+=		${f:.o=.cc}
.endif
.endfor

GCPPFLAGS=	${G_XCFLAGS} ${G_CINCLUDES} ${G_MT_CFLAGS} ${G_CXXINCLUDES}
CPPFLAGS+=	-nostdinc++ -I${.CURDIR}/arch/${MACHINE_ARCH} \
		${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} \
		-I${DIST}/gcc/cp/inc \
		-I${NETBSDSRCDIR}/gnu/lib/libiberty -I${DIST}/include

CXXFLAGS+=	${G_XCXXFLAGS:M-f*}

# GCC3 doesn't have this, so lets just not install it anymore...
#TEXINFO=	iostream.texi

.PATH: ${DIST}/libstdc++ ${DIST}/libstdc++/stl ${DIST}/libio ${DIST}/libiberty

.for t in C
.for v in STRFUNCS STRIO
CLEANFILES+=	${t}${v}.cc
SRCS+=		${t}${v}.cc

${t}${v}.cc: Makefile ${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk sinst.cc
	echo '#define ${t}' >$@
.for f in ${G_${v}}
	echo '#define ${f}' >>$@
.endfor
	cat ${>:M*.cc} >>$@
.endfor
.endfor

.for t in F D LD
.for v in COMFUNCS COMIO
CLEANFILES+=	${t}${v}.cc
SRCS+=		${t}${v}.cc

${t}${v}.cc: Makefile ${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk cinst.cc
	echo '#define ${t}' >$@
.for f in ${G_${v}}
	echo '#define ${f}' >>$@
.endfor
	cat ${>:M*.cc} >>$@
.endfor
.endfor

.include <bsd.lib.mk>
.include <bsd.subdir.mk>
.include <bsd.info.mk>

${OBJS}: ${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk
.else
.include <bsd.prog.mk> # do nothing
.endif

.if (${OBJECT_FMT} == "a.out")
LDADD=	${DESTDIR}/usr/lib/c++rt0.o
DPADD=	${DESTDIR}/usr/lib/c++rt0.o
.endif