xref: /netbsd-src/rescue/Makefile (revision 7c3f385475147b6e1c4753f2bee961630e2dfc40)
1#	$NetBSD: Makefile,v 1.21 2008/02/09 02:37:21 mrg Exp $
2
3.include <bsd.own.mk>
4.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
5
6WARNS=		1
7# XXX
8.if ${MACHINE_ARCH} != "m68000"
9DBG=		-Os
10.endif
11
12CRUNCHGEN_FLAGS=-d "${DBG}"
13
14RESCUEDIR=	/rescue
15CRUNCHBIN=	rescue
16CRUNCHENV=	RESCUEDIR=${RESCUEDIR}
17SMALLPROG=	0
18LISTS=		${.CURDIR}/list
19TARGETDIR=	${DESTDIR}/rescue
20PARSELISTENV+=  TARGETDIR=${TARGETDIR:Q}
21
22.for f in edlabel ldconfig pdisk
23PROG_${f}!=	cd ${NETBSDSRCDIR}/sbin/${f} && ${MAKE} -V PROG
24.if (${PROG_${f}} != "")
25LISTS+=		${.CURDIR}/list.${f}
26.endif
27.endfor
28
29.if ${USE_INET6} != "no"
30LISTS+=		${.CURDIR}/list.inet6
31.endif
32
33.if ${MKCRYPTO} != "no"
34LISTS+=		${.CURDIR}/list.crypto
35CRUNCHENV+=	MKKERBEROS=no		# for ssh
36.endif
37
38.if (${OBJECT_FMT} == "ELF")
39PARSELISTENV+=	LDD_CMD=ldd_elf
40.else
41PARSELISTENV+=	LDD_CMD=ldd_aout
42.endif
43
44#	Specially built objects to override the behaviour of
45#	various library functions
46#
47
48OVERRIDEOBJS=	rcmd.o
49.PATH:	${NETBSDSRCDIR}/lib/libc/net
50CPPFLAGS.rcmd.c+=-I${NETBSDSRCDIR}/lib/libc/include -DRESCUEDIR=\"${RESCUEDIR}\"
51
52LIBOVERRIDE=	liboverride.o
53${LIBOVERRIDE}: ${OVERRIDEOBJS}
54	${_MKTARGET_LINK}
55	${LD} -r -o $@ ${OVERRIDEOBJS}
56
57CLEANFILES+=	${OVERRIDEOBJS} ${LIBOVERRIDE}
58
59${CRUNCHBIN}:	${LIBOVERRIDE}
60
61
62#	The primary target ...
63#
64
65CLEANFILES+=	rescue.unstripped
66
67.include "${DISTRIBDIR}/common/Makefile.crunch"
68
69realall: ${CRUNCHBIN}
70
71install: ${CRUNCHBIN}
72# XXX this MKMSG doesn't line up
73	${_MKMSG} "populate ${TARGETDIR}"
74	${PARSELIST} -v mode=install ${LISTS} | ${MAKE} -f - install
75
76.include <bsd.prog.mk>
77