2 # @(#)Makefile 8.1 (Berkeley) 6/2/93
14 # Shell scripts need #! line to be edited from /bin/sh to /rescue/sh
15 SCRIPTS= nextboot_FIXED
16 SCRIPTSNAME_nextboot_FIXED= nextboot
17 nextboot_FIXED: ../../sbin/reboot/nextboot.sh
18 sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
19 CLEANFILES+= nextboot_FIXED
21 SCRIPTS+= dhclient_FIXED
22 SCRIPTSNAME_dhclient_FIXED= dhclient-script
23 dhclient_FIXED: ../../sbin/dhclient/dhclient-script
24 sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
25 CLEANFILES+= dhclient_FIXED
27 # The help which used to be here is now in mk/bsd.crunchgen.mk
29 # Define Makefile variable RESCUE
30 CRUNCH_BUILDOPTS+= -DRESCUE
31 # Define compile-time RESCUE symbol when compiling components
32 CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE
34 # An experiment that failed: try overriding bsd.lib.mk and bsd.prog.mk
35 # rather than incorporating rescue-specific logic into standard files.
36 #MAKEFLAGS= -m ${.CURDIR} ${.MAKEFLAGS}
38 # Hackery: 'librescue' exists merely as a tool for appropriately
39 # recompiling specific library entries. We _know_ they're needed, and
40 # regular archive searching creates ugly library ordering problems.
41 # Easiest fix: tell the linker to include them into the executable
42 # first, so they are guaranteed to override the regular lib entries.
43 # Note that if 'librescue' hasn't been compiled, we'll just get the
44 # regular lib entries from libc and friends.
45 CRUNCH_LIBS+= ${.OBJDIR}/../librescue/*.o
47 ###################################################################
48 # Programs from stock /bin
50 # WARNING: Changing this list may require adjusting
51 # /usr/include/paths.h as well! You were warned!
54 CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \
55 ed expr getfacl hostname kenv kill ln ls mkdir mv \
56 pkill ps pwd realpath rm rmdir setfacl sh sleep stty \
58 CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -lelf -ltermcapw -lutil -lxo
59 CRUNCH_BUILDTOOLS+= bin/sh
61 # Additional options for specific programs
64 # The -sh alias shouldn't appear in /rescue as a hard link
65 CRUNCH_SUPPRESS_LINK_-sh= 1
67 CRUNCH_ALIAS_rm= unlink
69 CRUNCH_ALIAS_pkill= pgrep
71 .if ${MK_TCSH} != "no"
72 CRUNCH_PROGS_bin+= csh
73 CRUNCH_ALIAS_csh= -csh tcsh -tcsh
74 CRUNCH_BUILDTOOLS+= bin/csh
75 CRUNCH_SUPPRESS_LINK_-csh= 1
76 CRUNCH_SUPPRESS_LINK_-tcsh= 1
79 ###################################################################
80 # Programs from standard /sbin
82 # WARNING: Changing this list may require adjusting
83 # /usr/include/paths.h as well! You were warned!
85 # Note that mdmfs have their own private 'pathnames.h'
86 # headers in addition to the standard 'paths.h' header.
90 camcontrol clri devfs dmesg dump \
91 dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb \
92 fsirand gbde geom ifconfig init \
93 kldconfig kldload kldstat kldunload ldconfig \
94 md5 mdconfig mdmfs mknod mount mount_cd9660 \
95 mount_msdosfs mount_nfs mount_nullfs \
96 mount_udf mount_unionfs newfs \
97 newfs_msdos nos-tun ping reboot \
98 restore rcorder route savecore \
99 shutdown spppcontrol swapon sysctl tunefs umount
101 .if ${MK_CCD} != "no"
102 CRUNCH_PROGS_sbin+= ccdconfig
105 .if ${MK_INET6_SUPPORT} != "no"
106 CRUNCH_PROGS_sbin+= rtsol
109 .if ${MK_IPFILTER} != "no"
110 CRUNCH_PROGS_sbin+= ipf
111 CRUNCH_LIBS_ipf+= ${LIBIPF}
114 .if ${MK_ROUTED} != "no"
115 CRUNCH_PROGS_sbin+= routed rtquery
118 .if ${MK_ZFS} != "no"
119 CRUNCH_PROGS_sbin+= bectl
120 CRUNCH_PROGS_sbin+= zfs
121 CRUNCH_PROGS_sbin+= zpool
122 CRUNCH_PROGS_usr.sbin+= zdb
125 # crunchgen does not like C++ programs; this should be fixed someday
126 # CRUNCH_PROGS+= devd
128 CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma
129 .if ${MK_ZFS} != "no"
130 CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
131 CRUNCH_LIBS+= -lbe -lzfsbootenv -lzutil -ltpool -lspl -licp_rescue
133 # liblzma needs pthread
134 CRUNCH_LIBS+= -lpthread
136 CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv
137 .if ${MK_OPENSSL} == "no"
140 CRUNCH_LIBS+= -lmt -lsbuf -lufs -lz
142 .if ${MACHINE_CPUARCH} == "i386"
143 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
144 CRUNCH_ALIAS_bsdlabel= disklabel
145 #CRUNCH_PROGS+= mount_smbfs
149 .if ${MACHINE_CPUARCH} == "amd64"
150 CRUNCH_PROGS_sbin+= bsdlabel fdisk
151 CRUNCH_ALIAS_bsdlabel= disklabel
154 CRUNCH_SRCDIR_rtquery= ${SRCTOP}/sbin/routed/rtquery
155 CRUNCH_SRCDIR_ipf= ${SRCTOP}/sbin/ipf/ipf
156 .if ${MK_ZFS} != "no"
157 CRUNCH_SRCDIR_zfs= ${SRCTOP}/cddl/sbin/zfs
158 CRUNCH_SRCDIR_zpool= ${SRCTOP}/cddl/sbin/zpool
159 CRUNCH_SRCDIR_zdb= ${SRCTOP}/cddl/usr.sbin/zdb
161 CRUNCH_ALIAS_reboot= fastboot halt fasthalt
162 CRUNCH_ALIAS_restore= rrestore
163 CRUNCH_ALIAS_dump= rdump
164 CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
165 CRUNCH_ALIAS_geom= glabel gpart
166 CRUNCH_ALIAS_shutdown= poweroff
168 # dhclient has historically been troublesome...
169 CRUNCH_PROGS_sbin+= dhclient
171 ##################################################################
172 # Programs from stock /usr/bin
174 CRUNCH_SRCDIRS+= usr.bin
176 CRUNCH_PROGS_usr.bin= head mt sed tail tee
178 CRUNCH_PROGS_usr.bin+= gzip
179 CRUNCH_ALIAS_gzip= gunzip gzcat zcat
181 CRUNCH_PROGS_usr.bin+= bzip2
182 CRUNCH_ALIAS_bzip2= bunzip2 bzcat
185 CRUNCH_PROGS_usr.bin+= less
186 CRUNCH_ALIAS_less= more
188 CRUNCH_PROGS_usr.bin+= xz
189 CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
191 CRUNCH_PROGS_usr.bin+= zstd
192 CRUNCH_ALIAS_zstd= unzstd zstdcat zstdmt
193 CRUNCH_LIBS+= ${LDADD_zstd}
195 CRUNCH_PROGS_usr.bin+= tar
196 CRUNCH_LIBS+= -larchive
197 .if ${MK_OPENSSL} != "no"
198 CRUNCH_LIBS+= -lcrypto
202 .if ${MK_NETCAT} != "no"
203 CRUNCH_PROGS_usr.bin+= nc
207 CRUNCH_PROGS_usr.bin+= vi
211 CRUNCH_PROGS_usr.bin+= id
212 CRUNCH_ALIAS_id= groups whoami
214 ##################################################################
215 # Programs from stock /usr/sbin
217 CRUNCH_SRCDIRS+= usr.sbin
219 CRUNCH_PROGS_usr.sbin+= chroot
221 CRUNCH_PROGS_usr.sbin+= chown
222 CRUNCH_ALIAS_chown= chgrp
223 ##################################################################
225 CRUNCH_LIBS+= ${OBJTOP}/lib/libifconfig/libifconfig.a
226 CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS+=-I${OBJTOP}/lib/libifconfig
230 .if ${MK_ISCSI} != "no"
231 CRUNCH_PROGS_usr.bin+= iscsictl
232 CRUNCH_PROGS_usr.sbin+= iscsid
235 .include <bsd.crunchgen.mk>
236 .include <bsd.prog.mk>