summaryrefslogtreecommitdiff
path: root/gnu/egcs/gcc/Makefile.bsd-wrapper
blob: d45fce4fe18df865f89ce60c568705859cbbe315 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#	$OpenBSD: Makefile.bsd-wrapper,v 1.12 2003/01/18 23:49:50 deraadt Exp $

MAN=		cccp.1 gcc.1 gcc-local.1 protoize.1
MLINKS+=	gcc.1 cc.1
MLINKS+=	cccp.1 cpp.1
MLINKS+=	protoize.1 unprotize.1

.if defined(BOOTSTRAP)
LANGUAGES=--enable-languages=c
.else
LANGUAGES=--enable-languages='c,c++,objc,f77' 
MAN+=		cp/g++.1 f/g77.1
MLINKS+=	g++.1 c++.1
MLINKS+=	g77.1 f77.1
.endif

VAXHOST_CFLAGS=	-DIN_GCC -DOPENBSD_NATIVE -DHAVE_CONFIG_H -O0

GXX_INCDIR=	/usr/include/g++
GNUCFLAGS=	CFLAGS="${CFLAGS} ${COPTS} -DOPENBSD_NATIVE"
CLEANFILES=	.gdbinit */.gdbinit *.info* \
		c-parse.c c-parse.h c-parse.y cexp.c cp/parse.c cp/parse.h \
		f/*.info* objc-parse.c objc-parse.y target_path \
		genrtl.c genrtl.h fixinc.sh fixinc/Makefile \
		po/Makefile  po/Makefile.in  po/POTFILES

CXX_HEADERS=	${.CURDIR}/cp/inc/typeinfo ${.CURDIR}/cp/inc/exception \
		${.CURDIR}/cp/inc/new ${.CURDIR}/cp/inc/new.h

.if ${MACHINE} == "arc" || ${MACHINE} == "pmax" || ${MACHINE} == "wgrisc"
M_ARCH=		mipsel
.elif ${MACHINE} == "hkmips" || ${MACHINE} == "sgi"
M_ARCH=		mips
.else
M_ARCH=		${MACHINE_ARCH}
.endif


GCCARCH=	${M_ARCH}-unknown-openbsd`uname -r`

all:	config.status
.if ${MACHINE_ARCH} == "vax"
	${MAKE} ${GNUCFLAGS} CC="${CC}" LDFLAGS="${LDSTATIC}" \
		HOST_CFLAGS="${VAXHOST_CFLAGS}" build_infodir=. all doc
.else
	${MAKE} ${GNUCFLAGS} CC="${CC}" LDFLAGS="${LDSTATIC}" \
		build_infodir=. all doc
.endif

tree-check.h: config.status
	${MAKE} ${GNUCFLAGS} CC="${CC}" LDFLAGS="${LDSTATIC}" \
		build_infodir=. tree-check.h


.FORCE:	.IGNORE

.include <bsd.own.mk>

.ifdef GLOBAL_AUTOCONF_CACHE
CF=	--cache-file=${GLOBAL_AUTOCONF_CACHE}
.else
CF=
.endif

config.status: Makefile.in configure c-parse.in
	PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
	INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
	/bin/sh ${.CURDIR}/configure --with-gnu-as --with-gnu-ld \
		--prefix=/usr --mandir='$$(prefix)/share/man' \
		--with-local-prefix=/usr ${CF} \
		${LANGUAGES} --enable-cpp --disable-nls \
		--with-gxx-include-dir=${GXX_INCDIR} ${GCCARCH} && touch config.status

includes:
	@-for i in ${CXX_HEADERS}; do \
		j=`basename $$i` \
		cmp -s $$i ${DESTDIR}/${GXX_INCDIR}/$$j || \
		    ${INSTALL} ${INSTALL_COPY} -m 444 $$i \
		    ${DESTDIR}/${GXX_INCDIR}; \
	done

.ifdef NOMAN
maninstall:
	@echo NOMAN is set
.endif

# XXX INSTALL_TARGET should be install-normal, more or less
# the only reason is not so is because our man handling is special
# (pre-formatted) and also because of cpp, that we install by hand
# elsewhere, until we get rid of that old `compatibility' script.

target_path: Makefile
	__target=`sed -n '/^target=/s/target=//p' Makefile`; \
	__version=`sed -n '/^gcc_version=/s/gcc_version=//p' Makefile`; \
	echo /usr/lib/gcc-lib/$$__target/$$__version >target_path

install:	maninstall target_path
	${MAKE} ${GNUCFLAGS} prefix=${DESTDIR}/usr \
		INSTALL_PROGRAM="${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP}" \
		infodir=${DESTDIR}/usr/share/info \
		build_infodir=. \
		tooldir=/tmp assertdir=/tmp \
		INSTALL_TARGET='install-common $$(INSTALL_HEADERS) \
		     $$(INSTALL_LIBGCC) install-info \
		     intl.install lang.install-normal' \
		NO_TARGET_GCC=true bindir=${DESTDIR}/usr/bin \
		install
	chown -R ${BINOWN}.${BINGRP} ${DESTDIR}/usr/lib/gcc-lib
	chmod -R a+rX ${DESTDIR}/usr/lib/gcc-lib
#	if [ -e ${DESTDIR}/usr/lib/libf2c.a ]; then \
#		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/lib/libf2c.a; \
#		chmod 444 ${DESTDIR}/usr/lib/libf2c.a; \
#	fi
	if [ -e ${DESTDIR}/usr/include/f2c.h ]; then \
		chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/include/f2c.h; \
		chmod 444 ${DESTDIR}/usr/include/f2c.h; \
	fi
	${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -m 755 cpp \
	   ${DESTDIR}/usr/libexec/cpp
	${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -m 755 xgcc \
	   ${DESTDIR}/usr/bin/gcc
	ln -f ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
	[ -f ${DESTDIR}/usr/bin/g77 ] && \
		ln -f ${DESTDIR}/usr/bin/g77 ${DESTDIR}/usr/bin/f77
#	ln -fs `cat target-path`/cpp \
#		${DESTDIR}/usr/libexec

clean cleandir: 
	-@if [ -e Makefile ]; then ${MAKE} distclean; fi
	-rm -f ${CLEANFILES}

depend:
	# Nothing here so far...

lint:
	# Nothing here so far...

tags:
	# Nothing here so far...

.include <bsd.obj.mk>
.include <bsd.subdir.mk>
.ifndef NOMAN
.include <bsd.man.mk>
.endif