NetBSD/external/gpl3/gcc/lib/libobjc/Makefile
mrg 5beaf704be port over 3 changes made here in the GCC 4.5 tree that we'll need
when GCC 4.8 becomes "gcc.old" eventually.

this tree still needs to be tested for more, but this should be the
bulk of the work.

----
Log Message:
prepare for moving GCC 4.5 into gcc.old:

- convert to using ${EXTERNAL_GCC_SUBDIR}
- define base-external-gpl3-gcc* subdir as GCC_SUBDIR
- use <bsd.init.mk> over <bsd.own.mk> for a bunch of places; mostly
  because it arranges for ../Makefile.inc to be included earlier, and
  don't bother including the latter if the former is already included.
- move all .PATH: settings after <bsd.{own,lib}.mk> so that all
  valid variables are set before it is evaluated
- rename mknative-gcc* to match their subdir name.

XXX the relationship between the Makefile.inc/Makefile.gcc_path files
    is kind of sketchy, it would be great if this was fixed.

----
Log Message:
oops, avoid re-setting DIST to something that might be wrong now.

----
Log Message:
fix another dated DIST.
2014-06-01 19:51:01 +00:00

124 lines
3.2 KiB
Makefile

# $NetBSD: Makefile,v 1.13 2014/06/01 19:51:01 mrg Exp $
REQUIRETOOLS= yes
NOLINT= # defined
UNSUPPORTED_COMPILER.clang= # defined
.include <bsd.init.mk>
LIB= objc
GCC_MACHINE_ARCH?= ${MACHINE_ARCH:S/earmv5/earm/}
.if ${MKGCC} != "no"
SHLIB_MAJOR= 4
SHLIB_MINOR= 0
# XXX just while all platforms defs.mk are updated..
.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk)
# Machine-dependent definitions (include file names).
.include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk"
EXTRA_FAKEHEADERS=
.else
# Machine-independent definitions (include file names).
.include "${.CURDIR}/defs.mk"
EXTRA_FAKEHEADERS=
.endif
LIBGCCOBJ!= cd ${.CURDIR}/../libgcc/libgcc && ${PRINTOBJDIR}
DIST= ${GCCDIST}
GNUHOSTDIST= ${DIST}
GCCARCH= ${GCC_SUBDIR}/usr.bin/gcc/arch/${GCC_MACHINE_ARCH}
LIBOBJCARCH= ${GCC_SUBDIR}/lib/libobjc/arch/${GCC_MACHINE_ARCH}
GCCLIBXX= ${GCC_SUBDIR}/lib/libstdc++-v3/arch/${GCC_MACHINE_ARCH}
SRCS= ${G_OBJC_SOURCE_FILES} ${G_C_SOURCE_FILES}
GCPPFLAGS= ${G_ALL_CFLAGS} ${G_INCLUDES}
CPPFLAGS+= -I. -I${.CURDIR}/arch/${GCC_MACHINE_ARCH}
CPPFLAGS+= -I${GCCARCH} ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*}
CPPFLAGS+= -I${GCCLIBXX}
CPPFLAGS+= -I${DIST}/libobjc/objc-private
BUILDSYMLINKS= ${.CURDIR}/../libstdc++-v3/arch/${GCC_MACHINE_ARCH} bits
DPSRCS+= bits
.for f in Protocol.m Object.m NXConstStr.m linking.m
OBJCOPTS.${f}= -fgnu-runtime
.endfor
.for f in thr.c thr-objc.c
COPTS.${f}= -Wno-missing-noreturn
.endfor
COPTS+= -fno-strict-aliasing -fexceptions
OBJCOPTS+= -fno-strict-aliasing -fexceptions
OBJCOPTS.Object.m = -Wno-stack-protector
COPTS.sendmsg.c = -Wno-stack-protector
COPTS.objc-act.c = -Wno-stack-protector
INCS= ${G_OBJC_H}
INCSDIR= /usr/include/objc
DPSRCS+= runtime-info.h
CLEANFILES+= rtscratch rtscratch.s runtime-info.h
runtime-info.h:
${_MKTARGET_CREATE}
touch rtscratch
`${OBJC} --print-prog-name=cc1obj` -print-objc-runtime-info rtscratch >$@
${OBJS} ${POBJS} ${SOBJS}: runtime-info.h
${SRCS}: tconfig.h options.h
.if ${HAVE_LIBGCC_EH} == "no"
G_CONFIGLINKS:= ${G_CONFIGLINKS:S,libgcc/config/arm/unwind-arm.h,libgcc/unwind-generic.h,}
.endif
.if ${MKGCC} != "no"
.if defined(G_CONFIGLINKS) && !empty(G_CONFIGLINKS)
BUILDSYMLINKS+= ${G_CONFIGLINKS}
.for _src _dst in ${G_CONFIGLINKS}
DPSRCS+= ${_dst}
.endfor
.endif
.endif
.include "../Makefile.tconfigh"
.include "../Makefile.hacks"
# XXX just while all platforms defs.mk are updated..
.if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}/defs.mk)
optionlist: ${G_ALL_OPT_FILES} ${LIBOBJCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk
${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} \
> ${.TARGET}
.if ${MACHINE_ARCH} == "vax" || ${MACHINE_ARCH} == "mipseb"
OPTION_FLAGS=-v header_name="config.h system.h coretypes.h options.h tm.h" \
-f ${DIST}/gcc/opt-read.awk
OPTION_DEPS=${DIST}/gcc/opt-read.awk
.endif
options.h: optionlist ${DIST}/gcc/opt-functions.awk ${DIST}/gcc/opth-gen.awk \
${OPTION_DEPS}
${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk \
-f ${DIST}/gcc/opth-gen.awk ${OPTION_FLAGS} \
< optionlist > ${.TARGET}
CLEANFILES+= options.h optionlist
.endif
.include <bsd.lib.mk>
.PATH: ${DIST}/libobjc ${DIST}/libobjc/objc ${DIST}/libobjc/objc-private
.else
.include <bsd.prog.mk> # do nothing
.endif
COPTS.archive.c+= -Wno-error
COPTS.sendmsg.c+= -Wno-error