The R Project SVN R

Rev

Rev 7218 | Rev 7699 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7218 Rev 7357
Line 2... Line 2...
2
#
2
#
3
# ${R_HOME}/bin/COMPILE
3
# ${R_HOME}/bin/COMPILE
4
 
4
 
5
# @configure_input@
5
# @configure_input@
6
 
6
 
7
MAKE=${MAKE-@MAKE@}
7
revision='$Revision: 1.5 $'
-
 
8
version=`set - ${revision}; echo ${2}`
-
 
9
version="R compilation front end ${version}"
-
 
10
 
-
 
11
usage="Usage: R COMPILE [options] files
-
 
12
 
-
 
13
Compile the specified files for subsequent collection into a shared
-
 
14
library using \`R SHLIB'.  Currently, only C and Fortran files (with
-
 
15
extensions \`.c' and \`.f', respectively, are supported.
-
 
16
 
8
MAKEOPTS=
17
Options:
-
 
18
  -h, --help		print short help message and exit
-
 
19
  -v, --version		print version info and exit
-
 
20
 
-
 
21
Other options of the form \`-DMACRO' or \`VAR=VALUE' are passed on to
-
 
22
the compilation.
9
 
23
 
-
 
24
Report bugs to <R-bugs@lists.r-project.org>."
-
 
25
 
-
 
26
MAKE=${MAKE-@MAKE@}
10
if test -r Makefile; then
27
if test -r Makefile; then
11
  MAKEFILES="-f ${R_HOME}/etc/Makeconf -f Makefile"
28
  makefiles="-f ${R_HOME}/etc/Makeconf -f Makefile"
12
else
29
else
13
  MAKEFILES="-f ${R_HOME}/etc/Makeconf"
30
  makefiles="-f ${R_HOME}/etc/Makeconf"
14
fi
31
fi
15
 
32
 
16
OBJS=
33
objs=
17
 
-
 
18
for i in ${*}; do
34
while test -n "${1}"; do
19
  case ${i} in
35
  case ${1} in
-
 
36
    -h|--help)
-
 
37
      echo "${usage}"; exit 0 ;;
-
 
38
    -v|--version)
-
 
39
      echo "${version}"; exit 0 ;;
20
    *.[cf])
40
    *.[cf])
21
      OBJS="${OBJS} `echo ${i} | sed 's/\.[^\.][^\.]*$/.o/'`"
41
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
22
      ;;
-
 
23
    -D*|*=*)
42
    -D*|*=*)
24
      MAKEOPTS="${MAKEOPTS} ${i}"
43
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
25
      ;;
-
 
26
    *)
44
    *)
27
      echo "ERROR:  don't know how to compile ${i}"
45
      echo "ERROR: don't know how to compile \`${1}'"
28
      exit 1
46
      exit 1
29
      ;;
47
      ;;
30
  esac
48
  esac
-
 
49
  shift
31
done
50
done
32
 
51
 
33
${MAKE} ${MAKEFILES} ${MAKEOPTS} ${OBJS}
52
${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}
34
 
53
 
35
### Local Variables: ***
54
### Local Variables: ***
36
### mode: sh ***
55
### mode: sh ***
37
### sh-indentation: 2 ***
56
### sh-indentation: 2 ***
38
### End: ***
57
### End: ***