1# $NetBSD: Makefile,v 1.1.1.2 2014/02/26 10:57:30 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} 32DIST= ${NETBSDSRCDIR}/external/gpl3/gcc/dist 33GNUHOSTDIST= ${DIST} 34GCCARCH= ${GCC_SUBDIR}/usr.bin/gcc/arch/${GCC_MACHINE_ARCH} 35LIBOBJCARCH= ${GCC_SUBDIR}/lib/libobjc/arch/${GCC_MACHINE_ARCH} 36GCCLIBXX= ${GCC_SUBDIR}/lib/libstdc++-v3/arch/${GCC_MACHINE_ARCH} 37 38SRCS= ${G_OBJS:N[A-Z]*:Nlinking.lo:.lo=.c} ${G_OBJS:M[A-Z]*:.lo=.m} linking.m 39 40GCPPFLAGS= ${G_ALL_CFLAGS} ${G_INCLUDES} 41CPPFLAGS+= -I. -I${.CURDIR}/arch/${GCC_MACHINE_ARCH} 42CPPFLAGS+= -I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} 43CPPFLAGS+= -I${GCCLIBXX} 44 45BUILDSYMLINKS= ${.CURDIR}/../libstdc++-v3/arch/${GCC_MACHINE_ARCH} bits 46DPSRCS+= bits 47 48.for f in Protocol.m Object.m NXConstStr.m linking.m 49OBJCOPTS.${f}= -fgnu-runtime 50.endfor 51 52.for f in thr.c thr-objc.c 53COPTS.${f}= -Wno-missing-noreturn 54.endfor 55 56COPTS+= -fno-strict-aliasing -fexceptions 57OBJCOPTS+= -fno-strict-aliasing -fexceptions 58 59OBJCOPTS.Object.m = -Wno-stack-protector 60COPTS.sendmsg.c = -Wno-stack-protector 61 62INCS= ${G_OBJC_H} 63INCSDIR= /usr/include/objc 64 65DPSRCS+= runtime-info.h 66CLEANFILES+= rtscratch rtscratch.s runtime-info.h 67runtime-info.h: 68 ${_MKTARGET_CREATE} 69 touch rtscratch 70 `${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@ 71 72${OBJS} ${POBJS} ${SOBJS}: runtime-info.h 73 74${SRCS}: tconfig.h unwind.h options.h 75 76BUILDSYMLINKS+= ${G_UNWIND_H} unwind.h 77DPSRCS+= unwind.h 78 79.include "../Makefile.tconfigh" 80.include "../Makefile.hacks" 81 82# XXX just while all platforms defs.mk are updated.. 83.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk) 84optionlist: ${G_ALL_OPT_FILES} ${LIBOBJCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk 85 ${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} \ 86 > ${.TARGET} 87 88options.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk 89 ${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \ 90 -f ${DIST}/gcc/opth-gen.awk \ 91 < optionlist > ${.TARGET} 92 93CLEANFILES+= options.h optionlist 94.endif 95 96.include <bsd.lib.mk> 97 98.PATH: ${DIST}/libobjc ${DIST}/libobjc/objc 99 100.else 101.include <bsd.prog.mk> # do nothing 102.endif 103 104COPTS.archive.c+= -Wno-error 105COPTS.sendmsg.c+= -Wno-error 106