]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - rescue/rescue/Makefile
Update our copy of DTS from the ones from Linux 4.14
[FreeBSD/FreeBSD.git] / rescue / rescue / Makefile
1 #$FreeBSD$
2 #       @(#)Makefile    8.1 (Berkeley) 6/2/93
3
4 .include <src.opts.mk>
5
6 PACKAGE=rescue
7 MAN=
8 MK_SSP= no
9
10 PROG=   rescue
11 BINDIR?=/rescue
12
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
19
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
25
26 # The help which used to be here is now in mk/bsd.crunchgen.mk
27
28 # Define Makefile variable RESCUE
29 CRUNCH_BUILDOPTS+= -DRESCUE
30 # Define compile-time RESCUE symbol when compiling components
31 CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE
32
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}
36
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
45
46 ###################################################################
47 # Programs from stock /bin
48 #
49 # WARNING: Changing this list may require adjusting
50 # /usr/include/paths.h as well!  You were warned!
51 #
52 CRUNCH_SRCDIRS+= bin
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   \
56          sync test
57 CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -lelf -ll -ltermcapw -lutil -lxo
58 CRUNCH_BUILDTOOLS+= bin/sh
59
60 # Additional options for specific programs
61 CRUNCH_ALIAS_test= [
62 CRUNCH_ALIAS_sh= -sh
63 # The -sh alias shouldn't appear in /rescue as a hard link
64 CRUNCH_SUPPRESS_LINK_-sh= 1
65 CRUNCH_ALIAS_ln= link
66 CRUNCH_ALIAS_rm= unlink
67 CRUNCH_ALIAS_ed= red
68 CRUNCH_ALIAS_pkill= pgrep
69
70 .if ${MK_TCSH} != "no"
71 CRUNCH_PROGS_bin+= csh
72 CRUNCH_ALIAS_csh= -csh tcsh -tcsh
73 CRUNCH_BUILDTOOLS+= bin/csh
74 CRUNCH_SUPPRESS_LINK_-csh= 1
75 CRUNCH_SUPPRESS_LINK_-tcsh= 1
76 .endif
77
78 ###################################################################
79 # Programs from standard /sbin
80 #
81 # WARNING: Changing this list may require adjusting
82 # /usr/include/paths.h as well!  You were warned!
83 #
84 # Note that mdmfs have their own private 'pathnames.h'
85 # headers in addition to the standard 'paths.h' header.
86 #
87 CRUNCH_SRCDIRS+= sbin
88 CRUNCH_PROGS_sbin=                                              \
89         camcontrol clri devfs dmesg dump                        \
90         dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb           \
91         fsirand gbde geom ifconfig init                         \
92         kldconfig kldload kldstat kldunload ldconfig            \
93         md5 mdconfig mdmfs mknod mount mount_cd9660             \
94         mount_msdosfs mount_nfs mount_nullfs                    \
95         mount_udf mount_unionfs newfs                           \
96         newfs_msdos nos-tun ping reboot                         \
97         restore rcorder route savecore                          \
98         shutdown spppcontrol swapon sysctl tunefs umount
99
100 .if ${MK_CCD} != "no"
101 CRUNCH_PROGS_sbin+= ccdconfig
102 .endif
103
104 .if ${MK_INET6_SUPPORT} != "no"
105 CRUNCH_PROGS_sbin+= ping6
106 CRUNCH_PROGS_sbin+= rtsol
107 .endif
108
109 .if ${MK_IPFILTER} != "no"
110 CRUNCH_PROGS_sbin+= ipf
111 CRUNCH_LIBS_ipf+=       ${LIBIPF}
112 .endif
113
114 .if ${MK_ROUTED} != "no"
115 CRUNCH_PROGS_sbin+= routed rtquery
116 .endif
117
118 .if ${MK_ZFS} != "no"
119 CRUNCH_PROGS_sbin+= zfs
120 CRUNCH_PROGS_sbin+= zpool
121 CRUNCH_PROGS_usr.sbin+= zdb
122 .endif
123
124 # crunchgen does not like C++ programs; this should be fixed someday
125 # CRUNCH_PROGS+= devd
126
127 CRUNCH_LIBS+= -l80211 -lalias -lcam -lncursesw -ldevstat -lipsec -llzma
128 .if ${MK_ZFS} != "no"
129 CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
130 .else
131 # liblzma needs pthread
132 CRUNCH_LIBS+= -lpthread
133 .endif
134 CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv
135 .if ${MK_OPENSSL} == "no"
136 CRUNCH_LIBS+= -lmd
137 .endif
138 CRUNCH_LIBS+= -lmt -lsbuf -lufs -lz
139
140 .if ${MACHINE_CPUARCH} == "i386"
141 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
142 CRUNCH_ALIAS_bsdlabel= disklabel
143 #CRUNCH_PROGS+= mount_smbfs
144 #CRUNCH_LIBS+= -lsmb
145 .endif
146
147 .if ${MACHINE_CPUARCH} == "sparc64"
148 CRUNCH_PROGS_sbin+= bsdlabel sunlabel
149 .endif
150
151 .if ${MACHINE_CPUARCH} == "amd64"
152 CRUNCH_PROGS_sbin+= bsdlabel fdisk
153 CRUNCH_ALIAS_bsdlabel= disklabel
154 .endif
155
156 CRUNCH_SRCDIR_rtquery= ${SRCTOP}/sbin/routed/rtquery
157 CRUNCH_SRCDIR_ipf= ${SRCTOP}/sbin/ipf/ipf
158 .if ${MK_ZFS} != "no"
159 CRUNCH_SRCDIR_zfs= ${SRCTOP}/cddl/sbin/zfs
160 CRUNCH_SRCDIR_zpool= ${SRCTOP}/cddl/sbin/zpool
161 CRUNCH_SRCDIR_zdb= ${SRCTOP}/cddl/usr.sbin/zdb
162 .endif
163 CRUNCH_ALIAS_reboot= fastboot halt fasthalt
164 CRUNCH_ALIAS_restore= rrestore
165 CRUNCH_ALIAS_dump= rdump
166 CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
167 CRUNCH_ALIAS_geom= glabel gpart
168 CRUNCH_ALIAS_shutdown= poweroff
169
170 # dhclient has historically been troublesome...
171 CRUNCH_PROGS_sbin+= dhclient
172 CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
173
174 ##################################################################
175 # Programs from stock /usr/bin
176 #
177 CRUNCH_SRCDIRS+= usr.bin
178
179 CRUNCH_PROGS_usr.bin= head mt sed tail tee
180
181 CRUNCH_PROGS_usr.bin+= gzip
182 CRUNCH_ALIAS_gzip= gunzip gzcat zcat
183
184 CRUNCH_PROGS_usr.bin+= bzip2
185 CRUNCH_ALIAS_bzip2= bunzip2 bzcat
186 CRUNCH_LIBS+= -lbz2
187
188 CRUNCH_PROGS_usr.bin+= less
189 CRUNCH_ALIAS_less= more
190
191 CRUNCH_PROGS_usr.bin+= xz
192 CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
193
194 CRUNCH_PROGS_usr.bin+= zstd
195 CRUNCH_ALIAS_zstd= unzstd zstdcat zstdmt
196 CRUNCH_LIBS+=   ${LDADD_zstd}
197
198 CRUNCH_PROGS_usr.bin+= tar
199 CRUNCH_LIBS+= -larchive
200 .if ${MK_OPENSSL} != "no"
201 CRUNCH_LIBS+= -lcrypto
202 .endif
203 CRUNCH_LIBS+= -lmd
204
205 .if ${MK_NETCAT} != "no"
206 CRUNCH_PROGS_usr.bin+=  nc
207 .endif
208
209 .if ${MK_VI} != "no"
210 CRUNCH_PROGS_usr.bin+= vi
211 CRUNCH_ALIAS_vi= ex
212 .endif
213
214 CRUNCH_PROGS_usr.bin+= id
215 CRUNCH_ALIAS_id= groups whoami
216
217 ##################################################################
218 # Programs from stock /usr/sbin
219 #
220 CRUNCH_SRCDIRS+= usr.sbin
221
222 CRUNCH_PROGS_usr.sbin+= chroot
223
224 CRUNCH_PROGS_usr.sbin+= chown
225 CRUNCH_ALIAS_chown= chgrp
226 ##################################################################
227 CRUNCH_LIBS+= -lm
228
229 .if ${MK_ISCSI} != "no"
230 CRUNCH_PROGS_usr.bin+=  iscsictl
231 CRUNCH_PROGS_usr.sbin+= iscsid
232 .endif
233
234 .include <bsd.crunchgen.mk>
235 .include <bsd.prog.mk>