The R Project SVN R

Rev

Rev 7218 | Rev 7699 | 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
 
7357 hornik 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
 
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@}
3076 pd 27
if test -r Makefile; then
7357 hornik 28
  makefiles="-f ${R_HOME}/etc/Makeconf -f Makefile"
3076 pd 29
else
7357 hornik 30
  makefiles="-f ${R_HOME}/etc/Makeconf"
3076 pd 31
fi
32
 
7357 hornik 33
objs=
34
while test -n "${1}"; do
35
  case ${1} in
36
    -h|--help)
37
      echo "${usage}"; exit 0 ;;
38
    -v|--version)
39
      echo "${version}"; exit 0 ;;
3076 pd 40
    *.[cf])
7357 hornik 41
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
2195 hornik 42
    -D*|*=*)
7357 hornik 43
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
2195 hornik 44
    *)
7357 hornik 45
      echo "ERROR: don't know how to compile \`${1}'"
2195 hornik 46
      exit 1
47
      ;;
48
  esac
7357 hornik 49
  shift
2195 hornik 50
done
51
 
7357 hornik 52
${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}
3076 pd 53
 
2195 hornik 54
### Local Variables: ***
55
### mode: sh ***
7218 hornik 56
### sh-indentation: 2 ***
2195 hornik 57
### End: ***