The R Project SVN R

Rev

Rev 10633 | Rev 11515 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2195 hornik 1
#!/bin/sh
2
#
4580 hornik 3
# ${R_HOME}/bin/COMPILE
2195 hornik 4
 
5
# @configure_input@
6
 
11258 hornik 7
revision='$Revision: 1.9 $'
7357 hornik 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
11258 hornik 14
library using \`R SHLIB'.  Currently, C, C++, and Fortran files (with
15
extensions \`.c', \`.cc' or \`.cpp' or \`.C', and \`.f', respectively,
16
are supported.
7357 hornik 17
 
18
Options:
19
  -h, --help		print short help message and exit
20
  -v, --version		print version info and exit
21
 
22
Other options of the form \`-DMACRO' or \`VAR=VALUE' are passed on to
23
the compilation.
24
 
10633 hornik 25
Report bugs to <r-bugs@r-project.org>."
7357 hornik 26
 
2195 hornik 27
MAKE=${MAKE-@MAKE@}
7699 hornik 28
makefiles="-f ${R_HOME}/etc/Makeconf"
29
if test -r Makevars; then
30
  makefiles="-f Makevars ${makefiles}"
31
fi
3076 pd 32
if test -r Makefile; then
7699 hornik 33
  makefiles="${makefiles} -f Makefile"
3076 pd 34
fi
35
 
7357 hornik 36
objs=
37
while test -n "${1}"; do
38
  case ${1} in
39
    -h|--help)
40
      echo "${usage}"; exit 0 ;;
41
    -v|--version)
42
      echo "${version}"; exit 0 ;;
11258 hornik 43
    *.[cfC]|*.cc|*.cpp)
7357 hornik 44
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
2195 hornik 45
    -D*|*=*)
7357 hornik 46
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
2195 hornik 47
    *)
7357 hornik 48
      echo "ERROR: don't know how to compile \`${1}'"
2195 hornik 49
      exit 1
50
      ;;
51
  esac
7357 hornik 52
  shift
2195 hornik 53
done
54
 
7357 hornik 55
${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}
3076 pd 56
 
2195 hornik 57
### Local Variables: ***
58
### mode: sh ***
7218 hornik 59
### sh-indentation: 2 ***
2195 hornik 60
### End: ***