Makefile revision 250626
1117035Sgordon#$FreeBSD: head/rescue/rescue/Makefile 250626 2013-05-13 22:16:33Z delphij $
2117035Sgordon#	@(#)Makefile	8.1 (Berkeley) 6/2/93
3117035Sgordon
4156813SruNO_MAN=
5156813Sru
6156813Sru.include <bsd.own.mk>
7188895SruMK_SSP=	no
8156813Sru
9117035SgordonPROG=	rescue
10117692SobrienBINDIR?=/rescue
11117035Sgordon
12117035Sgordon# Shell scripts need #! line to be edited from /bin/sh to /rescue/sh
13117035SgordonSCRIPTS= nextboot_FIXED
14153455SjhbSCRIPTSNAME_nextboot_FIXED= nextboot
15117035Sgordonnextboot_FIXED: ../../sbin/reboot/nextboot.sh
16117035Sgordon	sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
17117035SgordonCLEANFILES+= nextboot_FIXED
18117035Sgordon
19147090SbrooksSCRIPTS+= dhclient_FIXED
20147090SbrooksSCRIPTSNAME_dhclient_FIXED= dhclient-script
21147090Sbrooksdhclient_FIXED: ../../sbin/dhclient/dhclient-script
22147090Sbrooks	sed '1s/\/bin\//\/rescue\//' ${.ALLSRC} > ${.TARGET}
23147090SbrooksCLEANFILES+= dhclient_FIXED
24117035Sgordon
25215226Sadrian# The help which used to be here is now in mk/bsd.crunchgen.mk
26117035Sgordon
27117035Sgordon# Define Makefile variable RESCUE
28117035SgordonCRUNCH_BUILDOPTS+= -DRESCUE
29117035Sgordon# Define compile-time RESCUE symbol when compiling components
30117035SgordonCRUNCH_BUILDOPTS+= CRUNCH_CFLAGS=-DRESCUE
31117035Sgordon
32117449Sgordon# An experiment that failed: try overriding bsd.lib.mk and bsd.prog.mk
33117449Sgordon# rather than incorporating rescue-specific logic into standard files.
34117035Sgordon#MAKEFLAGS= -m ${.CURDIR} ${.MAKEFLAGS}
35117035Sgordon
36117035Sgordon# Hackery:  'librescue' exists merely as a tool for appropriately
37117035Sgordon# recompiling specific library entries.  We _know_ they're needed, and
38117035Sgordon# regular archive searching creates ugly library ordering problems.
39117035Sgordon# Easiest fix: tell the linker to include them into the executable
40117035Sgordon# first, so they are guaranteed to override the regular lib entries.
41117035Sgordon# Note that if 'librescue' hasn't been compiled, we'll just get the
42117035Sgordon# regular lib entries from libc and friends.
43117035SgordonCRUNCH_LIBS+= ${.OBJDIR}/../librescue/*.o
44117035Sgordon
45117035Sgordon###################################################################
46117035Sgordon# Programs from stock /bin
47117035Sgordon#
48117035Sgordon# WARNING: Changing this list may require adjusting
49117035Sgordon# /usr/include/paths.h as well!  You were warned!
50117035Sgordon#
51117692SobrienCRUNCH_SRCDIRS+= bin
52117791SobrienCRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo 	\
53182543Syar	 ed expr getfacl hostname kenv kill ln ls mkdir mv	\
54183007Simp	 pkill ps pwd realpath rm rmdir setfacl sh stty sync test
55202755SedCRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
56215226SadrianCRUNCH_BUILDTOOLS+= bin/sh
57117035Sgordon
58117035Sgordon# Additional options for specific programs
59117035SgordonCRUNCH_ALIAS_test= [
60117035SgordonCRUNCH_ALIAS_sh= -sh
61117035Sgordon# The -sh alias shouldn't appear in /rescue as a hard link
62117692SobrienCRUNCH_SUPPRESS_LINK_-sh= 1
63117035SgordonCRUNCH_ALIAS_ln= link
64117035SgordonCRUNCH_ALIAS_rm= unlink
65117035SgordonCRUNCH_ALIAS_ed= red
66173073SyarCRUNCH_ALIAS_pkill= pgrep
67173073Syar
68156813Sru.if ${MK_RCMDS} != "no"
69117601SgordonCRUNCH_PROGS_bin+= rcp
70117035Sgordon.endif
71117035Sgordon
72156813Sru.if ${MK_TCSH} != "no"
73117601SgordonCRUNCH_PROGS_bin+= csh
74117035SgordonCRUNCH_ALIAS_csh= -csh tcsh -tcsh
75215226SadrianCRUNCH_BUILDTOOLS+= bin/csh
76117692SobrienCRUNCH_SUPPRESS_LINK_-csh= 1
77117692SobrienCRUNCH_SUPPRESS_LINK_-tcsh= 1
78117035Sgordon.endif
79117035Sgordon
80117035Sgordon###################################################################
81117035Sgordon# Programs from standard /sbin
82117035Sgordon#
83117035Sgordon# WARNING: Changing this list may require adjusting
84117035Sgordon# /usr/include/paths.h as well!  You were warned!
85117035Sgordon#
86117791Sobrien# Note that mdmfs have their own private 'pathnames.h'
87117035Sgordon# headers in addition to the standard 'paths.h' header.
88117035Sgordon#
89117692SobrienCRUNCH_SRCDIRS+= sbin
90249083SmavCRUNCH_PROGS_sbin= badsect					\
91183007Simp	camcontrol ccdconfig clri devfs dmesg dump		\
92133799Smarius	dumpfs dumpon fsck fsck_ffs fsck_msdosfs fsdb		\
93173314Smarcel	fsirand gbde geom ifconfig init 			\
94183007Simp	kldconfig kldload kldstat kldunload ldconfig 		\
95183007Simp	md5 mdconfig mdmfs mknod mount mount_cd9660		\
96241636Sattilio	mount_msdosfs mount_nfs mount_nullfs			\
97183007Simp	mount_udf mount_unionfs newfs				\
98183007Simp	newfs_msdos nos-tun ping reboot				\
99183007Simp	restore rcorder route routed rtquery rtsol savecore	\
100191227Skientzle	spppcontrol swapon sysctl tunefs umount
101117035Sgordon
102156813Sru.if ${MK_ATM} != "no"
103171453SrwatsonCRUNCH_PROGS_sbin+= atmconfig
104119664Sphk.endif
105119664Sphk
106156813Sru.if ${MK_INET6_SUPPORT} != "no"
107119664SphkCRUNCH_PROGS_sbin+= ping6
108119664Sphk.endif
109119664Sphk
110156813Sru.if ${MK_IPFILTER} != "no"
111145630SdarrenrCRUNCH_PROGS_sbin+= ipf
112117693Sobrien.endif
113192617Skmacy.if ${MK_ZFS} != "no"
114192617SkmacyCRUNCH_PROGS_sbin+= zfs
115192617SkmacyCRUNCH_PROGS_sbin+= zpool
116192617Skmacy.endif
117117693Sobrien
118117035Sgordon# crunchgen does not like C++ programs; this should be fixed someday
119117035Sgordon# CRUNCH_PROGS+= devd
120117035Sgordon
121157177ScognetCRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec
122156905Sru.if ${MK_IPX} != "no"
123156905SruCRUNCH_LIBS+= -lipx
124156905Sru.endif
125192617Skmacy.if ${MK_ZFS} != "no"
126248571SmmCRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
127192617Skmacy.endif
128231642SrmhCRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz
129117035Sgordon
130211725Simp.if ${MACHINE_CPUARCH} == "i386"
131173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk
132117057SgordonCRUNCH_ALIAS_bsdlabel= disklabel
133117035Sgordon.endif
134117035Sgordon
135117035Sgordon.if ${MACHINE} == "pc98"
136173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel
137117692SobrienCRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98
138117035Sgordon.endif
139117035Sgordon
140211725Simp.if ${MACHINE_CPUARCH} == "ia64"
141173314SmarcelCRUNCH_PROGS_sbin+= mca
142117035Sgordon.endif
143117035Sgordon
144211725Simp.if ${MACHINE_CPUARCH} == "sparc64"
145173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel sunlabel
146117035Sgordon.endif
147117035Sgordon
148211725Simp.if ${MACHINE_CPUARCH} == "amd64"
149173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel fdisk
150117057SgordonCRUNCH_ALIAS_bsdlabel= disklabel
151117057Sgordon.endif
152117057Sgordon
153117692SobrienCRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm
154118826ShartiCRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig
155117692SobrienCRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld
156117692SobrienCRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid
157117692SobrienCRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery
158145630SdarrenrCRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf
159192617Skmacy.if ${MK_ZFS} != "no"
160192617SkmacyCRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs
161192617SkmacyCRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool
162192617Skmacy.endif
163117035SgordonCRUNCH_ALIAS_reboot= fastboot halt fasthalt
164117692SobrienCRUNCH_ALIAS_restore= rrestore
165117035SgordonCRUNCH_ALIAS_dump= rdump
166117692SobrienCRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs
167177707SruCRUNCH_ALIAS_geom= glabel gpart
168117035Sgordon
169117035Sgordon# dhclient has historically been troublesome...
170147090SbrooksCRUNCH_PROGS_sbin+= dhclient
171147090SbrooksCRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint
172117035Sgordon
173117035Sgordon##################################################################
174117035Sgordon# Programs from stock /usr/bin
175191227Skientzle#
176117692SobrienCRUNCH_SRCDIRS+= usr.bin
177117035Sgordon
178227531SdesCRUNCH_PROGS_usr.bin= head mt nc sed tail tee
179173073Syar
180166255SdelphijCRUNCH_PROGS_usr.bin+= gzip
181117692SobrienCRUNCH_ALIAS_gzip= gunzip gzcat zcat
182117035Sgordon
183117692SobrienCRUNCH_PROGS_usr.bin+= bzip2
184117692SobrienCRUNCH_ALIAS_bzip2= bunzip2 bzcat
185117692SobrienCRUNCH_LIBS+= -lbz2
186117035Sgordon
187250626SdelphijCRUNCH_PROGS_usr.bin+= less
188250626SdelphijCRUNCH_ALIAS_less= more
189250626Sdelphij
190207849SmmCRUNCH_PROGS_usr.bin+= xz
191207849SmmCRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat
192207849SmmCRUNCH_LIBS+= -llzma
193207849Smm
194138366SobrienCRUNCH_PROGS_usr.bin+= tar
195191239SkientzleCRUNCH_LIBS+= -larchive -lmd
196191239Skientzle.if ${MK_OPENSSL} != "no"
197191239SkientzleCRUNCH_LIBS+= -lcrypto
198191239Skientzle.endif
199138366Sobrien
200117692SobrienCRUNCH_PROGS_usr.bin+= vi
201117692SobrienCRUNCH_ALIAS_vi= ex
202117035Sgordon
203126874SdesCRUNCH_PROGS_usr.bin+= id
204126874SdesCRUNCH_ALIAS_id= groups whoami
205126874Sdes
206117035Sgordon##################################################################
207141478Sdes# Programs from stock /usr/sbin
208191227Skientzle#
209141478SdesCRUNCH_SRCDIRS+= usr.sbin
210141478Sdes
211173073SyarCRUNCH_PROGS_usr.sbin= chroot
212141478Sdes
213173073SyarCRUNCH_PROGS_usr.sbin+= chown
214173073SyarCRUNCH_ALIAS_chown= chgrp
215192617Skmacy##################################################################
216192617SkmacyCRUNCH_LIBS+= -lm
217173073Syar
218215226Sadrian.include <bsd.crunchgen.mk>
219117035Sgordon.include <bsd.prog.mk>
220