Home | History | Annotate | Line # | Download | only in rescue
Makefile revision 1.36
      1 #	$NetBSD: Makefile,v 1.36 2019/01/27 02:08:36 pgoyette Exp $
      2 
      3 NOLIBCSANITIZER=	# defined
      4 NOSANITIZER=		# defined
      5 
      6 NOLIBCSANITIZER=	# defined
      7 NOSANITIZER=		# defined
      8 
      9 .include <bsd.own.mk>
     10 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
     11 
     12 WARNS=		1
     13 # XXX
     14 .if ${MACHINE_ARCH} != "m68000"
     15 DBG+=		-Os
     16 .endif
     17 
     18 CRUNCHGEN_FLAGS=-d "${DBG}"
     19 
     20 .if ${MKSTATICPIE:Uno} == "yes"
     21 CRUNCHGEN_FLAGS+=-p
     22 CFLAGS+=-fPIE
     23 .endif
     24 
     25 RESCUEDIR=	/rescue
     26 CRUNCHBIN=	rescue
     27 CRUNCHENV=	RESCUEDIR=${RESCUEDIR}
     28 SMALLPROG=	0
     29 LISTS=		${.CURDIR}/list
     30 TARGETDIR=	${DESTDIR}/rescue
     31 PARSELISTENV+=  TARGETDIR=${TARGETDIR:Q}
     32 
     33 .for f in ldconfig
     34 PROG_${f}!=	cd ${NETBSDSRCDIR}/sbin/${f} && ${MAKE} -V PROG
     35 .if (${PROG_${f}} != "")
     36 LISTS+=		${.CURDIR}/list.${f}
     37 .endif
     38 .endfor
     39 
     40 .for f in pdisk
     41 PROG_${f}!=	cd ${NETBSDSRCDIR}/external/bsd/${f}/bin && ${MAKE} -V PROG
     42 .if (${PROG_${f}} != "")
     43 LISTS+=		${.CURDIR}/list.${f}
     44 .endif
     45 .endfor
     46 
     47 .if ${USE_INET6} != "no"
     48 LISTS+=		${.CURDIR}/list.inet6
     49 .endif
     50 
     51 LISTS+=		${.CURDIR}/list.crypto
     52 CRUNCHENV+=	MKKERBEROS=no		# for ssh
     53 
     54 LISTS+=		${.CURDIR}/list.ldd
     55 LDD_ELF32DIR!=	cd ${NETBSDSRCDIR}/usr.bin/ldd/elf32 && ${PRINTOBJDIR}
     56 LDD_ELF64DIR!=	cd ${NETBSDSRCDIR}/usr.bin/ldd/elf64 && ${PRINTOBJDIR}
     57 PARSELISTENV+=	LDD_ELF32DIR=${LDD_ELF32DIR} LDD_ELF64DIR=${LDD_ELF64DIR}
     58 
     59 SMB_LIBDIR!=	cd ${NETBSDSRCDIR}/external/bsd/smbfs/lib/libsmb && ${PRINTOBJDIR}
     60 PARSELISTENV+=	SMB_LIBDIR=${SMB_LIBDIR}
     61 
     62 #	Specially built objects to override the behaviour of
     63 #	various library functions
     64 #
     65 
     66 OVERRIDEOBJS=	rcmd.o
     67 .PATH:	${NETBSDSRCDIR}/lib/libc/net
     68 CPPFLAGS.rcmd.c+=-I${NETBSDSRCDIR}/lib/libc/include -DRESCUEDIR=\"${RESCUEDIR}\"
     69 
     70 LIBOVERRIDE=	liboverride.o
     71 ${LIBOVERRIDE}: ${OVERRIDEOBJS}
     72 	${_MKTARGET_LINK}
     73 	${LD} -r -o $@ ${OVERRIDEOBJS}
     74 
     75 CLEANFILES+=	${OVERRIDEOBJS} ${LIBOVERRIDE}
     76 
     77 ${CRUNCHBIN}:	${LIBOVERRIDE}
     78 
     79 
     80 #	The primary target ...
     81 #
     82 
     83 CLEANFILES+=	rescue.unstripped
     84 
     85 .include "${DISTRIBDIR}/common/Makefile.crunch"
     86 
     87 realall: ${CRUNCHBIN}
     88 
     89 install: ${CRUNCHBIN}
     90 # XXX this MKMSG doesn't line up
     91 	${_MKMSG} "populate ${TARGETDIR}"
     92 	${PARSELIST} -v mode=install ${LISTS} | ${MAKE} -f - install
     93 
     94 .include <bsd.prog.mk>
     95