]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - rescue/rescue/Makefile
MFC r270189:
[FreeBSD/stable/10.git] / rescue / rescue / Makefile
1 #$FreeBSD$
2 #       @(#)Makefile    8.1 (Berkeley) 6/2/93
3
4 NO_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 stty sync test
55 CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil
56 CRUNCH_BUILDTOOLS+= bin/sh
57
58 # Additional options for specific programs
59 CRUNCH_ALIAS_test= [
60 CRUNCH_ALIAS_sh= -sh
61 # The -sh alias shouldn't appear in /rescue as a hard link
62 CRUNCH_SUPPRESS_LINK_-sh= 1
63 CRUNCH_ALIAS_ln= link
64 CRUNCH_ALIAS_rm= unlink
65 CRUNCH_ALIAS_ed= red
66 CRUNCH_ALIAS_pkill= pgrep
67
68 .if ${MK_RCMDS} != "no"
69 CRUNCH_PROGS_bin+= rcp
70 .endif
71
72 .if ${MK_TCSH} != "no"
73 CRUNCH_PROGS_bin+= csh
74 CRUNCH_ALIAS_csh= -csh tcsh -tcsh
75 CRUNCH_BUILDTOOLS+= bin/csh
76 CRUNCH_SUPPRESS_LINK_-csh= 1
77 CRUNCH_SUPPRESS_LINK_-tcsh= 1
78 .endif
79
80 ###################################################################
81 # Programs from standard /sbin
82 #
83 # WARNING: Changing this list may require adjusting
84 # /usr/include/paths.h as well!  You were warned!
85 #
86 # Note that mdmfs have their own private 'pathnames.h'
87 # headers in addition to the standard 'paths.h' header.
88 #
89 CRUNCH_SRCDIRS+= sbin
90 CRUNCH_PROGS_sbin= badsect                                      \
91         camcontrol ccdconfig clri devfs dmesg dump              \
92         dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb           \
93         fsirand gbde geom ifconfig init                         \
94         kldconfig kldload kldstat kldunload ldconfig            \
95         md5 mdconfig mdmfs mknod mount mount_cd9660             \
96         mount_msdosfs mount_nfs mount_nullfs                    \
97         mount_udf mount_unionfs newfs                           \
98         newfs_msdos nos-tun ping reboot                         \
99         restore rcorder route routed rtquery rtsol savecore     \
100         spppcontrol swapon sysctl tunefs umount
101
102 .if ${MK_ATM} != "no"
103 CRUNCH_PROGS_sbin+= atmconfig
104 .endif
105
106 .if ${MK_INET6_SUPPORT} != "no"
107 CRUNCH_PROGS_sbin+= ping6
108 .endif
109
110 .if ${MK_IPFILTER} != "no"
111 CRUNCH_PROGS_sbin+= ipf
112 .endif
113 .if ${MK_ZFS} != "no"
114 CRUNCH_PROGS_sbin+= zfs
115 CRUNCH_PROGS_sbin+= zpool
116 CRUNCH_PROGS_usr.sbin+= zdb
117 .endif
118
119 # crunchgen does not like C++ programs; this should be fixed someday
120 # CRUNCH_PROGS+= devd
121
122 CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec
123 .if ${MK_IPX} != "no"
124 CRUNCH_LIBS+= -lipx
125 .endif
126 .if ${MK_ZFS} != "no"
127 CRUNCH_LIBS+= -lavl -lzpool -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
128 .endif
129 CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv
130 .if ${MK_OPENSSL} == "no"
131 CRUNCH_LIBS+= -lmd
132 .endif
133 CRUNCH_LIBS+= -lsbuf -lufs -lz
134
135 .if ${MACHINE_CPUARCH} == "i386"
136 CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
137 CRUNCH_ALIAS_bsdlabel= disklabel
138 #CRUNCH_PROGS+= mount_smbfs
139 #CRUNCH_LIBS+= -lsmb
140 .endif
141
142 .if ${MACHINE} == "pc98"
143 CRUNCH_PROGS_sbin+= bsdlabel
144 CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
145 .endif
146
147 .if ${MACHINE_CPUARCH} == "ia64"
148 CRUNCH_PROGS_sbin+= mca
149 .endif
150
151 .if ${MACHINE_CPUARCH} == "sparc64"
152 CRUNCH_PROGS_sbin+= bsdlabel sunlabel
153 .endif
154
155 .if ${MACHINE_CPUARCH} == "amd64"
156 CRUNCH_PROGS_sbin+= bsdlabel fdisk
157 CRUNCH_ALIAS_bsdlabel= disklabel
158 .endif
159
160 CRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm
161 CRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig
162 CRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld
163 CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
164 CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
165 CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
166 .if ${MK_ZFS} != "no"
167 CRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
168 CRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
169 CRUNCH_SRCDIR_zdb= ${.CURDIR}/../../cddl/usr.sbin/zdb
170 .endif
171 CRUNCH_ALIAS_reboot= fastboot halt fasthalt
172 CRUNCH_ALIAS_restore= rrestore
173 CRUNCH_ALIAS_dump= rdump
174 CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
175 CRUNCH_ALIAS_geom= glabel gpart
176
177 # dhclient has historically been troublesome...
178 CRUNCH_PROGS_sbin+= dhclient
179 CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
180
181 ##################################################################
182 # Programs from stock /usr/bin
183 #
184 CRUNCH_SRCDIRS+= usr.bin
185
186 CRUNCH_PROGS_usr.bin= head mt nc sed tail tee
187
188 CRUNCH_PROGS_usr.bin+= gzip
189 CRUNCH_ALIAS_gzip= gunzip gzcat zcat
190
191 CRUNCH_PROGS_usr.bin+= bzip2
192 CRUNCH_ALIAS_bzip2= bunzip2 bzcat
193 CRUNCH_LIBS+= -lbz2
194
195 CRUNCH_PROGS_usr.bin+= less
196 CRUNCH_ALIAS_less= more
197
198 CRUNCH_PROGS_usr.bin+= xz
199 CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
200 CRUNCH_LIBS+= -llzma
201
202 CRUNCH_PROGS_usr.bin+= tar
203 CRUNCH_LIBS+= -larchive
204 .if ${MK_OPENSSL} != "no"
205 CRUNCH_LIBS+= -lcrypto
206 .endif
207 CRUNCH_LIBS+= -lmd
208
209 CRUNCH_PROGS_usr.bin+= vi
210 CRUNCH_ALIAS_vi= ex
211
212 CRUNCH_PROGS_usr.bin+= id
213 CRUNCH_ALIAS_id= groups whoami
214
215 ##################################################################
216 # Programs from stock /usr/sbin
217 #
218 CRUNCH_SRCDIRS+= usr.sbin
219
220 CRUNCH_PROGS_usr.sbin+= chroot
221
222 CRUNCH_PROGS_usr.sbin+= chown
223 CRUNCH_ALIAS_chown= chgrp
224 ##################################################################
225 CRUNCH_LIBS+= -lm
226
227 .include <bsd.crunchgen.mk>
228 .include <bsd.prog.mk>