Home | History | Annotate | Line # | Download | only in libobjc
Makefile revision 1.1
      1 #	$NetBSD: Makefile,v 1.1 2011/06/21 06:02:27 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 
     12 .if ${MKGCC} != "no"
     13 
     14 SHLIB_MAJOR=	3
     15 SHLIB_MINOR=	0
     16 
     17 # XXX just while all platforms defs.mk are updated..
     18 .if exists(${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk)
     19 # Machine-dependent definitions (include file names).
     20 .include "${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk"
     21 EXTRA_FAKEHEADERS=
     22 .else
     23 # Machine-independent definitions (include file names).
     24 .include "${.CURDIR}/defs.mk"
     25 EXTRA_FAKEHEADERS=	options.h
     26 .endif
     27 
     28 LIBGCCOBJ!=    cd ${.CURDIR}/../libgcc4/libgcc && ${PRINTOBJDIR}
     29 
     30 DIST=		${NETBSDSRCDIR}/gnu/dist/gcc4
     31 GNUHOSTDIST=	${NETBSDSRCDIR}/gnu/dist/gcc4
     32 GCCARCH=	${NETBSDSRCDIR}/gnu/usr.bin/gcc4/arch/${MACHINE_ARCH}
     33 LIBOBJCARCH=	${NETBSDSRCDIR}/gnu/lib/libobjc4/arch/${MACHINE_ARCH}
     34 GCCLIBXX=	${NETBSDSRCDIR}/gnu/lib/libstdc++-v3_4/arch/${MACHINE_ARCH}
     35 
     36 SRCS=		${G_OBJS:N[A-Z]*:Nlinking.lo:.lo=.c} ${G_OBJS:M[A-Z]*:.lo=.m} linking.m
     37 
     38 GCPPFLAGS=	${G_ALL_CFLAGS} ${G_INCLUDES}
     39 CPPFLAGS+=	-I. -I${.CURDIR}/arch/${MACHINE_ARCH}
     40 CPPFLAGS+=	-I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
     41 CPPFLAGS+=	-I${GCCLIBXX}
     42 
     43 BUILDSYMLINKS=	${.CURDIR}/../libstdc++-v3_4/arch/${MACHINE_ARCH} bits
     44 DPSRCS+=	bits
     45 
     46 .for f in Protocol.m Object.m NXConstStr.m linking.m
     47 OBJCOPTS.${f}=	-fgnu-runtime
     48 .endfor
     49 
     50 .for f in thr.c thr-objc.c
     51 COPTS.${f}=	-Wno-missing-noreturn
     52 .endfor
     53 
     54 COPTS+=		-fno-strict-aliasing -fexceptions
     55 OBJCOPTS+=	-fno-strict-aliasing -fexceptions
     56 
     57 OBJCOPTS.Object.m = -Wno-stack-protector
     58 COPTS.sendmsg.c = -Wno-stack-protector
     59 
     60 INCS=		${G_OBJC_H}
     61 INCSDIR=	/usr/include/objc
     62 
     63 DPSRCS+=	runtime-info.h
     64 CLEANFILES+=	rtscratch rtscratch.s runtime-info.h
     65 runtime-info.h:
     66 	${_MKTARGET_CREATE}
     67 	touch rtscratch
     68 	`${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@
     69 
     70 .PATH: ${DIST}/libobjc ${DIST}/libobjc/objc
     71 
     72 .include <bsd.lib.mk>
     73 
     74 ${OBJS} ${POBJS} ${SOBJS}: runtime-info.h
     75 
     76 # these aren't necessary but are #include'd
     77 FAKEHEADERS=	${EXTRA_FAKEHEADERS} insn-flags.h insn-constants.h
     78 ${FAKEHEADERS}:
     79 	${_MKTARGET_CREATE}
     80 	touch ${.TARGET}
     81 tm.h ${SRCS}: ${FAKEHEADERS}
     82 CLEANFILES+=	${FAKEHEADERS}
     83 
     84 ${SRCS}: tconfig.h unwind.h options.h
     85 
     86 tconfig.h:
     87 	${_MKTARGET_CREATE}
     88 	TARGET_CPU_DEFAULT="" \
     89 	HEADERS="$(G_xm_include_list)" DEFINES="USED_FOR_TARGET $(G_xm_defines)" \
     90 	${HOST_SH} $(GNUHOSTDIST)/gcc/mkconfig.sh tconfig.h
     91 
     92 unwind.h: ${G_UNWIND_H}
     93 	${_MKTARGET_CREATE}
     94 	rm -f ${.TARGET}
     95 	ln -s ${G_UNWIND_H} ${.TARGET}
     96 
     97 CLEANFILES+= cs-tconfig.h tconfig.h unwind.h
     98 
     99 # XXX just while all platforms defs.mk are updated..
    100 .if exists(${.CURDIR}/arch/${MACHINE_ARCH}/defs.mk)
    101 optionlist: ${G_ALL_OPT_FILES} ${LIBOBJCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk
    102 	${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} \
    103 		> ${.TARGET}
    104 
    105 options.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk
    106 	${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \
    107 		-f ${DIST}/gcc/opth-gen.awk \
    108 		< optionlist > ${.TARGET}
    109 
    110 CLEANFILES+=	options.h optionlist
    111 .endif
    112 
    113 .else
    114 .include <bsd.prog.mk>	# do nothing
    115 .endif
    116