xref: /minix3/external/gpl3/gcc/lib/libobjc/Makefile (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc#	$NetBSD: Makefile,v 1.13 2014/06/01 19:51:01 mrg Exp $
218a5822eSThomas Veerman
318a5822eSThomas VeermanREQUIRETOOLS=	yes
418a5822eSThomas VeermanNOLINT=		# defined
518a5822eSThomas Veerman
618a5822eSThomas VeermanUNSUPPORTED_COMPILER.clang=	# defined
718a5822eSThomas Veerman
8*0a6a1f1dSLionel Sambuc.include <bsd.init.mk>
918a5822eSThomas Veerman
1018a5822eSThomas VeermanLIB=		objc
1184d9c625SLionel SambucGCC_MACHINE_ARCH?=	${MACHINE_ARCH:S/earmv5/earm/}
1218a5822eSThomas Veerman
1318a5822eSThomas Veerman.if ${MKGCC} != "no"
1418a5822eSThomas Veerman
15*0a6a1f1dSLionel SambucSHLIB_MAJOR=	4
1618a5822eSThomas VeermanSHLIB_MINOR=	0
1718a5822eSThomas Veerman
1818a5822eSThomas Veerman# XXX just while all platforms defs.mk are updated..
1984d9c625SLionel Sambuc.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk)
2018a5822eSThomas Veerman# Machine-dependent definitions (include file names).
2184d9c625SLionel Sambuc.include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk"
2218a5822eSThomas VeermanEXTRA_FAKEHEADERS=
2318a5822eSThomas Veerman.else
2418a5822eSThomas Veerman# Machine-independent definitions (include file names).
2518a5822eSThomas Veerman.include "${.CURDIR}/defs.mk"
2618a5822eSThomas VeermanEXTRA_FAKEHEADERS=
2718a5822eSThomas Veerman.endif
2818a5822eSThomas Veerman
2918a5822eSThomas VeermanLIBGCCOBJ!=    cd ${.CURDIR}/../libgcc/libgcc && ${PRINTOBJDIR}
3018a5822eSThomas Veerman
31*0a6a1f1dSLionel SambucDIST=		${GCCDIST}
32*0a6a1f1dSLionel SambucGNUHOSTDIST=	${DIST}
33*0a6a1f1dSLionel SambucGCCARCH=	${GCC_SUBDIR}/usr.bin/gcc/arch/${GCC_MACHINE_ARCH}
34*0a6a1f1dSLionel SambucLIBOBJCARCH=	${GCC_SUBDIR}/lib/libobjc/arch/${GCC_MACHINE_ARCH}
35*0a6a1f1dSLionel SambucGCCLIBXX=	${GCC_SUBDIR}/lib/libstdc++-v3/arch/${GCC_MACHINE_ARCH}
3618a5822eSThomas Veerman
37*0a6a1f1dSLionel SambucSRCS=		${G_OBJC_SOURCE_FILES} ${G_C_SOURCE_FILES}
3818a5822eSThomas Veerman
3918a5822eSThomas VeermanGCPPFLAGS=	${G_ALL_CFLAGS} ${G_INCLUDES}
4084d9c625SLionel SambucCPPFLAGS+=	-I. -I${.CURDIR}/arch/${GCC_MACHINE_ARCH}
4118a5822eSThomas VeermanCPPFLAGS+=	-I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
4218a5822eSThomas VeermanCPPFLAGS+=	-I${GCCLIBXX}
43*0a6a1f1dSLionel SambucCPPFLAGS+=	-I${DIST}/libobjc/objc-private
4418a5822eSThomas Veerman
4584d9c625SLionel SambucBUILDSYMLINKS=	${.CURDIR}/../libstdc++-v3/arch/${GCC_MACHINE_ARCH} bits
4618a5822eSThomas VeermanDPSRCS+=	bits
4718a5822eSThomas Veerman
4818a5822eSThomas Veerman.for f in Protocol.m Object.m NXConstStr.m linking.m
4918a5822eSThomas VeermanOBJCOPTS.${f}=	-fgnu-runtime
5018a5822eSThomas Veerman.endfor
5118a5822eSThomas Veerman
5218a5822eSThomas Veerman.for f in thr.c thr-objc.c
5318a5822eSThomas VeermanCOPTS.${f}=	-Wno-missing-noreturn
5418a5822eSThomas Veerman.endfor
5518a5822eSThomas Veerman
5618a5822eSThomas VeermanCOPTS+=		-fno-strict-aliasing -fexceptions
5718a5822eSThomas VeermanOBJCOPTS+=	-fno-strict-aliasing -fexceptions
5818a5822eSThomas Veerman
5918a5822eSThomas VeermanOBJCOPTS.Object.m = -Wno-stack-protector
6018a5822eSThomas VeermanCOPTS.sendmsg.c = -Wno-stack-protector
61*0a6a1f1dSLionel SambucCOPTS.objc-act.c = -Wno-stack-protector
6218a5822eSThomas Veerman
6318a5822eSThomas VeermanINCS=		${G_OBJC_H}
6418a5822eSThomas VeermanINCSDIR=	/usr/include/objc
6518a5822eSThomas Veerman
6618a5822eSThomas VeermanDPSRCS+=	runtime-info.h
6718a5822eSThomas VeermanCLEANFILES+=	rtscratch rtscratch.s runtime-info.h
6818a5822eSThomas Veermanruntime-info.h:
6918a5822eSThomas Veerman	${_MKTARGET_CREATE}
7018a5822eSThomas Veerman	touch rtscratch
7118a5822eSThomas Veerman	`${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@
7218a5822eSThomas Veerman
7318a5822eSThomas Veerman${OBJS} ${POBJS} ${SOBJS}: runtime-info.h
7418a5822eSThomas Veerman
75*0a6a1f1dSLionel Sambuc${SRCS}: tconfig.h options.h
7618a5822eSThomas Veerman
77*0a6a1f1dSLionel Sambuc.if ${HAVE_LIBGCC_EH} == "no"
78*0a6a1f1dSLionel SambucG_CONFIGLINKS:= ${G_CONFIGLINKS:S,libgcc/config/arm/unwind-arm.h,libgcc/unwind-generic.h,}
79*0a6a1f1dSLionel Sambuc.endif
80*0a6a1f1dSLionel Sambuc
81*0a6a1f1dSLionel Sambuc.if ${MKGCC} != "no"
82*0a6a1f1dSLionel Sambuc.if defined(G_CONFIGLINKS) && !empty(G_CONFIGLINKS)
83*0a6a1f1dSLionel SambucBUILDSYMLINKS+=	${G_CONFIGLINKS}
84*0a6a1f1dSLionel Sambuc.for _src _dst in ${G_CONFIGLINKS}
85*0a6a1f1dSLionel SambucDPSRCS+=	${_dst}
86*0a6a1f1dSLionel Sambuc.endfor
87*0a6a1f1dSLionel Sambuc.endif
88*0a6a1f1dSLionel Sambuc.endif
8918a5822eSThomas Veerman
9018a5822eSThomas Veerman.include "../Makefile.tconfigh"
9118a5822eSThomas Veerman.include "../Makefile.hacks"
9218a5822eSThomas Veerman
9318a5822eSThomas Veerman# XXX just while all platforms defs.mk are updated..
9484d9c625SLionel Sambuc.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk)
9518a5822eSThomas Veermanoptionlist: ${G_ALL_OPT_FILES} ${LIBOBJCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk
9618a5822eSThomas Veerman	${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} \
9718a5822eSThomas Veerman		> ${.TARGET}
9818a5822eSThomas Veerman
99*0a6a1f1dSLionel Sambuc.if ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "mipseb"
100*0a6a1f1dSLionel SambucOPTION_FLAGS=-v header_name="config.h system.h coretypes.h options.h tm.h" \
101*0a6a1f1dSLionel Sambuc	-f ${DIST}/gcc/opt-read.awk
102*0a6a1f1dSLionel SambucOPTION_DEPS=${DIST}/gcc/opt-read.awk
103*0a6a1f1dSLionel Sambuc.endif
104*0a6a1f1dSLionel Sambuc
105*0a6a1f1dSLionel Sambucoptions.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk \
106*0a6a1f1dSLionel Sambuc	${OPTION_DEPS}
10718a5822eSThomas Veerman	${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \
108*0a6a1f1dSLionel Sambuc		-f ${DIST}/gcc/opth-gen.awk ${OPTION_FLAGS} \
10918a5822eSThomas Veerman		< optionlist > ${.TARGET}
11018a5822eSThomas Veerman
11118a5822eSThomas VeermanCLEANFILES+=	options.h optionlist
11218a5822eSThomas Veerman.endif
11318a5822eSThomas Veerman
11418a5822eSThomas Veerman.include <bsd.lib.mk>
11518a5822eSThomas Veerman
116*0a6a1f1dSLionel Sambuc.PATH: ${DIST}/libobjc ${DIST}/libobjc/objc ${DIST}/libobjc/objc-private
117*0a6a1f1dSLionel Sambuc
11818a5822eSThomas Veerman.else
11918a5822eSThomas Veerman.include <bsd.prog.mk>	# do nothing
12018a5822eSThomas Veerman.endif
12118a5822eSThomas Veerman
12218a5822eSThomas VeermanCOPTS.archive.c+=	-Wno-error
12318a5822eSThomas VeermanCOPTS.sendmsg.c+=	-Wno-error
124