xref: /netbsd-src/external/gpl3/gcc.old/lib/libobjc/Makefile (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1#	$NetBSD: Makefile,v 1.1.1.3 2014/02/27 09:11:35 mrg Exp $
2
3REQUIRETOOLS=	yes
4NOLINT=		# defined
5
6UNSUPPORTED_COMPILER.clang=	# defined
7
8.include <bsd.init.mk>
9
10LIB=		objc
11GCC_MACHINE_ARCH?=	${MACHINE_ARCH:S/earmv5/earm/}
12
13.if ${MKGCC} != "no"
14
15SHLIB_MAJOR=	3
16SHLIB_MINOR=	0
17
18# XXX just while all platforms defs.mk are updated..
19.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk)
20# Machine-dependent definitions (include file names).
21.include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk"
22EXTRA_FAKEHEADERS=
23.else
24# Machine-independent definitions (include file names).
25.include "${.CURDIR}/defs.mk"
26EXTRA_FAKEHEADERS=
27.endif
28
29LIBGCCOBJ!=    cd ${.CURDIR}/../libgcc/libgcc && ${PRINTOBJDIR}
30
31DIST=		${GCCDIST}
32GNUHOSTDIST=	${DIST}
33GCCARCH=	${GCC_SUBDIR}/usr.bin/gcc/arch/${GCC_MACHINE_ARCH}
34LIBOBJCARCH=	${GCC_SUBDIR}/lib/libobjc/arch/${GCC_MACHINE_ARCH}
35GCCLIBXX=	${GCC_SUBDIR}/lib/libstdc++-v3/arch/${GCC_MACHINE_ARCH}
36
37SRCS=		${G_OBJS:N[A-Z]*:Nlinking.lo:.lo=.c} ${G_OBJS:M[A-Z]*:.lo=.m} linking.m
38
39GCPPFLAGS=	${G_ALL_CFLAGS} ${G_INCLUDES}
40CPPFLAGS+=	-I. -I${.CURDIR}/arch/${GCC_MACHINE_ARCH}
41CPPFLAGS+=	-I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
42CPPFLAGS+=	-I${GCCLIBXX}
43
44BUILDSYMLINKS=	${.CURDIR}/../libstdc++-v3/arch/${GCC_MACHINE_ARCH} bits
45DPSRCS+=	bits
46
47.for f in Protocol.m Object.m NXConstStr.m linking.m
48OBJCOPTS.${f}=	-fgnu-runtime
49.endfor
50
51.for f in thr.c thr-objc.c
52COPTS.${f}=	-Wno-missing-noreturn
53.endfor
54
55COPTS+=		-fno-strict-aliasing -fexceptions
56OBJCOPTS+=	-fno-strict-aliasing -fexceptions
57
58OBJCOPTS.Object.m = -Wno-stack-protector
59COPTS.sendmsg.c = -Wno-stack-protector
60
61INCS=		${G_OBJC_H}
62INCSDIR=	/usr/include/objc
63
64DPSRCS+=	runtime-info.h
65CLEANFILES+=	rtscratch rtscratch.s runtime-info.h
66runtime-info.h:
67	${_MKTARGET_CREATE}
68	touch rtscratch
69	`${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@
70
71${OBJS} ${POBJS} ${SOBJS}: runtime-info.h
72
73${SRCS}: tconfig.h unwind.h options.h
74
75BUILDSYMLINKS+=	${G_UNWIND_H} unwind.h
76DPSRCS+=	unwind.h
77
78.include "../Makefile.tconfigh"
79.include "../Makefile.hacks"
80
81# XXX just while all platforms defs.mk are updated..
82.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk)
83optionlist: ${G_ALL_OPT_FILES} ${LIBOBJCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk
84	${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} \
85		> ${.TARGET}
86
87options.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk
88	${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \
89		-f ${DIST}/gcc/opth-gen.awk \
90		< optionlist > ${.TARGET}
91
92CLEANFILES+=	options.h optionlist
93.endif
94
95.include <bsd.lib.mk>
96
97.PATH: ${DIST}/libobjc ${DIST}/libobjc/objc
98
99.else
100.include <bsd.prog.mk>	# do nothing
101.endif
102
103COPTS.archive.c+=	-Wno-error
104COPTS.sendmsg.c+=	-Wno-error
105