The R Project SVN R

Rev

Details | 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
 
11515 hornik 7
revision='$Revision: 1.10 $'
7357 hornik 8
version=`set - ${revision}; echo ${2}`
11515 hornik 9
version="R compilation front end ${version}
7357 hornik 10
 
11515 hornik 11
Copyright (C) 2000 The R Core Development Team.
12
This is free software; see the GNU General Public Licence version 2
13
or later for copying conditions.  There is NO warranty."
7357 hornik 14
 
11515 hornik 15
usage="Usage: R CMD COMPILE [options] files
16
 
7357 hornik 17
Compile the specified files for subsequent collection into a shared
11515 hornik 18
library using \`R CMD SHLIB'.  Currently, C, C++, and FORTRAN files
19
(with extensions \`.c', \`.cc' or \`.cpp' or \`.C', and \`.f',
20
respectively, are supported.
7357 hornik 21
 
22
Options:
23
  -h, --help		print short help message and exit
24
  -v, --version		print version info and exit
25
 
26
Other options of the form \`-DMACRO' or \`VAR=VALUE' are passed on to
27
the compilation.
28
 
10633 hornik 29
Report bugs to <r-bugs@r-project.org>."
7357 hornik 30
 
2195 hornik 31
MAKE=${MAKE-@MAKE@}
7699 hornik 32
makefiles="-f ${R_HOME}/etc/Makeconf"
33
if test -r Makevars; then
34
  makefiles="-f Makevars ${makefiles}"
35
fi
3076 pd 36
if test -r Makefile; then
7699 hornik 37
  makefiles="${makefiles} -f Makefile"
3076 pd 38
fi
39
 
7357 hornik 40
objs=
41
while test -n "${1}"; do
42
  case ${1} in
43
    -h|--help)
44
      echo "${usage}"; exit 0 ;;
45
    -v|--version)
46
      echo "${version}"; exit 0 ;;
11258 hornik 47
    *.[cfC]|*.cc|*.cpp)
7357 hornik 48
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
2195 hornik 49
    -D*|*=*)
7357 hornik 50
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
2195 hornik 51
    *)
7357 hornik 52
      echo "ERROR: don't know how to compile \`${1}'"
2195 hornik 53
      exit 1
54
      ;;
55
  esac
7357 hornik 56
  shift
2195 hornik 57
done
58
 
7357 hornik 59
${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}
3076 pd 60
 
2195 hornik 61
### Local Variables: ***
62
### mode: sh ***
7218 hornik 63
### sh-indentation: 2 ***
2195 hornik 64
### End: ***