Home | History | Annotate | Line # | Download | only in libobjc
Makefile revision 1.10
      1 #	$NetBSD: Makefile,v 1.10 2014/03/01 10:00:42 mrg Exp $
      2 
      3 REQUIRETOOLS=	yes
      4 NOLINT=		# defined
      5 
      6 UNSUPPORTED_COMPILER.clang=	# defined
      7 
      8 .include <bsd.own.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=		${NETBSDSRCDIR}/external/gpl3/gcc/dist
     32 GNUHOSTDIST=	${NETBSDSRCDIR}/external/gpl3/gcc/dist
     33 GCCARCH=	${NETBSDSRCDIR}/external/gpl3/gcc/usr.bin/gcc/arch/${GCC_MACHINE_ARCH}
     34 LIBOBJCARCH=	${NETBSDSRCDIR}/external/gpl3/gcc/lib/libobjc/arch/${GCC_MACHINE_ARCH}
     35 GCCLIBXX=	${NETBSDSRCDIR}/external/gpl3/gcc/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 
     62 INCS=		${G_OBJC_H}
     63 INCSDIR=	/usr/include/objc
     64 
     65 DPSRCS+=	runtime-info.h
     66 CLEANFILES+=	rtscratch rtscratch.s runtime-info.h
     67 runtime-info.h:
     68 	${_MKTARGET_CREATE}
     69 	touch rtscratch
     70 	`${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@
     71 
     72 .PATH: ${DIST}/libobjc ${DIST}/libobjc/objc ${DIST}/libobjc/objc-private
     73 
     74 ${OBJS} ${POBJS} ${SOBJS}: runtime-info.h
     75 
     76 ${SRCS}: tconfig.h options.h
     77 
     78 .if ${MKGCC} != "no"
     79 .if defined(G_CONFIGLINKS) && !empty(G_CONFIGLINKS)
     80 BUILDSYMLINKS+=	${G_CONFIGLINKS}
     81 .for _src _dst in ${G_CONFIGLINKS}
     82 DPSRCS+=	${_dst}
     83 .endfor
     84 .endif
     85 .endif
     86 
     87 .include "../Makefile.tconfigh"
     88 .include "../Makefile.hacks"
     89 
     90 # XXX just while all platforms defs.mk are updated..
     91 .if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk)
     92 optionlist: ${G_ALL_OPT_FILES} ${LIBOBJCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk
     93 	${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} \
     94 		> ${.TARGET}
     95 
     96 .if ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "mipseb"
     97 OPTION_FLAGS=-v header_name="config.h system.h coretypes.h options.h tm.h" \
     98 	-f ${DIST}/gcc/opt-read.awk
     99 OPTION_DEPS=${DIST}/gcc/opt-read.awk
    100 .endif
    101 
    102 options.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk \
    103 	${OPTION_DEPS}
    104 	${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \
    105 		-f ${DIST}/gcc/opth-gen.awk ${OPTION_FLAGS} \
    106 		< optionlist > ${.TARGET}
    107 
    108 CLEANFILES+=	options.h optionlist
    109 .endif
    110 
    111 .include <bsd.lib.mk>
    112 
    113 .else
    114 .include <bsd.prog.mk>	# do nothing
    115 .endif
    116 
    117 COPTS.archive.c+=	-Wno-error
    118 COPTS.sendmsg.c+=	-Wno-error
    119