The R Project SVN R

Rev

Rev 10633 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10633 Rev 11258
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# ${R_HOME}/bin/COMPILE
3
# ${R_HOME}/bin/COMPILE
4
 
4
 
5
# @configure_input@
5
# @configure_input@
6
 
6
 
7
revision='$Revision: 1.8 $'
7
revision='$Revision: 1.9 $'
8
version=`set - ${revision}; echo ${2}`
8
version=`set - ${revision}; echo ${2}`
9
version="R compilation front end ${version}"
9
version="R compilation front end ${version}"
10
 
10
 
11
usage="Usage: R COMPILE [options] files
11
usage="Usage: R COMPILE [options] files
12
 
12
 
13
Compile the specified files for subsequent collection into a shared
13
Compile the specified files for subsequent collection into a shared
14
library using \`R SHLIB'.  Currently, only C and Fortran files (with
14
library using \`R SHLIB'.  Currently, C, C++, and Fortran files (with
15
extensions \`.c' and \`.f', respectively, are supported.
15
extensions \`.c', \`.cc' or \`.cpp' or \`.C', and \`.f', respectively,
-
 
16
are supported.
16
 
17
 
17
Options:
18
Options:
18
  -h, --help		print short help message and exit
19
  -h, --help		print short help message and exit
19
  -v, --version		print version info and exit
20
  -v, --version		print version info and exit
20
 
21
 
21
Other options of the form \`-DMACRO' or \`VAR=VALUE' are passed on to
22
Other options of the form \`-DMACRO' or \`VAR=VALUE' are passed on to
22
the compilation.
23
the compilation.
23
 
24
 
24
Report bugs to <r-bugs@r-project.org>."
25
Report bugs to <r-bugs@r-project.org>."
25
 
26
 
26
MAKE=${MAKE-@MAKE@}
27
MAKE=${MAKE-@MAKE@}
27
makefiles="-f ${R_HOME}/etc/Makeconf"
28
makefiles="-f ${R_HOME}/etc/Makeconf"
28
if test -r Makevars; then
29
if test -r Makevars; then
29
  makefiles="-f Makevars ${makefiles}"
30
  makefiles="-f Makevars ${makefiles}"
30
fi
31
fi
31
if test -r Makefile; then
32
if test -r Makefile; then
32
  makefiles="${makefiles} -f Makefile"
33
  makefiles="${makefiles} -f Makefile"
33
fi
34
fi
34
 
35
 
35
objs=
36
objs=
36
while test -n "${1}"; do
37
while test -n "${1}"; do
37
  case ${1} in
38
  case ${1} in
38
    -h|--help)
39
    -h|--help)
39
      echo "${usage}"; exit 0 ;;
40
      echo "${usage}"; exit 0 ;;
40
    -v|--version)
41
    -v|--version)
41
      echo "${version}"; exit 0 ;;
42
      echo "${version}"; exit 0 ;;
42
    *.[cf]|*.cc)
43
    *.[cfC]|*.cc|*.cpp)
43
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
44
      objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
44
    -D*|*=*)
45
    -D*|*=*)
45
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
46
      MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
46
    *)
47
    *)
47
      echo "ERROR: don't know how to compile \`${1}'"
48
      echo "ERROR: don't know how to compile \`${1}'"
48
      exit 1
49
      exit 1
49
      ;;
50
      ;;
50
  esac
51
  esac
51
  shift
52
  shift
52
done
53
done
53
 
54
 
54
${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}
55
${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}
55
 
56
 
56
### Local Variables: ***
57
### Local Variables: ***
57
### mode: sh ***
58
### mode: sh ***
58
### sh-indentation: 2 ***
59
### sh-indentation: 2 ***
59
### End: ***
60
### End: ***