1# $NetBSD: Makefile,v 1.13 2014/06/01 19:51:01 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= 4 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_OBJC_SOURCE_FILES} ${G_C_SOURCE_FILES} 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} 43CPPFLAGS+= -I${DIST}/libobjc/objc-private 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 61COPTS.objc-act.c = -Wno-stack-protector 62 63INCS= ${G_OBJC_H} 64INCSDIR= /usr/include/objc 65 66DPSRCS+= runtime-info.h 67CLEANFILES+= rtscratch rtscratch.s runtime-info.h 68runtime-info.h: 69 ${_MKTARGET_CREATE} 70 touch rtscratch 71 `${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@ 72 73${OBJS} ${POBJS} ${SOBJS}: runtime-info.h 74 75${SRCS}: tconfig.h options.h 76 77.if ${HAVE_LIBGCC_EH} == "no" 78G_CONFIGLINKS:= ${G_CONFIGLINKS:S,libgcc/config/arm/unwind-arm.h,libgcc/unwind-generic.h,} 79.endif 80 81.if ${MKGCC} != "no" 82.if defined(G_CONFIGLINKS) && !empty(G_CONFIGLINKS) 83BUILDSYMLINKS+= ${G_CONFIGLINKS} 84.for _src _dst in ${G_CONFIGLINKS} 85DPSRCS+= ${_dst} 86.endfor 87.endif 88.endif 89 90.include "../Makefile.tconfigh" 91.include "../Makefile.hacks" 92 93# XXX just while all platforms defs.mk are updated.. 94.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk) 95optionlist: ${G_ALL_OPT_FILES} ${LIBOBJCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk 96 ${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} \ 97 > ${.TARGET} 98 99.if ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "mipseb" 100OPTION_FLAGS=-v header_name="config.h system.h coretypes.h options.h tm.h" \ 101 -f ${DIST}/gcc/opt-read.awk 102OPTION_DEPS=${DIST}/gcc/opt-read.awk 103.endif 104 105options.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk \ 106 ${OPTION_DEPS} 107 ${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \ 108 -f ${DIST}/gcc/opth-gen.awk ${OPTION_FLAGS} \ 109 < optionlist > ${.TARGET} 110 111CLEANFILES+= options.h optionlist 112.endif 113 114.include <bsd.lib.mk> 115 116.PATH: ${DIST}/libobjc ${DIST}/libobjc/objc ${DIST}/libobjc/objc-private 117 118.else 119.include <bsd.prog.mk> # do nothing 120.endif 121 122COPTS.archive.c+= -Wno-error 123COPTS.sendmsg.c+= -Wno-error 124