--- ray/makeall 2005/07/26 15:33:13 1.18 +++ ray/makeall 2022/02/16 18:56:32 1.31 @@ -1,5 +1,5 @@ #!/bin/csh -f -# RCSid $Id: makeall,v 1.18 2005/07/26 15:33:13 greg Exp $ +# RCSid $Id: makeall,v 1.31 2022/02/16 18:56:32 greg Exp $ # # Make all the Radiance programs # @@ -7,21 +7,39 @@ if ( $#argv < 1 ) then echo "Usage: makeall install [clean] [make options]" echo " or: makeall clean" echo " or: makeall library" + echo " or: makeall test" exit 1 endif if ( "$1" == library ) then source installib - cp -f src/*/*.{cal,tab,hex} $ldir + cp -f src/*/*.{cal,tab,hex,dat} $ldir echo "" echo "Set the environment variable RAYPATH=.:$ldir" echo 'For C-shell users, put the following into ~/.cshrc' echo " setenv RAYPATH .:$ldir" - echo 'For Bourne shell users, put the following into $HOME/profile' + echo 'For Bourne shell users, put the following into $HOME/.profile' echo " RAYPATH=.:$ldir" echo " export RAYPATH" echo "" exit 0 endif +if ( "$1" == test ) then + cd test + set fails=() + foreach d (cv cal gen util px renders) + cd $d + make -k clean all && make clean + if ($status) set fails=($fails $d) + cd .. + end + if ($#fails) then + echo "Unit tests failed in $#fails directories" + echo "Run 'make' manually in test/ subfolders: $fails" + exit 1 + endif + echo "All tests passed successfully." + exit 0 +endif set srcdirs=( common rt meta cv gen ot px hd util cal ) if ( "$1" == install ) then cat << _EOF_ @@ -65,13 +83,6 @@ if ( ! -d $idir ) then goto again1 endif endif -if ( ! -d $idir/dev ) then - mkdir $idir/dev - if ( $status ) then - echo "Cannot create subdirectory, please reenter" - goto again1 - endif -endif set inpath=0 foreach i ( $path ) if ( "$i" == "$idir" ) then @@ -84,7 +95,7 @@ if ( "`ls -tL $rmake $0 |& head -1`" == $rmake ) then goto gotrmake endif set newrmake -more src/common/copyright.h +more License.txt echo -n "Do you understand and accept the terms of this agreement [n]? " set ans="$<" if ( "$ans" !~ [yY]* ) exit @@ -100,15 +111,11 @@ cat << _EOF_ Please select your system type from the following list: 1) Sun Solaris - 2) HP workstation - 3) Silicon Graphics - 4) AIX (RS/6000) - 5) BSDI BSD/386 - 6) Linux - 7) MacOS X - 8) FreeBSD - 9) Cygwin - 10) Other + 2) Linux + 3) MacOS X + 4) FreeBSD + 5) Cygwin + 6) Other _EOF_ echo -n "Choice? " @@ -117,87 +124,47 @@ switch ("$arch") case 1: # SPARC Station set arch=sun set mach="-I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO" - set opt="-O -DSPEED=80" - set compat="strcmp.o" - breaksw -case 2: # HP workstation - set mach="" - set opt="-O -DSPEED=80 -Aa -D_HPUX_SOURCE" - set compat="strcmp.o" - set arch=hpux - breaksw -case 3: # Silicon Graphics - set arch=sgi - switch (`uname -r`) - case 3.*: - set mach="-noprototypes" - set opt="-O -DSPEED=80" - set special="sgi" - set compat="strcmp.o" - breaksw - case 4.*: - set mach="" - set opt="-O2 -DSPEED=100" - set compat="strcmp.o" - set extras='"MLIB=-lfastm -lm"' - breaksw - default: # 5.x or later - ln -s `which wish` $idir/wish4.0 - set path=($idir $path) - set mach="-w" - set opt="-O2 -DSPEED=200" - set special="ogl" - set compat="strcmp.o" - breaksw - endsw - breaksw -case 4: # AIX set opt="-O" - set compat="erf.o strcmp.o" - set arch=PowerPC + set compat="strcmp.o timegm.o" breaksw -case 5: # BSDI BSD/386 - set mach="-DBSD -L/usr/X11/lib -I/usr/X11/include" - set opt="-O -DSPEED=100" - set arch=IBMPC - set compat="erf.o strcmp.o" - breaksw -case 6: # Linux +case 2: # Linux set mach="-Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO" - set opt="-O2 -DSPEED=200" + set opt="-O2" set arch=IBMPC - set compat="erf.o" + set compat="strlcpy.o" set extras=CC=gcc breaksw -case 7: # MacOS X +case 3: # MacOS X set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib" - set opt="-O2 -DSPEED=200" - set arch=PowerPC - set extras="CC=cc CONFIGURE_ARCH=powerpc" + set opt="-O2" + set arch=Intel + set extras="CC=cc CONFIGURE_ARCH=i386" set special="ogl" breaksw -case 8: # FreeBSD +case 4: # FreeBSD set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib" - set opt="-O -DSPEED=200" + set opt="-O" set compat="erf.o" set extras='CC=cc MLIB="-lcompat -lm"' set arch=IBMPC breaksw -case 9: # Cygwin +case 5: # Cygwin set mach="-Dfreebsd -L/usr/lib -L/usr/X11R6/lib -I/usr/include/X11 -I/usr/X11R6/include -DNOSTEREO" - set opt="-O2 -DSPEED=200" + set opt="-O2" set arch=IBMPC - set compat="erf.o" + set compat="erf.o strlcpy.o" set extras="CC=gcc" set special="ogl" set esuffix=".exe" breaksw -case 10: # Other +case 6: # Other set opt="-O" - set compat="erf.o strcmp.o" + set compat="erf.o strcmp.o strlcpy.o" echo -n "Are you using the GNU C compiler [n]? " if ( "$<" =~ [yY]* ) then set extras="CC=gcc" + else + set compat="$compat timegm.o" endif set arch=other breaksw @@ -260,7 +227,7 @@ if (! $inpath ) then echo "Add $idir to the beginning of your execution path:" echo 'For C-shell users, put the following into ~/.cshrc' echo " set path=( $idir "'$path )' - echo 'For Bourne shell users, put the following into $HOME/profile' + echo 'For Bourne shell users, put the following into $HOME/.profile' echo " PATH=$idir"':$PATH' echo " export PATH" endif