1 # $NetBSD: Makefile,v 1.17 2023/08/01 05:57:56 mrg Exp $ 2 3 REQUIRETOOLS= yes 4 NOLINT= # defined 5 6 UNSUPPORTED_COMPILER.clang= # defined 7 8 .include <bsd.init.mk> 9 10 LIB= objc 11 GCC_MACHINE_ARCH?= ${MACHINE_ARCH:S/earmv5/earm/} 12 13 .if ${MKGCC} != "no" 14 15 SHLIB_MAJOR= 4 16 SHLIB_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" 22 EXTRA_FAKEHEADERS= 23 .else 24 # Machine-independent definitions (include file names). 25 .include "${.CURDIR}/defs.mk" 26 EXTRA_FAKEHEADERS= 27 .endif 28 29 LIBGCCOBJ!= cd ${.CURDIR}/../libgcc/libgcc && ${PRINTOBJDIR} 30 31 DIST= ${GCCDIST} 32 GNUHOSTDIST= ${DIST} 33 GCCARCH= ${GCC_SUBDIR}/usr.bin/gcc/arch/${GCC_MACHINE_ARCH} 34 LIBOBJCARCH= ${GCC_SUBDIR}/lib/libobjc/arch/${GCC_MACHINE_ARCH} 35 GCCLIBXX= ${GCC_SUBDIR}/lib/libstdc++-v3/arch/${GCC_MACHINE_ARCH} 36 37 SRCS= ${G_OBJC_SOURCE_FILES} ${G_C_SOURCE_FILES} 38 39 GCPPFLAGS= ${G_ALL_CFLAGS} ${G_INCLUDES} 40 CPPFLAGS+= -I. -I${.CURDIR}/arch/${GCC_MACHINE_ARCH} 41 CPPFLAGS+= -I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} 42 CPPFLAGS+= -I${GCCLIBXX} 43 CPPFLAGS+= -I${DIST}/libobjc/objc-private 44 45 BUILDSYMLINKS= ${.CURDIR}/../libstdc++-v3/arch/${GCC_MACHINE_ARCH} bits 46 DPSRCS+= bits 47 48 .for f in Protocol.m Object.m NXConstStr.m linking.m 49 OBJCOPTS.${f}= -fgnu-runtime 50 .endfor 51 52 .for f in thr.c thr-objc.c 53 COPTS.${f}= -Wno-missing-noreturn 54 .endfor 55 56 COPTS+= -fno-strict-aliasing -fexceptions 57 OBJCOPTS+= -fno-strict-aliasing -fexceptions 58 59 OBJCOPTS.Object.m = -Wno-stack-protector 60 COPTS.sendmsg.c = -Wno-stack-protector 61 COPTS.objc-act.c = -Wno-stack-protector 62 63 INCS= ${G_OBJC_H} 64 INCSDIR= /usr/include/objc 65 66 DPSRCS+= runtime-info.h 67 CLEANFILES+= rtscratch rtscratch.s runtime-info.h 68 runtime-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 .include "../Makefile.gthr" 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) 83 optionlist: ${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 87 .if ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "mipseb" 88 OPTION_FLAGS=-v header_name="config.h system.h coretypes.h options.h tm.h" \ 89 -f ${DIST}/gcc/opt-read.awk 90 OPTION_DEPS=${DIST}/gcc/opt-read.awk 91 .endif 92 93 options.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk \ 94 ${OPTION_DEPS} 95 ${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \ 96 -f ${DIST}/gcc/opth-gen.awk ${OPTION_FLAGS} \ 97 < optionlist > ${.TARGET} 98 99 CLEANFILES+= options.h optionlist 100 .endif 101 102 .include <bsd.lib.mk> 103 104 .PATH: ${DIST}/libobjc ${DIST}/libobjc/objc ${DIST}/libobjc/objc-private 105 106 # XXX insn-modes.h 107 BINBACKENDOBJ!= cd ${.CURDIR}/../../usr.bin/backend && ${PRINTOBJDIR} 108 CPPFLAGS+= -I${BINBACKENDOBJ} 109 110 .else 111 .include <bsd.prog.mk> # do nothing 112 .endif 113 114 COPTS.archive.c+= -Wno-error 115 COPTS.sendmsg.c+= -Wno-error 116 COPTS.encoding.c+= -Wno-pointer-arith # sizeof(void) 117 COPTS+= -Wno-missing-prototypes 118 119 # XXXGCC12 120 OBJCOPTS.Object.m+= -Wno-error=objc-root-class 121