]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - rescue/rescue/Makefile
MFC r314240:
[FreeBSD/stable/10.git] / rescue / rescue / Makefile
1 #$FreeBSD$
2 #       @(#)Makefile    8.1 (Berkeley) 6/2/93
3
4 MAN=
5
6 .include <bsd.own.mk>
7 MK_SSP= no
8
9 PROG=   rescue
10 BINDIR?=/rescue
11
12 # Shell scripts need #! line to be edited from /bin/sh to /rescue/sh
13 SCRIPTS= nextboot_FIXED
14 SCRIPTSNAME_nextboot_FIXED= nextboot
15 nextboot_FIXED: ../../sbin/reboot/nextboot.sh
16         sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
17 CLEANFILES+= nextboot_FIXED
18
19 SCRIPTS+= dhclient_FIXED
20 SCRIPTSNAME_dhclient_FIXED= dhclient-script
21 dhclient_FIXED: ../../sbin/dhclient/dhclient-script
22         sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
23 CLEANFILES+= dhclient_FIXED
24
25 # The help which used to be here is now in mk/bsd.crunchgen.mk
26
27 # Define Makefile variable RESCUE
28 CRUNCH_BUILDOPTS+= -DRESCUE
29 # Define compile-time RESCUE symbol when compiling components
30 CRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE
31
32 # An experiment that failed: try overriding bsd.lib.mk and bsd.prog.mk
33 # rather than incorporating rescue-specific logic into standard files.
34 #MAKEFLAGS= -m ${.CURDIR} ${.MAKEFLAGS}
35
36 # Hackery:  'librescue' exists merely as a tool for appropriately
37 # recompiling specific library entries.  We _know_ they're needed, and
38 # regular archive searching creates ugly library ordering problems.
39 # Easiest fix: tell the linker to include them into the executable
40 # first, so they are guaranteed to override the regular lib entries.
41 # Note that if 'librescue' hasn't been compiled, we'll just get the
42 # regular lib entries from libc and friends.
43 CRUNCH_LIBS+= ${.OBJDIR}/../librescue/*.o
44
45 ###################################################################
46 # Programs from stock /bin
47 #
48 # WARNING: Changing this list may require adjusting
49 # /usr/include/paths.h as well!  You were warned!
50 #
51 CRUNCH_SRCDIRS+= bin
52 CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo     \
53          ed expr getfacl hostname kenv kill ln ls mkdir mv      \
54          pkill ps pwd realpath rm rmdir setfacl sh sleep stty   \
55          sync test
56 CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil
57 CRUNCH_BUILDTOOLS+= bin/sh
58
59 # Additional options for specific programs
60 CRUNCH_ALIAS_test= [
61 CRUNCH_ALIAS_sh= -sh
62 # The -sh alias shouldn't appear in /rescue as a hard link
63 CRUNCH_SUPPRESS_LINK_-sh= 1
64 CRUNCH_ALIAS_ln= link
65 CRUNCH_ALIAS_rm= unlink
66 CRUNCH_ALIAS_ed= red
67 CRUNCH_ALIAS_pkill= pgrep
68
69 .if ${MK_RCMDS} != "no"
70 CRUNCH_PROGS_bin+= rcp
71 .endif
72
73 .if ${MK_TCSH} != "no"
74 CRUNCH_PROGS_bin+= csh
75 CRUNCH_ALIAS_csh= -csh tcsh -tcsh
76 CRUNCH_BUILDTOOLS+= bin/csh
77 CRUNCH_SUPPRESS_LINK_-csh= 1
78 CRUNCH_SUPPRESS_LINK_-tcsh= 1
79 .endif
80
81 ###################################################################
82 # Programs from standard /sbin
83 #
84 # WARNING: Changing this list may require adjusting
85 # /usr/include/paths.h as well!  You were warned!
86 #
87 # Note that mdmfs have their own private 'pathnames.h'
88 # headers in addition to the standard 'paths.h' header.
89 #
90 CRUNCH_SRCDIRS+= sbin
91 CRUNCH_PROGS_sbin= badsect                                      \
92         camcontrol clri devfs dmesg dump                        \
93         dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb           \
94         fsirand gbde geom ifconfig init                         \
95         kldconfig kldload kldstat kldunload ldconfig            \
96         md5 mdconfig mdmfs mknod mount mount_cd9660             \
97         mount_msdosfs mount_nfs mount_nullfs                    \
98         mount_udf mount_unionfs newfs                           \
99         newfs_msdos nos-tun ping reboot                         \
100         restore rcorder route rtsol savecore                    \
101         spppcontrol swapon sysctl tunefs umount
102
103 .if ${MK_ATM} != "no"
104 CRUNCH_PROGS_sbin+= atmconfig
105 .endif
106
107 .if ${MK_CCD} != "no"
108 CRUNCH_PROGS_sbin+= ccdconfig
109 .endif
110
111 .if ${MK_INET6_SUPPORT} != "no"
112 CRUNCH_PROGS_sbin+= ping6
113 .endif
114
115 .if ${MK_IPFILTER} != "no"
116 CRUNCH_PROGS_sbin+= ipf
117 .endif
118
119 .if ${MK_ROUTED} != "no"
120 CRUNCH_PROGS_sbin+= routed rtquery
121 .endif
122
123 .if ${MK_ZFS} != "no"
124 CRUNCH_PROGS_sbin+= zfs
125 CRUNCH_PROGS_sbin+= zpool
126 CRUNCH_PROGS_usr.sbin+= zdb
127 .endif
128
129 # crunchgen does not like C++ programs; this should be fixed someday
130 # CRUNCH_PROGS+= devd
131
132 CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec -llzma
133 .if ${MK_IPX} != "no"
134 CRUNCH_LIBS+= -lipx
135 .endif
136 .if ${MK_ZFS} != "no"
137 CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
138 .else
139 # liblzma needs pthread
140 CRUNCH_LIBS+= -lpthread
141 .endif
142 CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv
143 .if ${MK_OPENSSL} == "no"
144 CRUNCH_LIBS+= -lmd
145 .endif
146 CRUNCH_LIBS+= -lmt -lsbuf -lufs -lz
147
148 .if ${MACHINE_CPUARCH} == "i386"
149 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
150 CRUNCH_ALIAS_bsdlabel= disklabel
151 #CRUNCH_PROGS+= mount_smbfs
152 #CRUNCH_LIBS+= -lsmb
153 .endif
154
155 .if ${MACHINE} == "pc98"
156 CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
157 .endif
158
159 .if ${MACHINE_CPUARCH} == "ia64"
160 CRUNCH_PROGS_sbin+= mca
161 .endif
162
163 .if ${MACHINE_CPUARCH} == "sparc64"
164 CRUNCH_PROGS_sbin+= bsdlabel sunlabel
165 .endif
166
167 .if ${MACHINE_CPUARCH} == "amd64"
168 CRUNCH_PROGS_sbin+= bsdlabel fdisk
169 CRUNCH_ALIAS_bsdlabel= disklabel
170 .endif
171
172 CRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm
173 CRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig
174 CRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld
175 CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
176 CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
177 CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
178 .if ${MK_ZFS} != "no"
179 CRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
180 CRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
181 CRUNCH_SRCDIR_zdb= ${.CURDIR}/../../cddl/usr.sbin/zdb
182 .endif
183 CRUNCH_ALIAS_reboot= fastboot halt fasthalt
184 CRUNCH_ALIAS_restore= rrestore
185 CRUNCH_ALIAS_dump= rdump
186 CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
187 CRUNCH_ALIAS_geom= glabel gpart
188
189 # dhclient has historically been troublesome...
190 CRUNCH_PROGS_sbin+= dhclient
191 CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
192
193 ##################################################################
194 # Programs from stock /usr/bin
195 #
196 CRUNCH_SRCDIRS+= usr.bin
197
198 CRUNCH_PROGS_usr.bin= head mt nc sed tail tee
199
200 CRUNCH_PROGS_usr.bin+= gzip
201 CRUNCH_ALIAS_gzip= gunzip gzcat zcat
202
203 CRUNCH_PROGS_usr.bin+= bzip2
204 CRUNCH_ALIAS_bzip2= bunzip2 bzcat
205 CRUNCH_LIBS+= -lbz2
206
207 CRUNCH_PROGS_usr.bin+= less
208 CRUNCH_ALIAS_less= more
209
210 CRUNCH_PROGS_usr.bin+= xz
211 CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
212
213 CRUNCH_PROGS_usr.bin+= tar
214 CRUNCH_LIBS+= -larchive
215 .if ${MK_OPENSSL} != "no"
216 CRUNCH_LIBS+= -lcrypto
217 .endif
218 CRUNCH_LIBS+= -lmd
219
220 CRUNCH_PROGS_usr.bin+= vi
221 CRUNCH_ALIAS_vi= ex
222
223 CRUNCH_PROGS_usr.bin+= id
224 CRUNCH_ALIAS_id= groups whoami
225
226 ##################################################################
227 # Programs from stock /usr/sbin
228 #
229 CRUNCH_SRCDIRS+= usr.sbin
230
231 CRUNCH_PROGS_usr.sbin+= chroot
232
233 CRUNCH_PROGS_usr.sbin+= chown
234 CRUNCH_ALIAS_chown= chgrp
235 ##################################################################
236 CRUNCH_LIBS+= -lm
237
238 .if ${MK_ISCSI} != "no"
239 CRUNCH_PROGS_usr.bin+=  iscsictl
240 CRUNCH_PROGS_usr.sbin+= iscsid
241 .endif
242
243 .include <bsd.crunchgen.mk>
244 .include <bsd.prog.mk>