Makefile revision 269519
1117035Sgordon#$FreeBSD: stable/10/rescue/rescue/Makefile 269519 2014-08-04 14:56:49Z dim $ 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 55266279SbdreweryCRUNCH_LIBS+= -lcrypt -ledit -ljail -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" 126266279SbdreweryCRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem 127192617Skmacy.endif 128269519SdimCRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv 129269519Sdim.if ${MK_OPENSSL} == "no" 130269519SdimCRUNCH_LIBS+= -lmd 131269519Sdim.endif 132269519SdimCRUNCH_LIBS+= -lsbuf -lufs -lz 133117035Sgordon 134211725Simp.if ${MACHINE_CPUARCH} == "i386" 135173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk 136117057SgordonCRUNCH_ALIAS_bsdlabel= disklabel 137252356Sdavide#CRUNCH_PROGS+= mount_smbfs 138252356Sdavide#CRUNCH_LIBS+= -lsmb 139117035Sgordon.endif 140117035Sgordon 141117035Sgordon.if ${MACHINE} == "pc98" 142173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel 143117692SobrienCRUNCH_SRCDIR_fdisk= $(.CURDIR)/../../sbin/fdisk_pc98 144117035Sgordon.endif 145117035Sgordon 146211725Simp.if ${MACHINE_CPUARCH} == "ia64" 147173314SmarcelCRUNCH_PROGS_sbin+= mca 148117035Sgordon.endif 149117035Sgordon 150211725Simp.if ${MACHINE_CPUARCH} == "sparc64" 151173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel sunlabel 152117035Sgordon.endif 153117035Sgordon 154211725Simp.if ${MACHINE_CPUARCH} == "amd64" 155173314SmarcelCRUNCH_PROGS_sbin+= bsdlabel fdisk 156117057SgordonCRUNCH_ALIAS_bsdlabel= disklabel 157117057Sgordon.endif 158117057Sgordon 159117692SobrienCRUNCH_SRCDIR_atm= $(.CURDIR)/../../sbin/atm/atm 160118826ShartiCRUNCH_SRCDIR_atmconfig= $(.CURDIR)/../../sbin/atm/atmconfig 161117692SobrienCRUNCH_SRCDIR_fore_dnld= $(.CURDIR)/../../sbin/atm/fore_dnld 162117692SobrienCRUNCH_SRCDIR_ilmid= $(.CURDIR)/../../sbin/atm/ilmid 163117692SobrienCRUNCH_SRCDIR_rtquery= $(.CURDIR)/../../sbin/routed/rtquery 164145630SdarrenrCRUNCH_SRCDIR_ipf= $(.CURDIR)/../../sbin/ipf/ipf 165192617Skmacy.if ${MK_ZFS} != "no" 166192617SkmacyCRUNCH_SRCDIR_zfs= ${.CURDIR}/../../cddl/sbin/zfs 167192617SkmacyCRUNCH_SRCDIR_zpool= ${.CURDIR}/../../cddl/sbin/zpool 168192617Skmacy.endif 169117035SgordonCRUNCH_ALIAS_reboot= fastboot halt fasthalt 170117692SobrienCRUNCH_ALIAS_restore= rrestore 171117035SgordonCRUNCH_ALIAS_dump= rdump 172117692SobrienCRUNCH_ALIAS_fsck_ffs= fsck_4.2bsd fsck_ufs 173177707SruCRUNCH_ALIAS_geom= glabel gpart 174117035Sgordon 175117035Sgordon# dhclient has historically been troublesome... 176147090SbrooksCRUNCH_PROGS_sbin+= dhclient 177147090SbrooksCRUNCH_BUILDOPTS_dhclient= -DRELEASE_CRUNCH -Dlint 178117035Sgordon 179117035Sgordon################################################################## 180117035Sgordon# Programs from stock /usr/bin 181191227Skientzle# 182117692SobrienCRUNCH_SRCDIRS+= usr.bin 183117035Sgordon 184227531SdesCRUNCH_PROGS_usr.bin= head mt nc sed tail tee 185173073Syar 186166255SdelphijCRUNCH_PROGS_usr.bin+= gzip 187117692SobrienCRUNCH_ALIAS_gzip= gunzip gzcat zcat 188117035Sgordon 189117692SobrienCRUNCH_PROGS_usr.bin+= bzip2 190117692SobrienCRUNCH_ALIAS_bzip2= bunzip2 bzcat 191117692SobrienCRUNCH_LIBS+= -lbz2 192117035Sgordon 193250626SdelphijCRUNCH_PROGS_usr.bin+= less 194250626SdelphijCRUNCH_ALIAS_less= more 195250626Sdelphij 196207849SmmCRUNCH_PROGS_usr.bin+= xz 197207849SmmCRUNCH_ALIAS_xz= unxz lzma unlzma xzcat lzcat 198207849SmmCRUNCH_LIBS+= -llzma 199207849Smm 200138366SobrienCRUNCH_PROGS_usr.bin+= tar 201269519SdimCRUNCH_LIBS+= -larchive 202191239Skientzle.if ${MK_OPENSSL} != "no" 203191239SkientzleCRUNCH_LIBS+= -lcrypto 204191239Skientzle.endif 205269519SdimCRUNCH_LIBS+= -lmd 206138366Sobrien 207117692SobrienCRUNCH_PROGS_usr.bin+= vi 208117692SobrienCRUNCH_ALIAS_vi= ex 209117035Sgordon 210126874SdesCRUNCH_PROGS_usr.bin+= id 211126874SdesCRUNCH_ALIAS_id= groups whoami 212126874Sdes 213117035Sgordon################################################################## 214141478Sdes# Programs from stock /usr/sbin 215191227Skientzle# 216141478SdesCRUNCH_SRCDIRS+= usr.sbin 217141478Sdes 218173073SyarCRUNCH_PROGS_usr.sbin= chroot 219141478Sdes 220173073SyarCRUNCH_PROGS_usr.sbin+= chown 221173073SyarCRUNCH_ALIAS_chown= chgrp 222192617Skmacy################################################################## 223192617SkmacyCRUNCH_LIBS+= -lm 224173073Syar 225215226Sadrian.include <bsd.crunchgen.mk> 226117035Sgordon.include <bsd.prog.mk> 227