2 # @(#)Makefile 8.1 (Berkeley) 6/2/93
13 # Shell scripts need #! line to be edited from /bin/sh to /rescue/sh
14 SCRIPTS= nextboot_FIXED
15 SCRIPTSNAME_nextboot_FIXED= nextboot
16 nextboot_FIXED: ../../sbin/reboot/nextboot.sh
17 sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
18 CLEANFILES+= nextboot_FIXED
20 SCRIPTS+= dhclient_FIXED
21 SCRIPTSNAME_dhclient_FIXED= dhclient-script
22 dhclient_FIXED: ../../sbin/dhclient/dhclient-script
23 sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
24 CLEANFILES+= dhclient_FIXED
26 # The help which used to be here is now in mk/bsd.crunchgen.mk
28 # Define Makefile variable RESCUE
29 CRUNCH_BUILDOPTS+= -DRESCUE
30 # Define compile-time RESCUE symbol when compiling components
31 CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE
33 # An experiment that failed: try overriding bsd.lib.mk and bsd.prog.mk
34 # rather than incorporating rescue-specific logic into standard files.
35 #MAKEFLAGS= -m ${.CURDIR} ${.MAKEFLAGS}
37 # Hackery: 'librescue' exists merely as a tool for appropriately
38 # recompiling specific library entries. We _know_ they're needed, and
39 # regular archive searching creates ugly library ordering problems.
40 # Easiest fix: tell the linker to include them into the executable
41 # first, so they are guaranteed to override the regular lib entries.
42 # Note that if 'librescue' hasn't been compiled, we'll just get the
43 # regular lib entries from libc and friends.
44 CRUNCH_LIBS+= ${.OBJDIR}/../librescue/*.o
46 ###################################################################
47 # Programs from stock /bin
49 # WARNING: Changing this list may require adjusting
50 # /usr/include/paths.h as well! You were warned!
53 CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \
54 ed expr getfacl hostname kenv kill ln ls mkdir mv \
55 pkill ps pwd realpath rm rmdir setfacl sh sleep stty \
57 CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -lelf -ll -ltermcapw -lutil -lxo
58 CRUNCH_BUILDTOOLS+= bin/sh
60 # Additional options for specific programs
63 # The -sh alias shouldn't appear in /rescue as a hard link
64 CRUNCH_SUPPRESS_LINK_-sh= 1
66 CRUNCH_ALIAS_rm= unlink
68 CRUNCH_ALIAS_pkill= pgrep
70 .if ${MK_RCMDS} != "no"
71 CRUNCH_PROGS_bin+= rcp
74 .if ${MK_TCSH} != "no"
75 CRUNCH_PROGS_bin+= csh
76 CRUNCH_ALIAS_csh= -csh tcsh -tcsh
77 CRUNCH_BUILDTOOLS+= bin/csh
78 CRUNCH_SUPPRESS_LINK_-csh= 1
79 CRUNCH_SUPPRESS_LINK_-tcsh= 1
82 ###################################################################
83 # Programs from standard /sbin
85 # WARNING: Changing this list may require adjusting
86 # /usr/include/paths.h as well! You were warned!
88 # Note that mdmfs have their own private 'pathnames.h'
89 # headers in addition to the standard 'paths.h' header.
92 CRUNCH_PROGS_sbin= badsect \
93 camcontrol ccdconfig clri devfs dmesg dump \
94 dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb \
95 fsirand gbde geom ifconfig init \
96 kldconfig kldload kldstat kldunload ldconfig \
97 md5 mdconfig mdmfs mknod mount mount_cd9660 \
98 mount_msdosfs mount_nfs mount_nullfs \
99 mount_udf mount_unionfs newfs \
100 newfs_msdos nos-tun ping reboot \
101 restore rcorder route routed rtquery rtsol savecore \
102 spppcontrol swapon sysctl tunefs umount
104 .if ${MK_ATM} != "no"
105 CRUNCH_PROGS_sbin+= atmconfig
108 .if ${MK_INET6_SUPPORT} != "no"
109 CRUNCH_PROGS_sbin+= ping6
112 .if ${MK_IPFILTER} != "no"
113 CRUNCH_PROGS_sbin+= ipf
115 .if ${MK_ZFS} != "no"
116 CRUNCH_PROGS_sbin+= zfs
117 CRUNCH_PROGS_sbin+= zpool
118 CRUNCH_PROGS_usr.sbin+= zdb
121 # crunchgen does not like C++ programs; this should be fixed someday
122 # CRUNCH_PROGS+= devd
124 CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma
125 .if ${MK_ZFS} != "no"
126 CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
128 # liblzma needs pthread
129 CRUNCH_LIBS+= -lpthread
131 CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv
132 .if ${MK_OPENSSL} == "no"
135 CRUNCH_LIBS+= -lmt -lsbuf -lufs -lz
137 .if ${MACHINE_CPUARCH} == "i386"
138 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
139 CRUNCH_ALIAS_bsdlabel= disklabel
140 #CRUNCH_PROGS+= mount_smbfs
144 .if ${MACHINE_CPUARCH} == "sparc64"
145 CRUNCH_PROGS_sbin+= bsdlabel sunlabel
148 .if ${MACHINE_CPUARCH} == "amd64"
149 CRUNCH_PROGS_sbin+= bsdlabel fdisk
150 CRUNCH_ALIAS_bsdlabel= disklabel
153 CRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm
154 CRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig
155 CRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld
156 CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
157 CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
158 CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
159 .if ${MK_ZFS} != "no"
160 CRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
161 CRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
162 CRUNCH_SRCDIR_zdb= ${.CURDIR}/../../cddl/usr.sbin/zdb
164 CRUNCH_ALIAS_reboot= fastboot halt fasthalt
165 CRUNCH_ALIAS_restore= rrestore
166 CRUNCH_ALIAS_dump= rdump
167 CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
168 CRUNCH_ALIAS_geom= glabel gpart
170 # dhclient has historically been troublesome...
171 CRUNCH_PROGS_sbin+= dhclient
172 CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
174 ##################################################################
175 # Programs from stock /usr/bin
177 CRUNCH_SRCDIRS+= usr.bin
179 CRUNCH_PROGS_usr.bin= head mt nc sed tail tee
181 CRUNCH_PROGS_usr.bin+= gzip
182 CRUNCH_ALIAS_gzip= gunzip gzcat zcat
184 CRUNCH_PROGS_usr.bin+= bzip2
185 CRUNCH_ALIAS_bzip2= bunzip2 bzcat
188 CRUNCH_PROGS_usr.bin+= less
189 CRUNCH_ALIAS_less= more
191 CRUNCH_PROGS_usr.bin+= xz
192 CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
194 CRUNCH_PROGS_usr.bin+= tar
195 CRUNCH_LIBS+= -larchive
196 .if ${MK_OPENSSL} != "no"
197 CRUNCH_LIBS+= -lcrypto
202 CRUNCH_PROGS_usr.bin+= vi
206 CRUNCH_PROGS_usr.bin+= id
207 CRUNCH_ALIAS_id= groups whoami
209 ##################################################################
210 # Programs from stock /usr/sbin
212 CRUNCH_SRCDIRS+= usr.sbin
214 CRUNCH_PROGS_usr.sbin+= chroot
216 CRUNCH_PROGS_usr.sbin+= chown
217 CRUNCH_ALIAS_chown= chgrp
218 ##################################################################
221 .if ${MK_ISCSI} != "no"
222 CRUNCH_PROGS_usr.bin+= iscsictl
223 CRUNCH_PROGS_usr.sbin+= iscsid
226 .include <bsd.crunchgen.mk>
227 .include <bsd.prog.mk>