summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc/Makefile.bsd-wrapper
blob: 84ebd8af7b0eca3344f554aca48ec50dda599df5 (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
#	$OpenBSD: Makefile.bsd-wrapper,v 1.26 1997/07/24 19:27:50 kstailey Exp $

MAN=		cccp.1 gcc.1 cp/g++.1 f/g77.1
MLINKS+=	gcc.1 cc.1
MLINKS+=	cccp.1 cpp.1
MLINKS+=	g++.1 c++.1

GPP_INC_DIR=	/usr/include/g++
GNUCFLAGS=	CFLAGS="${CFLAGS} ${COPTS} -DOPENBSD_NATIVE"
CLEANFILES=	.gdbinit cp/.gdbinit *.info* bi-parser.c bi-parser.h \
		c-parse.c c-parse.h c-parse.y cexp.c cp/parse.c cp/parse.h \
		objc-parse.c objc-parse.y f/.gdbinit f/*.info*

.if ${MACHINE} == "arc" || ${MACHINE} == "pmax"
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
	${MAKE} ${GNUCFLAGS} BISON=yacc CC=${CC} LDFLAGS=${LDSTATIC} \
		build_infodir=. all doc

.FORCE:	.IGNORE

config: .FORCE
	-rm -f config.cache
	/bin/sh ${.CURDIR}/configure --with-gnu-as --with-gnu-ld \
		--prefix=/usr --local-prefix=/usr \
		--gxx-include=${GPP_INC_DIR} ${GCCARCH}
config.status: Makefile.in configure c-parse.in
	/bin/sh ${.CURDIR}/configure --with-gnu-as --with-gnu-ld \
		--prefix=/usr --local-prefix=/usr \
		--gxx-include=${GPP_INC_DIR} ${GCCARCH} && touch config.status

.include <bsd.own.mk>

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

.if defined (INSTALL_STRIP) && ${INSTALL_STRIP} == "-s"
INST_PROG='/usr/bin/install -cs'
.else
INST_PROG='/usr/bin/install -c'
.endif

install:	maninstall
	${MAKE} ${GNUCFLAGS} prefix=${DESTDIR}/usr \
		INSTALL_PROGRAM=$(INST_PROG) \
		infodir=${DESTDIR}/usr/share/info \
		build_infodir=. \
		tooldir=/tmp assertdir=/tmp INSTALL_MAN= NO_TARGET_GCC=true \
		bindir=${DESTDIR}/usr/bin install
	ln -f ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
	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
	__target=`sed -n '/^target=/s/target=//p' Makefile`; \
	__version=`sed -n '/^version=/s/version=//p' Makefile`; \
	ln -fs /usr/lib/gcc-lib/$$__target/$$__version/cpp \
		${DESTDIR}/usr/libexec

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

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