#!/bin/sh # # $Id: build,v 1.10 1997/01/14 22:44:59 sob Exp $ # RELEASE=wu-ftpd-2.4.2-beta-12 cat > .bld.hlp < may be one of the following: gen : generic make (copy this when porting to a new system) aix : IBM AIX aux : AU/X bdi : BSD/OS bsd : BSD dec : DEC Unix 3.X or later dyn : Dynix fbs : FreeBSD 2.0 or later hiu : Hitachi Unix hpx : HP-UX lnx : Linux (tested on 1.2.8) nbs : NetBSD 1.X nx2 : NeXTstep 2.x nx3 : NeXTstep 3.x osf : OSF/1 ptx : ??? sco : SCO Unix 3.2v4.2 sgi : SGI Irix 4.0.5a sny : Sony NewsOS sol : SunOS 5.x / Solaris 2.x s41 : SunOS 4.1.x ult : Ultrix 4.x uxw : UnixWare 1.1 or later clean : Clean up object files and such to reduce disk space after building. install: Install ftpd. EOF maketarget="no-target" makeopts="" makeargs="" args=$# while [ $args -gt 0 ] do case $1 in help) cat .bld.hlp exit ;; -*) makeargs="$makeargs $1" ;; install|clean|distrib|???) if [ $maketarget != no-target ] then echo "Can only make one target system at a time" echo 'Both "$maketarget" and "$1" where given' exit else maketarget=$1 fi ;; *) makeopts="$makeopts $1" ;; esac shift args=`expr $args - 1` done echo 'make args are : '$makeargs'' echo 'make opts are : '$makeopts'' if grep S_IFLNK /usr/include/sys/stat.h >/dev/null 2>&1 ; then CPLN='ln -s' else CPLN='cp' fi case $maketarget in ???) echo '' echo "Linking Makefiles." if [ -f Makefile ]; then echo Makefile already present in root directory else $CPLN makefiles/Makefile.$maketarget Makefile fi cd src if [ -f Makefile ]; then echo Makefile already present in src directory else $CPLN makefiles/Makefile.$maketarget Makefile fi if [ -f config.h ]; then echo config.h already present in src directory else cp config/config.$maketarget config.h fi cd ../support if [ -f Makefile ]; then echo Makefile already present in support directory else $CPLN makefiles/Makefile.$maketarget Makefile fi echo '' echo "Making support library." cd ../support make $makeargs $makeopts echo '' echo "Making ftpd." cd ../src make $makeargs $makeopts ftpd echo '' echo "Making ftpcount." make $makeargs $makeopts ftpcount echo '' echo "Making ftpshut". make $makeargs $makeopts ftpshut echo '' echo "Making ckconfig." make $makeargs $makeopts ckconfig cd .. if [ ! -d bin ] ; then mkdir bin; fi cd bin rm -f ftpd ftpcount ftpshut if [ -s ../src/ftpd ] ; then $CPLN ../src/ftpd ftpd ; fi if [ -s ../src/ftpcount ] ; then $CPLN ../src/ftpcount ftpcount ; fi if [ -s ../src/ftpshut ] ; then $CPLN ../src/ftpshut ftpshut ; fi if [ -s ../src/ftpcount ] ; then $CPLN ../src/ftpcount ftpwho ; fi if [ -s ../src/ckconfig ] ; then $CPLN ../src/ckconfig ckconfig ; fi cd .. echo '' echo "Links to executables are in bin directory:" size bin/ftpd bin/ftpcount bin/ftpshut bin/ftpwho bin/ckconfig echo "Done" ;; clean) # This only sort of works echo "Cleaning root directory." if [ -s .depend ] ; then rm .depend ; fi if [ -s .bld.hlp ] ; then rm .bld.hlp ; fi if [ -s Makefile ] ; then rm Makefile ; fi if [ -s wu-ftpd.tar ] ; then rm wu-ftpd.tar ; fi rm -f *~ echo "Cleaning support directory." cd support make -f makefiles/Makefile.gen $makeargs $makeopts clean rm -f Makefile echo "Cleaning src directory." cd ../src make -f makefiles/Makefile.gen $makeargs $makeopts clean rm -f Makefile rm -f Makefile.bak rm -f config.h rm -f edit rm -f y.tab.h echo "Cleaning bin directory." cd .. if [ -d bin ] ; then rm -rf bin; fi ;; install) make -f Makefile $makeargs $makeopts install ;; distrib) ./build clean echo "Building file list." # assumes the gnu tar program ls RCS/* */RCS/* */*/RCS/* > /tmp/xclude$$ echo $RELEASE >> /tmp/xclude$$ echo .bld.hlp >> /tmp/xclude$$ echo RCS >> /tmp/xclude$$ echo src/RCS >> /tmp/xclude$$ echo support/RCS >> /tmp/xclude$$ echo support/arpa/RCS >> /tmp/xclude$$ echo support/man/RCS >> /tmp/xclude$$ echo makefiles/RCS >> /tmp/xclude$$ echo util/RCS >> /tmp/xclude$$ echo doc/RCS >> /tmp/xclude$$ echo doc/examples/RCS >> /tmp/xclude$$ echo "Building distribution tar file." mkdir $RELEASE tar -X/tmp/xclude$$ -cf - . |(cd $RELEASE; tar xBf - ) tar -cf $RELEASE.tar $RELEASE echo "Cleaning up." rm -rf /tmp/xclude$$ $RELEASE ;; no-target) echo "No target plaform for which to build ftpd given." echo 'Give command "build help" for help.' ;; *) echo 'Do not know how to make ftpd for target "'$maketarget'".' ;; esac