Makefile revision 248571
1#$FreeBSD: head/rescue/rescue/Makefile 248571 2013-03-21 08:38:03Z mm $
2#	@(#)Makefile	8.1 (Berkeley) 6/2/93
3
4NO_MAN=
5
6.include <bsd.own.mk>
7MK_SSP=	no
8
9PROG=	rescue
10BINDIR?=/rescue
11
12# Shell scripts need #! line to be edited from /bin/sh to /rescue/sh
13SCRIPTS= nextboot_FIXED
14SCRIPTSNAME_nextboot_FIXED= nextboot
15nextboot_FIXED: ../../sbin/reboot/nextboot.sh
16	sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
17CLEANFILES+= nextboot_FIXED
18
19SCRIPTS+= dhclient_FIXED
20SCRIPTSNAME_dhclient_FIXED= dhclient-script
21dhclient_FIXED: ../../sbin/dhclient/dhclient-script
22	sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
23CLEANFILES+= dhclient_FIXED
24
25# The help which used to be here is now in mk/bsd.crunchgen.mk
26
27# Define Makefile variable RESCUE
28CRUNCH_BUILDOPTS+= -DRESCUE
29# Define compile-time RESCUE symbol when compiling components
30CRUNCH_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.
43CRUNCH_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#
51CRUNCH_SRCDIRS+= bin
52CRUNCH_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
55CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
56CRUNCH_BUILDTOOLS+= bin/sh
57
58# Additional options for specific programs
59CRUNCH_ALIAS_test= [
60CRUNCH_ALIAS_sh= -sh
61# The -sh alias shouldn't appear in /rescue as a hard link
62CRUNCH_SUPPRESS_LINK_-sh= 1
63CRUNCH_ALIAS_ln= link
64CRUNCH_ALIAS_rm= unlink
65CRUNCH_ALIAS_ed= red
66CRUNCH_ALIAS_pkill= pgrep
67
68.if ${MK_RCMDS} != "no"
69CRUNCH_PROGS_bin+= rcp
70.endif
71
72.if ${MK_TCSH} != "no"
73CRUNCH_PROGS_bin+= csh
74CRUNCH_ALIAS_csh= -csh tcsh -tcsh
75CRUNCH_BUILDTOOLS+= bin/csh
76CRUNCH_SUPPRESS_LINK_-csh= 1
77CRUNCH_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#
89CRUNCH_SRCDIRS+= sbin
90CRUNCH_PROGS_sbin= atacontrol 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"
103CRUNCH_PROGS_sbin+= atmconfig
104.endif
105
106.if ${MK_INET6_SUPPORT} != "no"
107CRUNCH_PROGS_sbin+= ping6
108.endif
109
110.if ${MK_IPFILTER} != "no"
111CRUNCH_PROGS_sbin+= ipf
112.endif
113.if ${MK_ZFS} != "no"
114CRUNCH_PROGS_sbin+= zfs
115CRUNCH_PROGS_sbin+= zpool
116.endif
117
118# crunchgen does not like C++ programs; this should be fixed someday
119# CRUNCH_PROGS+= devd
120
121CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec
122.if ${MK_IPX} != "no"
123CRUNCH_LIBS+= -lipx
124.endif
125.if ${MK_ZFS} != "no"
126CRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
127.endif
128CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz
129
130.if ${MACHINE_CPUARCH} == "i386"
131CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
132CRUNCH_ALIAS_bsdlabel= disklabel
133.endif
134
135.if ${MACHINE} == "pc98"
136CRUNCH_PROGS_sbin+= bsdlabel
137CRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
138.endif
139
140.if ${MACHINE_CPUARCH} == "ia64"
141CRUNCH_PROGS_sbin+= mca
142.endif
143
144.if ${MACHINE_CPUARCH} == "sparc64"
145CRUNCH_PROGS_sbin+= bsdlabel sunlabel
146.endif
147
148.if ${MACHINE_CPUARCH} == "amd64"
149CRUNCH_PROGS_sbin+= bsdlabel fdisk
150CRUNCH_ALIAS_bsdlabel= disklabel
151.endif
152
153CRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm
154CRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig
155CRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld
156CRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
157CRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
158CRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
159.if ${MK_ZFS} != "no"
160CRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
161CRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
162.endif
163CRUNCH_ALIAS_reboot= fastboot halt fasthalt
164CRUNCH_ALIAS_restore= rrestore
165CRUNCH_ALIAS_dump= rdump
166CRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
167CRUNCH_ALIAS_geom= glabel gpart
168
169# dhclient has historically been troublesome...
170CRUNCH_PROGS_sbin+= dhclient
171CRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
172
173##################################################################
174# Programs from stock /usr/bin
175#
176CRUNCH_SRCDIRS+= usr.bin
177
178CRUNCH_PROGS_usr.bin= head mt nc sed tail tee
179
180CRUNCH_PROGS_usr.bin+= gzip
181CRUNCH_ALIAS_gzip= gunzip gzcat zcat
182
183CRUNCH_PROGS_usr.bin+= bzip2
184CRUNCH_ALIAS_bzip2= bunzip2 bzcat
185CRUNCH_LIBS+= -lbz2
186
187CRUNCH_PROGS_usr.bin+= xz
188CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
189CRUNCH_LIBS+= -llzma
190
191CRUNCH_PROGS_usr.bin+= tar
192CRUNCH_LIBS+= -larchive -lmd
193.if ${MK_OPENSSL} != "no"
194CRUNCH_LIBS+= -lcrypto
195.endif
196
197CRUNCH_PROGS_usr.bin+= vi
198CRUNCH_ALIAS_vi= ex
199
200CRUNCH_PROGS_usr.bin+= id
201CRUNCH_ALIAS_id= groups whoami
202
203##################################################################
204# Programs from stock /usr/sbin
205#
206CRUNCH_SRCDIRS+= usr.sbin
207
208CRUNCH_PROGS_usr.sbin= chroot
209
210CRUNCH_PROGS_usr.sbin+= chown
211CRUNCH_ALIAS_chown= chgrp
212##################################################################
213CRUNCH_LIBS+= -lm
214
215.include <bsd.crunchgen.mk>
216.include <bsd.prog.mk>
217