The R Project SVN R

Rev

Rev 7357 | Rev 8653 | 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
 
7699 hornik 7
revision='$Revision: 1.6 $'
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
14
library using \`R SHLIB'.  Currently, only C and Fortran files (with
15
extensions \`.c' and \`.f', respectively, are supported.
16
 
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.
23
 
24
Report bugs to <R-bugs@lists.r-project.org>."
25
 
2195 hornik 26
MAKE=${MAKE-@MAKE@}
7699 hornik 27
makefiles="-f ${R_HOME}/etc/Makeconf"
28
if test -r Makevars; then
29
  makefiles="-f Makevars ${makefiles}"
30
fi
3076 pd 31
if test -r Makefile; then
7699 hornik 32
  makefiles="${makefiles} -f Makefile"
3076 pd 33
fi
34
 
7357 hornik 35
objs=
36
while test -n "${1}"; do
37
  case ${1} in
38
    -h|--help)
39
      echo "${usage}"; exit 0 ;;
40
    -v|--version)
41
      echo "${version}"; exit 0 ;;
3076 pd 42
    *.[cf])
7357 hornik 43
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
2195 hornik 44
    -D*|*=*)
7357 hornik 45
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
2195 hornik 46
    *)
7357 hornik 47
      echo "ERROR: don't know how to compile \`${1}'"
2195 hornik 48
      exit 1
49
      ;;
50
  esac
7357 hornik 51
  shift
2195 hornik 52
done
53
 
7357 hornik 54
${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}
3076 pd 55
 
2195 hornik 56
### Local Variables: ***
57
### mode: sh ***
7218 hornik 58
### sh-indentation: 2 ***
2195 hornik 59
### End: ***