ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/makeall
(Generate patch)

Comparing ray/makeall (file contents):
Revision 1.2 by greg, Fri Feb 28 20:06:51 2003 UTC vs.
Revision 1.31 by greg, Wed Feb 16 18:56:32 2022 UTC

# Line 1 | Line 1
1   #!/bin/csh -f
2   # RCSid $Id$
3   #
4 #Added macosX 2001-04-11 by Jean Brange
5 #Deleted obsolete systems 2001-04-18 by Greg Ward
6 #
4   # Make all the Radiance programs
5   #
6   if ( $#argv < 1 ) then
7          echo "Usage: makeall install [clean] [make options]"
8          echo "   or: makeall clean"
9          echo "   or: makeall library"
10 +        echo "   or: makeall test"
11          exit 1
12   endif
13   if ( "$1" == library ) then
14          source installib
15 +        cp -f src/*/*.{cal,tab,hex,dat} $ldir
16          echo ""
17          echo "Set the environment variable RAYPATH=.:$ldir"
18          echo 'For C-shell users, put the following into ~/.cshrc'
19          echo "  setenv RAYPATH .:$ldir"
20 <        echo 'For Bourne shell users, put the following into $HOME/profile'
20 >        echo 'For Bourne shell users, put the following into $HOME/.profile'
21          echo "  RAYPATH=.:$ldir"
22          echo "  export RAYPATH"
23          echo ""
24          exit 0
25   endif
26 < set srcdirs=( common meta cv gen ot rt px hd util cal )
26 > if ( "$1" == test ) then
27 >        cd test
28 >        set fails=()
29 >        foreach d (cv cal gen util px renders)
30 >                cd $d
31 >                make -k clean all && make clean
32 >                if ($status) set fails=($fails $d)
33 >                cd ..
34 >        end
35 >        if ($#fails) then
36 >                echo "Unit tests failed in $#fails directories"
37 >                echo "Run 'make' manually in test/ subfolders: $fails"
38 >                exit 1
39 >        endif
40 >        echo "All tests passed successfully."
41 >        exit 0
42 > endif
43 > set srcdirs=( common rt meta cv gen ot px hd util cal )
44   if ( "$1" == install ) then
45          cat << _EOF_
46  
# Line 50 | Line 66 | again1:
66   echo -n "Where do you want the executables [/usr/local/bin]? "
67   set idir=$<
68   (echo $idir) >/dev/null
69 < if ( $status ) goto again1
69 > if ( $status ) then
70 >        goto again1
71 > endif
72   set idir=$idir
73   if ( "$idir" == "" ) then
74          set idir=/usr/local/bin
# Line 65 | Line 83 | if ( ! -d $idir ) then
83                  goto again1
84          endif
85   endif
86 < if ( ! -d $idir/dev ) then
87 <        mkdir $idir/dev
88 <        if ( $status ) then
89 <                echo "Cannot create subdirectory, please reenter"
90 <                goto again1
86 > set inpath=0
87 > foreach i ( $path )
88 >        if ( "$i" == "$idir" ) then
89 >                set inpath=1
90 >                break
91          endif
92 < endif
92 > end
93   set rmake=$idir/rmake
94 < if ( "`ls -tL $rmake $0 |& head -1`" == $rmake ) goto gotrmake
94 > if ( "`ls -tL $rmake $0 |& head -1`" == $rmake ) then
95 >        goto gotrmake
96 > endif
97   set newrmake
98 < goto skiplicense
79 < cat << _EOF_
80 <
81 <                     RADIANCE LICENSE AGREEMENT
82 <
83 < Radiance is a registered copyright of The Regents of the University of
84 < California ("The Regents"). The Regents grant to you a nonexclusive,
85 < nontransferable license ("License") to use Radiance source code without
86 < fee.  You may not sell or distribute Radiance to others without the
87 < prior express written permission of The Regents.  You may compile and
88 < use this software on any machines to which you have personal access,
89 < and may share its use with others who have access to the same machines.
90 <
91 < NEITHER THE UNITED STATES NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY
92 < OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
93 < LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS
94 < OF ANY INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS
95 < THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.  By downloading, using
96 < or copying this software, you agree to abide by the intellectual property laws
97 < and all other applicable laws of the United States, and by the terms of this
98 < License Agreement. Ownership of the software shall remain solely in The
99 < Regents.  The Regents shall have the right to terminate this License
100 < immediately by written notice upon your breach of, or noncompliance with, any
101 < of its terms.  You shall be liable for any infringement or damages resulting
102 < from your failure to abide by the terms of this License Agreement.
103 <
104 < _EOF_
98 > more License.txt
99   echo -n "Do you understand and accept the terms of this agreement [n]? "
100   set ans="$<"
101   if ( "$ans" !~ [yY]* ) exit
108 echo -n "Are you a new Radiance user or with a new address [y]? "
109 set ans="$<"
110 if ( "$ans" !~ [nN]* ) then
111        csh -f newuser
112 else
113        echo `cat src/rt/VERSION` compiled by `whoami` | mail [email protected]
114 endif
115 skiplicense:
102   set special=
103   set arch=
104   set opt=
105   set mach=
106   set compat=
107   set extras=
108 + set esuffix=
109   cat << _EOF_
110  
111   Please select your system type from the following list:
112  
113          1)      Sun Solaris
114 <        2)      HP workstation
115 <        3)      Silicon Graphics
116 <        4)      AIX (RS/6000)
117 <        5)      BSDI BSD/386
118 <        6)      Linux
132 <        7)      MacOS X
133 <        8)      FreeBSD
134 <        9)      Other
114 >        2)      Linux
115 >        3)      MacOS X
116 >        4)      FreeBSD
117 >        5)      Cygwin
118 >        6)      Other
119  
120   _EOF_
121   echo -n "Choice? "
# Line 139 | Line 123 | set arch="$<"
123   switch ("$arch")
124   case 1:                 # SPARC Station
125          set arch=sun
126 <        if ( `uname -r` =~ 4.* ) then
127 <                set mach="-fsingle -DBSD /usr/lib/libm.il -I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO"
128 <                set opt="-O -pipe -DSPEED=12"
145 <                set special="sun"
146 <                set compat="bmalloc.o strcmp.o"
147 <        else
148 <                set mach="-I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO"
149 <                set opt="-O -DSPEED=80"
150 <                set special="ogl"
151 <                set compat="bmalloc.o strcmp.o getpagesize.o"
152 <        endif
126 >        set mach="-I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO"
127 >        set opt="-O"
128 >        set compat="strcmp.o timegm.o"
129          breaksw
130 < case 2:                 # HP workstation
131 <        set mach=""
132 <        set opt="-O -DSPEED=80 -Aa -D_HPUX_SOURCE"
133 <        set compat="malloc.o getpagesize.o strcmp.o"
134 <        set arch=hpux
130 > case 2:                 # Linux
131 >        set mach="-Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO"
132 >        set opt="-O2"
133 >        set arch=IBMPC
134 >        set compat="strlcpy.o"
135 >        set extras=CC=gcc
136          breaksw
137 < case 3:                 # Silicon Graphics
138 <        set arch=sgi
139 <        switch (`uname -r`)
140 <        case 3.*:
141 <                set mach="-noprototypes"
142 <                set opt="-O -DSPEED=80"
166 <                set special="sgi"
167 <                set compat="malloc.o strcmp.o"
168 <                breaksw
169 <        case 4.*:
170 <                set mach=""
171 <                set opt="-O2 -DSPEED=100"
172 <                set compat="malloc.o strcmp.o"
173 <                set extras='"MLIB=-lfastm -lm"'
174 <                breaksw
175 <        default:        # 5.x or later
176 <                ln -s `which wish` $idir/wish4.0
177 <                set path=($idir $path)
178 <                set mach="-w"
179 <                set opt="-O2 -DSPEED=200"
180 <                set special="ogl"
181 <                set compat="malloc.o strcmp.o"
182 <                breaksw
183 <        endsw
137 > case 3:                 # MacOS X
138 >        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
139 >        set opt="-O2"
140 >        set arch=Intel
141 >        set extras="CC=cc CONFIGURE_ARCH=i386"
142 >        set special="ogl"
143          breaksw
144 < case 4:                 # AIX
145 <        set mach="-Dvoid=char -D_NO_PROTO -DINCL_SEL_H"
144 > case 4:                 # FreeBSD
145 >        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
146          set opt="-O"
147 <        set compat="bmalloc.o erf.o"
148 <        breaksw
190 < case 5:                 # BSDI BSD/386
191 <        set mach="-DBSD -L/usr/X11/lib -I/usr/X11/include"
192 <        set opt="-O -DSPEED=100"
147 >        set compat="erf.o"
148 >        set extras='CC=cc MLIB="-lcompat -lm"'
149          set arch=IBMPC
194        set compat="malloc.o erf.o strcmp.o"
150          breaksw
151 < case 6:                 # Linux
152 <        set mach="-Dlinux -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO"
153 <        set opt="-O2 -DSPEED=200"
151 > case 5:                 # Cygwin
152 >        set mach="-Dfreebsd -L/usr/lib -L/usr/X11R6/lib -I/usr/include/X11 -I/usr/X11R6/include -DNOSTEREO"
153 >        set opt="-O2"
154          set arch=IBMPC
155 <        set compat="bmalloc.o erf.o getpagesize.o"
156 <        set extras=CC=gcc
202 <        breaksw
203 < case 7:                # MacOS X
204 <        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
205 <        set opt="-O2 -DSPEED=200"
206 <        set arch=PowerPC
207 <        set compat="bmalloc.o"
208 <        set extras="CC=cc CONFIGURE_ARCH=powerpc"
155 >        set compat="erf.o strlcpy.o"
156 >        set extras="CC=gcc"
157          set special="ogl"
158 <        breaksw
159 < case 8:                 # FreeBSD
160 <        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
213 <        set opt="-O -DSPEED=200"
214 <        set compat="bmalloc.o erf.o"
215 <        set extras="CC=cc"
216 <        set arch=IBMPC
217 <        breaksw
218 < case 9:                 # Other
158 >        set esuffix=".exe"
159 >        breaksw
160 > case 6:                 # Other
161          set opt="-O"
162 <        set compat="bmalloc.o erf.o strcmp.o"
162 >        set compat="erf.o strcmp.o strlcpy.o"
163          echo -n "Are you using the GNU C compiler [n]? "
164          if ( "$<" =~ [yY]* ) then
165                  set extras="CC=gcc"
166 +        else
167 +                set compat="$compat timegm.o"
168          endif
169 +        set arch=other
170          breaksw
171   default:
172          echo "Illegal choice\!"
# Line 229 | Line 174 | default:
174          exit 1
175          breaksw
176   endsw
232 # We don't seem to have any more cramped machines out there, so...
233 set mem="-DBIGMEM"
234 if ( $?mem ) then
235        set mach="$mach $mem"
236 else
237        echo -n "Does the target machine have more than 24 Mbytes of RAM? "
238        set ans="$<"
239        if ( "$ans" =~ [yY]* ) then
240                echo -n "More than 96 Mbytes? "
241                set ans="$<"
242                if ( "$ans" =~ [yY]* ) then
243                        set mach="$mach -DBIGMEM"
244                        set sizemod="huge models (100,000+ surfaces)"
245                else
246                        set sizemod="very large models (30,000+ surfaces)"
247                endif
248        else
249                set sizemod="large models (10,000+ surfaces)"
250        endif
251 endif
252 # echo "Do you expect to be rendering $sizemod?"
253 # echo -n '(Answering "yes" may adversly affect rendering time and geometric accuracy) '
254 # set ans="$<"
255 # if ( "$ans" =~ [yY]* ) then
256 #       set opt="$opt -DSMLFLT"
257 # endif
258 # echo -n "Do you have X10 support [n]? "
259 # if ( "$<" =~ [yY]* ) then
260 #       set special="$special x10"
261 # endif
177   source installib
178   sed 's/[        ]*$//' > $rmake << _EOF_
179   #!/bin/sh
# Line 268 | Line 183 | exec make "SPECIAL=$special" \
183          ARCH=$arch "COMPAT=$compat" \
184          INSTDIR=$idir \
185          LIBDIR=$ldir \
186 +        ESUFFIX=$esuffix \
187          $extras "\$@" -f Rmakefile
188   _EOF_
189   chmod 755 $rmake
# Line 306 | Line 222 | else
222          echo "Done."
223   endif
224   cd ..
225 < if (! -d /usr/tmp) then
226 <        ln -s /tmp /usr/tmp
227 <        if ($status) then
228 <                echo ""
229 <                echo "IMPORTANT: Execute 'sudo ln -s /tmp /usr/tmp'"
230 <                echo ""
231 <        endif
225 > if (! $inpath ) then
226 >        echo ""
227 >        echo "Add $idir to the beginning of your execution path:"
228 >        echo 'For C-shell users, put the following into ~/.cshrc'
229 >        echo "  set path=( $idir "'$path )'
230 >        echo 'For Bourne shell users, put the following into $HOME/.profile'
231 >        echo "  PATH=$idir"':$PATH'
232 >        echo "  export PATH"
233   endif
234   else
235   cd src
# Line 322 | Line 239 | foreach i ( $srcdirs )
239          make -f Rmakefile $*
240          popd
241   end
325 echo "Done."
242   cd ..
327 endif
243   foreach i ( $* )
244          if ( "$i" == clean ) then
245                  echo "Removing library archives..."
246 <                rm -f src/lib/*.a
246 >                rm -f src/lib/*.{a,o,la}
247          endif
248   end
249 + echo "Done."
250 + endif
251   exit 0

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines