summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/Makefile.bsd-wrapper
blob: 41e3a918d01e0283d8730fcd6a5ff8b6aa225f8b (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
#	$OpenBSD: Makefile.bsd-wrapper,v 1.43 2001/03/18 17:39:55 millert Exp $

NEW_BINUTILS=alpha mips powerpc hppa

SUBDIRS=	opcodes bfd
ALL_X11_MODULES=
INSTALL_X11_MODULES=


# This allows moving the whole binutils installation around for 
# testing purposes
PREFIX=/usr
.if ${PREFIX} != "/usr"
MANDIR=${PREFIX}/share/man/cat
.endif

MAN=		binutils/objdump.1

.if ${MACHINE_ARCH} != "unknown"
SUBDIRS+=	gdb mmalloc
MAN+=		gdb/gdb.1
ALL_X11_MODULES+=all-gdb
INSTALL_X11_MODULES+=install-gdb
.endif

.for _arch in ${MACHINE_ARCH}
.  if !empty(NEW_BINUTILS:M${_arch})
SUBDIRS+=	binutils ld gas gprof
MAN+=		binutils/ar.1 binutils/nm.1 \
		binutils/objcopy.1 binutils/ranlib.1 \
		binutils/size.1 binutils/strings.1 binutils/strip.1 \
		gas/doc/as.1 gprof/gprof.1 ld/ld.1
.  endif
.endfor

# Used by the GNU Makefile
ALL_MODULES=${SUBDIRS:S/^/all-/g}
INSTALL_MODULES=${SUBDIRS:S/^/install-/g}
	
all:	config.status
	SUBDIRS='${SUBDIRS}' ${MAKE} CC="${CC}" \
	    CFLAGS="${CFLAGS} ${COPTS}" LDFLAGS=${LDSTATIC} \
	    scriptdir=${PREFIX}/libdata \
	    tooldir=${PREFIX} \
	    ALL_MODULES="${ALL_MODULES}" \
	    ALL_X11_MODULES="${ALL_X11_MODULES}" all info
	cd ${.OBJDIR}/binutils && \
	    ${MAKE} CC="${CC}" CFLAGS="${CFLAGS} ${COPTS}" \
	    LDFLAGS=${LDSTATIC} objdump

.include <bsd.own.mk>

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

do-config: .USE
	PATH="/bin:/usr/bin:/sbin:/usr/sbin" \
	sh ${.CURDIR}/configure --prefix=${PREFIX} \
	    --infodir='$${prefix}/share/info' \
	    --disable-nls --disable-gdbtk --disable-commonbfdlib ${CF}
	cd ${.OBJDIR} && \
	    sed -e 's,SUBDIRS *=,SUBDIRS ?=,' <Makefile >Makefile.tmp && \
	    mv -f Makefile.tmp Makefile

config: do-config
.ifndef GLOBAL_AUTOCONF_CACHE
	-rm -f config.cache
.endif

config.status: do-config

# Need to pass SUBDIRS because of install-info
install: maninstall
	SUBDIRS='${SUBDIRS}' ${MAKE} DESTDIR='${DESTDIR}' \
	    INSTALL_X11_MODULES="${INSTALL_X11_MODULES}" \
	    INSTALL_MAN= \
	    scriptdir=${PREFIX}/libdata \
	    tooldir=${PREFIX} \
	    INSTALL_MODULES='${INSTALL_MODULES}' install install-info
	cd ${.OBJDIR}/binutils && \
		${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} \
			-m ${BINMODE} objdump ${DESTDIR}${PREFIX}/bin

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

depend:
	# Nothing here so far...

lint:
	# Nothing here so far...

tags:
	# Nothing here so far...

.PHONY: config

.include <bsd.obj.mk>
.include <bsd.subdir.mk>

.ifdef NOMAN
maninstall:
	@echo NOMAN is set
.else
.include <bsd.man.mk>
.endif