1 1.45 thorpej # $NetBSD: Makefile,v 1.45 2025/12/24 20:05:59 thorpej Exp $ 2 1.34 kamil 3 1.35 kamil NOLIBCSANITIZER= # defined 4 1.34 kamil NOSANITIZER= # defined 5 1.1 lukem 6 1.1 lukem .include <bsd.own.mk> 7 1.1 lukem .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 8 1.1 lukem 9 1.1 lukem WARNS= 1 10 1.21 mrg # XXX 11 1.21 mrg .if ${MACHINE_ARCH} != "m68000" 12 1.31 matt DBG+= -Os 13 1.21 mrg .endif 14 1.21 mrg 15 1.39 christos CRUNCHGEN_FLAGS+=-V DBG="${DBG}" 16 1.1 lukem 17 1.33 christos .if ${MKSTATICPIE:Uno} == "yes" 18 1.33 christos CFLAGS+=-fPIE 19 1.39 christos CRUNCHGEN_FLAGS+=-V LDSTATIC="-static -pie" 20 1.39 christos .else 21 1.39 christos CRUNCHGEN_FLAGS+=-V LDSTATIC="-static" -V NOPIE= 22 1.33 christos .endif 23 1.33 christos 24 1.39 christos CRUNCHGEN_FLAGS+=-V NOLIBCSANITIZER= -V NOSANITIZER= -V NOMAN= 25 1.39 christos 26 1.43 riastrad # libssh is private, so libssh.a is not installed in DESTDIR, so we 27 1.43 riastrad # have to get it out of the objdir. 28 1.43 riastrad # 29 1.43 riastrad # XXX Should do this differently, and uniformly for all libraries. 30 1.43 riastrad .if !defined(LIBDO.ssh) 31 1.43 riastrad LIBDO.ssh!= cd ${NETBSDSRCDIR}/crypto/external/bsd/openssh/lib && \ 32 1.43 riastrad ${PRINTOBJDIR} 33 1.43 riastrad .MAKEOVERRIDES+=LIBDO.ssh 34 1.43 riastrad .endif 35 1.43 riastrad CRUNCHGEN_FLAGS+=-L ${LIBDO.ssh} 36 1.43 riastrad 37 1.8 lukem RESCUEDIR= /rescue 38 1.1 lukem CRUNCHBIN= rescue 39 1.8 lukem CRUNCHENV= RESCUEDIR=${RESCUEDIR} 40 1.6 lukem SMALLPROG= 0 41 1.1 lukem LISTS= ${.CURDIR}/list 42 1.1 lukem TARGETDIR= ${DESTDIR}/rescue 43 1.1 lukem PARSELISTENV+= TARGETDIR=${TARGETDIR:Q} 44 1.1 lukem 45 1.28 martin .for f in pdisk 46 1.29 christos PROG_${f}!= cd ${NETBSDSRCDIR}/external/bsd/${f}/bin && ${MAKE} -V PROG 47 1.28 martin .if (${PROG_${f}} != "") 48 1.28 martin LISTS+= ${.CURDIR}/list.${f} 49 1.28 martin .endif 50 1.28 martin .endfor 51 1.28 martin 52 1.44 thorpej RESCUEFSLIST= adosfs cd9660fs efs ext2fs fdescfs filecorefs kernfs lfs \ 53 1.44 thorpej msdosfs nfs ntfs nullfs overlayfs procfs tmpfs umapfs unionfs 54 1.44 thorpej 55 1.44 thorpej .for f in ${RESCUEFSLIST} 56 1.44 thorpej .if (${MK${f:tu}} != "no") 57 1.44 thorpej LISTS+= ${.CURDIR}/list.${f} 58 1.44 thorpej .endif 59 1.44 thorpej .endfor 60 1.44 thorpej 61 1.12 lukem .if ${USE_INET6} != "no" 62 1.13 lukem LISTS+= ${.CURDIR}/list.inet6 63 1.12 lukem .endif 64 1.12 lukem 65 1.45 thorpej .if ${MKIPSEC} != "no" 66 1.45 thorpej LISTS+= ${.CURDIR}/list.ipsec 67 1.45 thorpej .endif 68 1.45 thorpej 69 1.14 lukem LISTS+= ${.CURDIR}/list.crypto 70 1.16 lukem CRUNCHENV+= MKKERBEROS=no # for ssh 71 1.14 lukem 72 1.22 mrg LISTS+= ${.CURDIR}/list.ldd 73 1.22 mrg LDD_ELF32DIR!= cd ${NETBSDSRCDIR}/usr.bin/ldd/elf32 && ${PRINTOBJDIR} 74 1.22 mrg LDD_ELF64DIR!= cd ${NETBSDSRCDIR}/usr.bin/ldd/elf64 && ${PRINTOBJDIR} 75 1.23 he PARSELISTENV+= LDD_ELF32DIR=${LDD_ELF32DIR} LDD_ELF64DIR=${LDD_ELF64DIR} 76 1.8 lukem 77 1.17 lukem # Specially built objects to override the behaviour of 78 1.17 lukem # various library functions 79 1.17 lukem # 80 1.17 lukem 81 1.41 christos OVERRIDEOBJS= rcmd.o 82 1.41 christos .PATH: ${NETBSDSRCDIR}/lib/libc/net 83 1.17 lukem CPPFLAGS.rcmd.c+=-I${NETBSDSRCDIR}/lib/libc/include -DRESCUEDIR=\"${RESCUEDIR}\" 84 1.17 lukem 85 1.17 lukem LIBOVERRIDE= liboverride.o 86 1.17 lukem ${LIBOVERRIDE}: ${OVERRIDEOBJS} 87 1.18 lukem ${_MKTARGET_LINK} 88 1.17 lukem ${LD} -r -o $@ ${OVERRIDEOBJS} 89 1.17 lukem 90 1.26 roy CLEANFILES+= ${OVERRIDEOBJS} ${LIBOVERRIDE} 91 1.17 lukem 92 1.17 lukem ${CRUNCHBIN}: ${LIBOVERRIDE} 93 1.17 lukem 94 1.17 lukem 95 1.17 lukem # The primary target ... 96 1.17 lukem # 97 1.17 lukem 98 1.9 tron CLEANFILES+= rescue.unstripped 99 1.1 lukem 100 1.1 lukem .include "${DISTRIBDIR}/common/Makefile.crunch" 101 1.1 lukem 102 1.26 roy realall: ${CRUNCHBIN} 103 1.1 lukem 104 1.1 lukem install: ${CRUNCHBIN} 105 1.19 lukem # XXX this MKMSG doesn't line up 106 1.15 lukem ${_MKMSG} "populate ${TARGETDIR}" 107 1.1 lukem ${PARSELIST} -v mode=install ${LISTS} | ${MAKE} -f - install 108 1.1 lukem 109 1.1 lukem .include <bsd.prog.mk> 110