The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
46821 ripley 1
#!@R_SHELL@
2195 hornik 2
#
4580 hornik 3
# ${R_HOME}/bin/COMPILE
2195 hornik 4
 
5
# @configure_input@
6
 
37351 ripley 7
revision='$Rev: 46994 $'
7357 hornik 8
version=`set - ${revision}; echo ${2}`
11515 hornik 9
version="R compilation front end ${version}
7357 hornik 10
 
40010 hornik 11
Copyright (C) 2000-2006 The R Core Development Team.
42192 ripley 12
This is free software; see the GNU General Public License version 2 or
20002 hornik 13
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
40010 hornik 18
library using 'R CMD SHLIB'.  Currently, the following languages with
19
associated source file extensions are supported (provided that the
20
respective compilers are available and R was configured to use these):
21
C ('.c'), C++ ('.cc' or '.cpp' or '.C'), FORTRAN 77 ('.f'), FORTRAN 90
22
('.f90'), FORTRAN 95 ('.f95'), Objective C ('.m'), and Objective C++
23
('.M' or '.mm').
7357 hornik 24
 
25
Options:
26
  -h, --help		print short help message and exit
31770 ripley 27
  -v, --version		print COMPILE version info and exit
7357 hornik 28
 
20002 hornik 29
Other options of the form '-DMACRO' or 'VAR=VALUE' are passed on to the
30
compilation.
7357 hornik 31
 
10633 hornik 32
Report bugs to <r-bugs@r-project.org>."
7357 hornik 33
 
38758 urbaneks 34
makefiles="-f \"${R_HOME}/etc${R_ARCH}/Makeconf\""
33112 hornik 35
if test -r "${HOME}/.R/Makevars-${R_PLATFORM}"; then
36
  makefiles="${makefiles} -f \"${HOME}/.R/Makevars-${R_PLATFORM}\""
37
elif test -r "${HOME}/.R/Makevars"; then
38
  makefiles="${makefiles} -f \"${HOME}/.R/Makevars\""
31722 hornik 39
fi
7699 hornik 40
if test -r Makevars; then
41
  makefiles="-f Makevars ${makefiles}"
42
fi
3076 pd 43
 
7357 hornik 44
objs=
45
while test -n "${1}"; do
46
  case ${1} in
47
    -h|--help)
48
      echo "${usage}"; exit 0 ;;
49
    -v|--version)
50
      echo "${version}"; exit 0 ;;
40010 hornik 51
    *.[cfmCM]|*.cc|*.cpp|*.f90|*.f95|*.mm)
7357 hornik 52
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
15421 hornik 53
    -D*)
7357 hornik 54
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
15421 hornik 55
    *=*)
56
      argn=`echo "${1}" | sed -e 's/=.*//'`
57
      argv=`echo "${1}" | \
46994 ripley 58
	sed -e 's/[^=]*=//; s/^\\"//; s/\\"$//; s/\\"/\\\\"/g'`
15421 hornik 59
      MAKEFLAGS="${MAKEFLAGS} ${argn}=\"${argv}\""
60
      ;;
2195 hornik 61
    *)
20002 hornik 62
      echo "ERROR: don't know how to compile '${1}'"
2195 hornik 63
      exit 1
64
      ;;
65
  esac
7357 hornik 66
  shift
2195 hornik 67
done
68
 
15421 hornik 69
eval "${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}"
3076 pd 70
 
2195 hornik 71
### Local Variables: ***
72
### mode: sh ***
7218 hornik 73
### sh-indentation: 2 ***
2195 hornik 74
### End: ***