Makefile revision 252356
1119419Sobrien#$FreeBSD: head/rescue/rescue/Makefile 252356 2013-06-28 21:00:08Z davide $
254994Simp#	@(#)Makefile	8.1 (Berkeley) 6/2/93
354994Simp
454994SimpNO_MAN=
554994Simp
654994Simp.include <bsd.own.mk>
754994SimpMK_SSP=	no
854994Simp
954994SimpPROG=	rescue
1054994SimpBINDIR?=/rescue
1154994Simp
1254994Simp# Shell scripts need #! line to be edited from /bin/sh to /rescue/sh
1354994SimpSCRIPTS= nextboot_FIXED
1454994SimpSCRIPTSNAME_nextboot_FIXED= nextboot
1554994Simpnextboot_FIXED: ../../sbin/reboot/nextboot.sh
1654994Simp	sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
1754994SimpCLEANFILES+= nextboot_FIXED
1854994Simp
1954994SimpSCRIPTS+= dhclient_FIXED
2054994SimpSCRIPTSNAME_dhclient_FIXED= dhclient-script
2154994Simpdhclient_FIXED: ../../sbin/dhclient/dhclient-script
2254994Simp	sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
2354994SimpCLEANFILES+= dhclient_FIXED
2454994Simp
2554994Simp# The help which used to be here is now in mk/bsd.crunchgen.mk
2654994Simp
2754994Simp# Define Makefile variable RESCUE
2854994SimpCRUNCH_BUILDOPTS+= -DRESCUE
2954994Simp# Define compile-time RESCUE symbol when compiling components
3054994SimpCRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE
3154994Simp
32119419Sobrien# An experiment that failed: try overriding bsd.lib.mk and bsd.prog.mk
33119419Sobrien# rather than incorporating rescue-specific logic into standard files.
34119419Sobrien#MAKEFLAGS= -m ${.CURDIR} ${.MAKEFLAGS}
3554994Simp
36129764Simp# Hackery:  'librescue' exists merely as a tool for appropriately
3754994Simp# recompiling specific library entries.  We _know_ they're needed, and
38129879Sphk# regular archive searching creates ugly library ordering problems.
3954994Simp# Easiest fix: tell the linker to include them into the executable
40129764Simp# first, so they are guaranteed to override the regular lib entries.
4154994Simp# Note that if 'librescue' hasn't been compiled, we'll just get the
4256366Shosokawa# regular lib entries from libc and friends.
4354994SimpCRUNCH_LIBS+= ${.OBJDIR}/../librescue/*.o
4454994Simp
4554994Simp###################################################################
46129798Simp# Programs from stock /bin
47149101Simp#
48149101Simp# WARNING: Changing this list may require adjusting
49129798Simp# /usr/include/paths.h as well!  You were warned!
50129764Simp#
51140525SimpCRUNCH_SRCDIRS+= bin
52147797SimpCRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo 	\
5354994Simp	 ed expr getfacl hostname kenv kill ln ls mkdir mv	\
5466058Simp	 pkill ps pwd realpath rm rmdir setfacl sh stty sync test
5566058SimpCRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
56129764SimpCRUNCH_BUILDTOOLS+= bin/sh
5766058Simp
58149101Simp# Additional options for specific programs
59149101SimpCRUNCH_ALIAS_test= [
60149101SimpCRUNCH_ALIAS_sh= -sh
61149101Simp# The -sh alias shouldn't appear in /rescue as a hard link
62149101SimpCRUNCH_SUPPRESS_LINK_-sh= 1
63149101SimpCRUNCH_ALIAS_ln= link
64149101SimpCRUNCH_ALIAS_rm= unlink
65149101SimpCRUNCH_ALIAS_ed= red
66149101SimpCRUNCH_ALIAS_pkill= pgrep
67149101Simp
68149101Simp.if ${MK_RCMDS} != "no"
69149101SimpCRUNCH_PROGS_bin+= rcp
70149101Simp.endif
71149101Simp
72149101Simp.if ${MK_TCSH} != "no"
73149101SimpCRUNCH_PROGS_bin+= csh
74149101SimpCRUNCH_ALIAS_csh= -csh tcsh -tcsh
75149101SimpCRUNCH_BUILDTOOLS+= bin/csh
76149101SimpCRUNCH_SUPPRESS_LINK_-csh= 1
77149101SimpCRUNCH_SUPPRESS_LINK_-tcsh= 1
78149101Simp.endif
79149101Simp
80149101Simp###################################################################
81149101Simp# Programs from standard /sbin
82149101Simp#
83149101Simp# WARNING: Changing this list may require adjusting
84149101Simp# /usr/include/paths.h as well!  You were warned!
85149101Simp#
86149101Simp# Note that mdmfs have their own private 'pathnames.h'
87149101Simp# headers in addition to the standard 'paths.h' header.
88149101Simp#
89149101SimpCRUNCH_SRCDIRS+= sbin
90147957SimpCRUNCH_PROGS_sbin= badsect					\
91147957Simp	camcontrol ccdconfig clri devfs dmesg dump		\
92149101Simp	dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb		\
93147957Simp	fsirand gbde geom ifconfig init 			\
94149101Simp	kldconfig kldload kldstat kldunload ldconfig 		\
95149101Simp	md5 mdconfig mdmfs mknod mount mount_cd9660		\
96147957Simp	mount_msdosfs mount_nfs mount_nullfs			\
97149101Simp	mount_udf mount_unionfs newfs				\
98149101Simp	newfs_msdos nos-tun ping reboot				\
99149101Simp	restore rcorder route routed rtquery rtsol savecore	\
100147957Simp	spppcontrol swapon sysctl tunefs umount
101147957Simp
102147957Simp.if ${MK_ATM} != "no"
103147957SimpCRUNCH_PROGS_sbin+= atmconfig
104147957Simp.endif
105149101Simp
106149101Simp.if ${MK_INET6_SUPPORT} != "no"
107147957SimpCRUNCH_PROGS_sbin+= ping6
108147957Simp.endif
10966425Simp
110100426Simp.if ${MK_IPFILTER} != "no"
111147957SimpCRUNCH_PROGS_sbin+= ipf
112147957Simp.endif
113147957Simp.if ${MK_ZFS} != "no"
114147957SimpCRUNCH_PROGS_sbin+= zfs
115147957SimpCRUNCH_PROGS_sbin+= zpool
116147957Simp.endif
117147957Simp
118147957Simp# crunchgen does not like C++ programs; this should be fixed someday
119147957Simp# CRUNCH_PROGS+= devd
120147957Simp
12154994SimpCRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec
122147797Simp.if ${MK_IPX} != "no"
12366425SimpCRUNCH_LIBS+= -lipx
124147957Simp.endif
12566425Simp.if ${MK_ZFS} != "no"
126147957SimpCRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
127147957Simp.endif
128147957SimpCRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz
12966425Simp
13066425Simp.if ${MACHINE_CPUARCH} == "i386"
13166425SimpCRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
13266425SimpCRUNCH_ALIAS_bsdlabel= disklabel
13366425Simp#CRUNCH_PROGS+= mount_smbfs
13466425Simp#CRUNCH_LIBS+= -lsmb
135121514Simp.endif
136121514Simp
137121514Simp.if ${MACHINE} == "pc98"
138121514SimpCRUNCH_PROGS_sbin+= bsdlabel
139149101SimpCRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
140121514Simp.endif
141121514Simp
142121514Simp.if ${MACHINE_CPUARCH} == "ia64"
143121514SimpCRUNCH_PROGS_sbin+= mca
144121514Simp.endif
145121514Simp
146121514Simp.if ${MACHINE_CPUARCH} == "sparc64"
147121514SimpCRUNCH_PROGS_sbin+= bsdlabel sunlabel
148149101Simp.endif
149149101Simp
150121514Simp.if ${MACHINE_CPUARCH} == "amd64"
151121514SimpCRUNCH_PROGS_sbin+= bsdlabel fdisk
152121514SimpCRUNCH_ALIAS_bsdlabel= disklabel
153121514Simp.endif
154121514Simp
155121514SimpCRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm
156121514SimpCRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig
157121514SimpCRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld
158121514SimpCRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
159121514SimpCRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
160121514SimpCRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
161121514Simp.if ${MK_ZFS} != "no"
162121514SimpCRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
163149101SimpCRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
16454994Simp.endif
165149101SimpCRUNCH_ALIAS_reboot= fastboot halt fasthalt
166147797SimpCRUNCH_ALIAS_restore= rrestore
16756366ShosokawaCRUNCH_ALIAS_dump= rdump
168147797SimpCRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
16956366ShosokawaCRUNCH_ALIAS_geom= glabel gpart
170147797Simp
171121514Simp# dhclient has historically been troublesome...
172121514SimpCRUNCH_PROGS_sbin+= dhclient
173147797SimpCRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
174147797Simp
175121514Simp##################################################################
176121514Simp# Programs from stock /usr/bin
177121514Simp#
178147797SimpCRUNCH_SRCDIRS+= usr.bin
179147797Simp
180121514SimpCRUNCH_PROGS_usr.bin= head mt nc sed tail tee
181149101Simp
182149101SimpCRUNCH_PROGS_usr.bin+= gzip
183147797SimpCRUNCH_ALIAS_gzip= gunzip gzcat zcat
184149101Simp
185149101SimpCRUNCH_PROGS_usr.bin+= bzip2
186149101SimpCRUNCH_ALIAS_bzip2= bunzip2 bzcat
187149101SimpCRUNCH_LIBS+= -lbz2
188149101Simp
189147797SimpCRUNCH_PROGS_usr.bin+= less
190149101SimpCRUNCH_ALIAS_less= more
191149101Simp
192149101SimpCRUNCH_PROGS_usr.bin+= xz
193149101SimpCRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
194149101SimpCRUNCH_LIBS+= -llzma
195149101Simp
196149101SimpCRUNCH_PROGS_usr.bin+= tar
197149101SimpCRUNCH_LIBS+= -larchive -lmd
198149101Simp.if ${MK_OPENSSL} != "no"
199149101SimpCRUNCH_LIBS+= -lcrypto
200149101Simp.endif
201149101Simp
202149101SimpCRUNCH_PROGS_usr.bin+= vi
203149101SimpCRUNCH_ALIAS_vi= ex
204149101Simp
205149101SimpCRUNCH_PROGS_usr.bin+= id
206149101SimpCRUNCH_ALIAS_id= groups whoami
207149101Simp
208149101Simp##################################################################
209149101Simp# Programs from stock /usr/sbin
210149101Simp#
211149101SimpCRUNCH_SRCDIRS+= usr.sbin
212149101Simp
213149101SimpCRUNCH_PROGS_usr.sbin= chroot
214149101Simp
215149101SimpCRUNCH_PROGS_usr.sbin+= chown
216149101SimpCRUNCH_ALIAS_chown= chgrp
217149101Simp##################################################################
218149101SimpCRUNCH_LIBS+= -lm
219149101Simp
220149101Simp.include <bsd.crunchgen.mk>
221149101Simp.include <bsd.prog.mk>
222149101Simp