summaryrefslogtreecommitdiff
path: root/usr.bin/strip/Makefile
blob: 39e4f52864d240621ae55f7dfc628f90a8f6b848 (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
#	$OpenBSD: Makefile,v 1.10 2004/03/31 21:22:06 mickey Exp $

TARGET_MACHINE_ARCH?=	${MACHINE_ARCH}

PROG=	strip

CFLAGS+=-I${.CURDIR}/../nm
.if ${TARGET_MACHINE_ARCH} != ${MACHINE_ARCH}
# XXX should make this automatic
.if ${TARGET_MACHINE_ARCH} == "i386"
CFLAGS+=	-DMID_MACHINE_OVERRIDE=MID_I386
.elif ${TARGET_MACHINE_ARCH} == "m68k"
CFLAGS+=	-DMID_MACHINE_OVERRIDE=MID_M68K
CPPFLAGS+=-I.
beforedepend:
	ln -sf ${.CURDIR}/../../sys/arch/m68k/include m68k
.elif ${TARGET_MACHINE_ARCH} == "ns32k"
CFLAGS+=	-DMID_MACHINE_OVERRIDE=MID_NS32K
.elif ${TARGET_MACHINE_ARCH} == "sparc"
CFLAGS+=	-DMID_MACHINE_OVERRIDE=MID_SPARC
.elif ${TARGET_MACHINE_ARCH} == "vax"
CFLAGS+=	-DMID_MACHINE_OVERRIDE=MID_VAX
.endif
STRIP=	/usr/bin/strip

.elif ${HOSTCC} != ${CC}
STRIP=./hoststrip

realinstall strip: hoststrip

hoststrip: strip.c
	${HOSTCC} -I${.CURDIR}/../nm ${.CURDIR}/strip.c -o hoststrip
.else
STRIP=./strip
.endif

realinstall:
	${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 600 strip \
	    ${DESTDIR}${BINDIR}
	${STRIP} ${DESTDIR}${BINDIR}/strip
	chmod ${BINMODE} ${DESTDIR}${BINDIR}/strip
	-if [ "${INSTALL_COPY}" = "" ]; then rm -f ${STRIP}; fi

.include <bsd.prog.mk>