1 # $NetBSD: Makefile,v 1.1.1.1.4.2 2014/05/22 15:58:51 yamt Exp $ 2 3 LIBISPRIVATE= yes 4 5 # For ../Makefile.inc and bsd.own.mk 6 .include <bsd.init.mk> 7 8 LIB= frontend 9 10 SRCS= gcc.c version.c intl.c prefix.c opts-common.c gcc-options.c 11 12 # XXX 13 .if ${GCC_MACHINE_ARCH} == "x86_64" || ${GCC_MACHINE_ARCH} == "i386" 14 SRCS+= driver-i386.c 15 .PATH: ${DIST}/gcc/config/i386 16 .endif 17 .if ${GCC_MACHINE_ARCH} == "powerpc" || ${GCC_MACHINE_ARCH} == "powerpc64" 18 SRCS+= driver-rs6000.c 19 .PATH: ${DIST}/gcc/config/rs6000 20 .endif 21 22 CPPFLAGS+= -I${GCCARCH} -I${BACKENDOBJ} -I. \ 23 ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} \ 24 -DPREFIX=\"/usr\" \ 25 -DDEFAULT_TARGET_VERSION=\"${G_version}\" \ 26 -DDEFAULT_TARGET_MACHINE=\"${MACHINE_GNU_PLATFORM}\" \ 27 -DCONFIGURE_SPECS="\"\"" 28 HOST_CPPFLAGS+= -I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*} 29 30 DPSRCS+= specs.h 31 32 MKPIC:= no 33 MKPICLIB:= no 34 35 .include <bsd.lib.mk> 36 37 CFLAGS+= -Wno-stack-protector 38 39 .PATH: ${DIST}/gcc 40 41 # Build the specs.h file 42 CLEANFILES+= specs.h 43 specs.h: Makefile 44 for f in cp objc; do \ 45 echo "#include \"$$f/lang-specs.h\""; \ 46 done > specs.h 47 48 # Build the options files 49 optionlist: ${G_ALL_OPT_FILES} ${GCCARCH}/defs.mk Makefile ${DIST}/gcc/opt-gather.awk 50 ${TOOL_AWK} -f ${DIST}/gcc/opt-gather.awk ${G_ALL_OPT_FILES} > ${.TARGET} 51 52 CPPFLAGS.gcc-options.c= -DGCC_DRIVER 53 gcc-options.c: optionlist 54 ${TOOL_AWK} -f ${DIST}/gcc/opt-functions.awk -f ${DIST}/gcc/optc-gen.awk \ 55 -v header_name="config.h system.h coretypes.h tm.h" < optionlist > ${.TARGET} 56 CLEANFILES+= optionlist gcc-options.c 57