xref: /netbsd-src/external/gpl3/gcc.old/usr.bin/frontend/Makefile (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1#	$NetBSD: Makefile,v 1.1.1.1 2014/02/25 18:42:26 mrg Exp $
2
3LIBISPRIVATE=	yes
4
5# For ../Makefile.inc and bsd.own.mk
6.include <bsd.init.mk>
7
8LIB=		frontend
9
10SRCS=		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"
14SRCS+=		driver-i386.c
15.PATH:		${DIST}/gcc/config/i386
16.endif
17.if ${GCC_MACHINE_ARCH} == "powerpc" || ${GCC_MACHINE_ARCH} == "powerpc64"
18SRCS+=		driver-rs6000.c
19.PATH:		${DIST}/gcc/config/rs6000
20.endif
21
22CPPFLAGS+=	-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="\"\""
28HOST_CPPFLAGS+=	-I${GCCARCH} ${G_ALL_CFLAGS:M-D*} ${G_INCLUDES:M-I*:N-I.*}
29
30DPSRCS+=	specs.h
31
32MKPIC:=		no
33MKPICLIB:=	no
34
35.include <bsd.lib.mk>
36
37CFLAGS+=	-Wno-stack-protector
38
39.PATH: ${DIST}/gcc
40
41# Build the specs.h file
42CLEANFILES+=	specs.h
43specs.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
49optionlist: ${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
52CPPFLAGS.gcc-options.c=	-DGCC_DRIVER
53gcc-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}
56CLEANFILES+=	optionlist gcc-options.c
57