-
Notifications
You must be signed in to change notification settings - Fork 315
/
COMPILE.in
71 lines (59 loc) · 1.86 KB
/
COMPILE.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
#
# ${R_HOME}/bin/COMPILE
# @configure_input@
revision='$Rev$'
version=`set - ${revision}; echo ${2}`
version="R compilation front end ${version}
Copyright (C) 2000-2005 The R Core Development Team.
This is free software; see the GNU General Public Licence version 2 or
later for copying conditions. There is NO warranty."
usage="Usage: R CMD COMPILE [options] files
Compile the specified files for subsequent collection into a shared
library using 'R CMD SHLIB'. Currently, C, C++, and FORTRAN files
(with extensions '.c', '.cc' or '.cpp' or '.C', and '.f', respectively),
are supported.
Options:
-h, --help print short help message and exit
-v, --version print COMPILE version info and exit
Other options of the form '-DMACRO' or 'VAR=VALUE' are passed on to the
compilation.
Report bugs to <r-bugs@r-project.org>."
makefiles="-f \"${R_HOME}/etc${R_ARCH}/Makeconf\""
if test -r "${HOME}/.R/Makevars-${R_PLATFORM}"; then
makefiles="${makefiles} -f \"${HOME}/.R/Makevars-${R_PLATFORM}\""
elif test -r "${HOME}/.R/Makevars"; then
makefiles="${makefiles} -f \"${HOME}/.R/Makevars\""
fi
if test -r Makevars; then
makefiles="-f Makevars ${makefiles}"
fi
objs=
while test -n "${1}"; do
case ${1} in
-h|--help)
echo "${usage}"; exit 0 ;;
-v|--version)
echo "${version}"; exit 0 ;;
*.[cfC]|*.cc|*.cpp)
objs="${objs} `echo ${1} | sed 's/\.[^\.][^\.]*$/.o/'`" ;;
-D*)
MAKEFLAGS="${MAKEFLAGS} ${1}" ;;
*=*)
argn=`echo "${1}" | sed -e 's/=.*//'`
argv=`echo "${1}" | \
sed -e 's/[^=]*=//; s/^\\"//; s/\\"$//; s/\\"/\\\\"/g'`
MAKEFLAGS="${MAKEFLAGS} ${argn}=\"${argv}\""
;;
*)
echo "ERROR: don't know how to compile '${1}'"
exit 1
;;
esac
shift
done
eval "${MAKE} ${makefiles} ${MAKEFLAGS} ${objs}"
### Local Variables: ***
### mode: sh ***
### sh-indentation: 2 ***
### End: ***