The R Project SVN R

Rev

Rev 17371 | Rev 29654 | 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
 
20002 hornik 7
revision='$Revision: 1.14 $'
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.
20002 hornik 12
This is free software; see the GNU General Public Licence version 2 or
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
20002 hornik 18
library using 'R CMD SHLIB'.  Currently, C, C++, and FORTRAN files
19
(with extensions '.c', '.cc' or '.cpp' or '.C', and '.f', respectively),
20
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
 
20002 hornik 26
Other options of the form '-DMACRO' or 'VAR=VALUE' are passed on to the
27
compilation.
7357 hornik 28
 
10633 hornik 29
Report bugs to <r-bugs@r-project.org>."
7357 hornik 30
 
17371 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
 
7357 hornik 37
objs=
38
while test -n "${1}"; do
39
  case ${1} in
40
    -h|--help)
41
      echo "${usage}"; exit 0 ;;
42
    -v|--version)
43
      echo "${version}"; exit 0 ;;
11258 hornik 44
    *.[cfC]|*.cc|*.cpp)
7357 hornik 45
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
15421 hornik 46
    -D*)
7357 hornik 47
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
15421 hornik 48
    *=*)
49
      argn=`echo "${1}" | sed -e 's/=.*//'`
50
      argv=`echo "${1}" | \
51
        sed -e 's/[^=]*=//; s/^\\"//; s/\\"$//; s/\\"/\\\\"/g'`
52
      MAKEFLAGS="${MAKEFLAGS} ${argn}=\"${argv}\""
53
      ;;
2195 hornik 54
    *)
20002 hornik 55
      echo "ERROR: don't know how to compile '${1}'"
2195 hornik 56
      exit 1
57
      ;;
58
  esac
7357 hornik 59
  shift
2195 hornik 60
done
61
 
15421 hornik 62
eval "${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}"
3076 pd 63
 
2195 hornik 64
### Local Variables: ***
65
### mode: sh ***
7218 hornik 66
### sh-indentation: 2 ***
2195 hornik 67
### End: ***