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.5 by greg, Thu May 15 05:13:35 2003 UTC vs.
Revision 1.32 by greg, Tue Dec 3 01:11:43 2024 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 67 | 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 ) then
95          goto gotrmake
96   endif
97   set newrmake
98 < goto skiplicense
83 < cat << _EOF_
84 <
85 <                     RADIANCE LICENSE AGREEMENT
86 <
87 < Radiance is a registered copyright of The Regents of the University of
88 < California ("The Regents"). The Regents grant to you a nonexclusive,
89 < nontransferable license ("License") to use Radiance source code without
90 < fee.  You may not sell or distribute Radiance to others without the
91 < prior express written permission of The Regents.  You may compile and
92 < use this software on any machines to which you have personal access,
93 < and may share its use with others who have access to the same machines.
94 <
95 < NEITHER THE UNITED STATES NOR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY
96 < OF THEIR EMPLOYEES, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY
97 < LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR USEFULNESS
98 < OF ANY INFORMATION, APPARATUS, PRODUCT, OR PROCESS DISCLOSED, OR REPRESENTS
99 < THAT ITS USE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.  By downloading, using
100 < or copying this software, you agree to abide by the intellectual property laws
101 < and all other applicable laws of the United States, and by the terms of this
102 < License Agreement. Ownership of the software shall remain solely in The
103 < Regents.  The Regents shall have the right to terminate this License
104 < immediately by written notice upon your breach of, or noncompliance with, any
105 < of its terms.  You shall be liable for any infringement or damages resulting
106 < from your failure to abide by the terms of this License Agreement.
107 <
108 < _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
112 echo -n "Are you a new Radiance user or with a new address [y]? "
113 set ans="$<"
114 if ( "$ans" !~ [nN]* ) then
115        csh -f newuser
116 else
117        echo `cat src/rt/VERSION` compiled by `whoami` | mail [email protected]
118 endif
119 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
135 <        6)      Linux
136 <        7)      MacOS X
137 <        8)      FreeBSD
138 <        9)      Other
113 >        1)      Linux
114 >        2)      MacOS X
115 >        3)      FreeBSD
116 >        4)      Cygwin
117 >        5)      Other
118  
119   _EOF_
120   echo -n "Choice? "
121   set arch="$<"
122   switch ("$arch")
123 < case 1:                 # SPARC Station
124 <        set arch=sun
125 <        set mach="-I/usr/openwin/include -L/usr/openwin/lib -DNOSTEREO"
126 <        set opt="-O -DSPEED=80"
127 <        set compat="bmalloc.o strcmp.o getpagesize.o"
123 > case 1:                 # Linux
124 >        set mach="-Dlinux -D_FILE_OFFSET_BITS=64 -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO"
125 >        set opt="-O2"
126 >        set arch=IBMPC
127 >        set compat="strnstr.o strlcpy.o"
128 >        set extras=CC=gcc
129          breaksw
130 < case 2:                 # HP workstation
131 <        set mach=""
132 <        set opt="-O -DSPEED=80 -Aa -D_HPUX_SOURCE"
133 <        set compat="bmalloc.o getpagesize.o strcmp.o"
134 <        set arch=hpux
130 > case 2:                 # MacOS X
131 >        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
132 >        set opt="-O2"
133 >        set arch=Intel
134 >        set extras="CC=cc CONFIGURE_ARCH=i386"
135 >        set special="ogl"
136          breaksw
137 < case 3:                 # Silicon Graphics
138 <        set arch=sgi
158 <        switch (`uname -r`)
159 <        case 3.*:
160 <                set mach="-noprototypes"
161 <                set opt="-O -DSPEED=80"
162 <                set special="sgi"
163 <                set compat="malloc.o strcmp.o"
164 <                breaksw
165 <        case 4.*:
166 <                set mach=""
167 <                set opt="-O2 -DSPEED=100"
168 <                set compat="malloc.o strcmp.o"
169 <                set extras='"MLIB=-lfastm -lm"'
170 <                breaksw
171 <        default:        # 5.x or later
172 <                ln -s `which wish` $idir/wish4.0
173 <                set path=($idir $path)
174 <                set mach="-w"
175 <                set opt="-O2 -DSPEED=200"
176 <                set special="ogl"
177 <                set compat="bmalloc.o strcmp.o"
178 <                breaksw
179 <        endsw
180 <        breaksw
181 < case 4:                 # AIX
182 <        set mach="-Dvoid=char -DNOPROTO -DINCL_SEL_H"
137 > case 3:                 # FreeBSD
138 >        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
139          set opt="-O"
140 <        set compat="bmalloc.o erf.o"
141 <        breaksw
186 < case 5:                 # BSDI BSD/386
187 <        set mach="-DBSD -L/usr/X11/lib -I/usr/X11/include"
188 <        set opt="-O -DSPEED=100"
140 >        set compat="erf.o"
141 >        set extras='CC=cc MLIB="-lcompat -lm"'
142          set arch=IBMPC
190        set compat="malloc.o erf.o strcmp.o"
143          breaksw
144 < case 6:                 # Linux
145 <        set mach="-Dlinux -L/usr/X11R6/lib -I/usr/include/X11 -DNOSTEREO"
146 <        set opt="-O2 -DSPEED=200"
144 > case 4:                 # Cygwin
145 >        set mach="-Dfreebsd -L/usr/lib -L/usr/X11R6/lib -I/usr/include/X11 -I/usr/X11R6/include -DNOSTEREO"
146 >        set opt="-O2"
147          set arch=IBMPC
148 <        set compat="bmalloc.o erf.o getpagesize.o"
149 <        set extras=CC=gcc
198 <        breaksw
199 < case 7:                # MacOS X
200 <        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
201 <        set opt="-O2 -DSPEED=200"
202 <        set arch=PowerPC
203 <        set compat="bmalloc.o"
204 <        set extras="CC=cc CONFIGURE_ARCH=powerpc"
148 >        set compat="erf.o strnstr.o strlcpy.o"
149 >        set extras="CC=gcc"
150          set special="ogl"
151 <        breaksw
152 < case 8:                 # FreeBSD
153 <        set mach="-DBSD -DNOSTEREO -Dfreebsd -I/usr/X11R6/include -L/usr/X11R6/lib"
209 <        set opt="-O -DSPEED=200"
210 <        set compat="bmalloc.o erf.o"
211 <        set extras="CC=cc"
212 <        set arch=IBMPC
213 <        breaksw
214 < case 9:                 # Other
151 >        set esuffix=".exe"
152 >        breaksw
153 > case 5:                 # Other
154          set opt="-O"
155 <        set compat="bmalloc.o erf.o strcmp.o"
155 >        set compat="erf.o strcmp.o strnstr.o strlcpy.o"
156          echo -n "Are you using the GNU C compiler [n]? "
157          if ( "$<" =~ [yY]* ) then
158                  set extras="CC=gcc"
159 +        else
160 +                set compat="$compat timegm.o"
161          endif
162 +        set arch=other
163          breaksw
164   default:
165          echo "Illegal choice\!"
# Line 234 | Line 176 | exec make "SPECIAL=$special" \
176          ARCH=$arch "COMPAT=$compat" \
177          INSTDIR=$idir \
178          LIBDIR=$ldir \
179 +        ESUFFIX=$esuffix \
180          $extras "\$@" -f Rmakefile
181   _EOF_
182   chmod 755 $rmake
# Line 272 | Line 215 | else
215          echo "Done."
216   endif
217   cd ..
218 < if (! -d /usr/tmp) then
219 <        ln -s /tmp /usr/tmp
220 <        if ($status) then
221 <                echo ""
222 <                echo "IMPORTANT: Execute 'sudo ln -s /tmp /usr/tmp'"
223 <                echo ""
224 <        endif
218 > if (! $inpath ) then
219 >        echo ""
220 >        echo "Add $idir to the beginning of your execution path:"
221 >        echo 'For C-shell users, put the following into ~/.cshrc'
222 >        echo "  set path=( $idir "'$path )'
223 >        echo 'For Bourne shell users, put the following into $HOME/.profile'
224 >        echo "  PATH=$idir"':$PATH'
225 >        echo "  export PATH"
226   endif
227   else
228   cd src
# Line 288 | Line 232 | foreach i ( $srcdirs )
232          make -f Rmakefile $*
233          popd
234   end
291 echo "Done."
235   cd ..
293 endif
236   foreach i ( $* )
237          if ( "$i" == clean ) then
238                  echo "Removing library archives..."
239 <                rm -f src/lib/*.[ao]
239 >                rm -f src/lib/*.{a,o,la}
240          endif
241   end
242 + echo "Done."
243 + endif
244   exit 0

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines