/
Makefile.in
136 lines (120 loc) · 4.89 KB
/
Makefile.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#
# ${R_HOME}/src/scripts/Makefile
VPATH = @srcdir@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../..
subdir = src/scripts
include $(top_builddir)/Makeconf
SCRIPTS_S = BATCH LINK Rcmd Rdiff Rd2dvi Rd2txt config f77_f2c \
mkinstalldirs pager texi2dvi
## <NOTE>
## Need target rules for all elements of SCRIPTS_B_IN/SCRIPTS_B.
SCRIPTS_B_IN = COMPILE.in INSTALL.in REMOVE.in Rdconv.in Rprof.in \
SHLIB.in Sd2Rd.in build.in check.in
SCRIPTS_B = $(SCRIPTS_B_IN:.in=)
## </NOTE>
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = Makefile.in Makefile.win $(SCRIPTS_S) $(SCRIPTS_B_IN) R.sh.in
CLEANFILES =
DISTCLEANFILES = Makefile R.fe R.sh $(SCRIPTS_B)
all: Makefile R
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
R: $(SCRIPTS_B) R.fe
@$(MAKE) rhome=$(top_builddir) install-cmds
@$(INSTALL_SCRIPT) R.fe $(top_builddir)/bin/R
## <NOTE>
## Seems we need target rules for creating FOO from FOO.in: pattern
## rules ('%:%.in') are not portable, and some versions of Make do not
## allow separated dependencies for single suffix rules.
COMPILE: $(srcdir)/COMPILE.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
INSTALL: $(srcdir)/INSTALL.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
REMOVE: $(srcdir)/REMOVE.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Rdconv: $(srcdir)/Rdconv.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Rprof: $(srcdir)/Rprof.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
SHLIB: $(srcdir)/SHLIB.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Sd2Rd: $(srcdir)/Sd2Rd.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
build: $(srcdir)/build.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
check: $(srcdir)/check.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
## The following target helps in automatically generating the above
## target rules (provided that echo understands backslash escapes).
Makerules:
@(dep="\$$(top_builddir)/config.status"; \
cmd="@cd \$$(top_builddir)"; \
cmd="$${cmd} && \$$(SHELL) ./config.status \$$(subdir)/\$$@"; \
for f in $(SCRIPTS_B); do \
echo "$${f}: \$$(srcdir)/$${f}.in $${dep}"; \
echo " $${cmd}"; \
done)
## </NOTE>
## <NOTE>
## The front-end shell script now (2000-08-02) also contains the version
## information. As we keep this information outside configure (as
## otherwise developers would have to reconfigure and hence rebuild
## every day), we now first create 'R.sh' from 'R.sh.in' via configure,
## and then use sed to create the front end ('R.fe') which gets
## installed as 'R'.
R.sh: $(srcdir)/R.sh.in $(top_builddir)/config.status
@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
R.fe: R.sh $(top_srcdir)/VERSION $(top_builddir)/SVN-REVISION
@echo "creating $(subdir)/$@"
@(v=`cat $(top_srcdir)/VERSION`; \
dat=`sed -e 1d -e 's/^Last Changed Date: //' $(top_builddir)/SVN-REVISION`; \
v="$${v} ($${dat})"; \
y=`echo $${dat} | cut -d- -f1`; \
d=`echo "$(abs_top_builddir)" | sed 's,/,\\\/,g'`; \
sed "s/\\(R_HOME_DIR=\\).*/\\1\"$${d}\"/; \
s@REPLACE_BY_VERSION@$${v}@; \
s@REPLACE_BY_YEAR@$${y}@" < R.sh > $@)
@chmod +x $@
## </NOTE>
$(top_builddir)/libtool:
@(cd $(@D); $(MAKE) $(@F))
install: installdirs install-cmds
@rm -f $(bindir)/R
@(d=`echo '$(rhome)' | sed 's,/,\\\/,g';`; \
sed -e "s/\\(R_HOME_DIR=\\).*/\\1$${d}/;" -e "s+\\(R_SHARE_DIR=\\).*+\\1$(rsharedir)+;" -e "s+\\(R_INCLUDE_DIR=\\).*+\\1$(rincludedir)+;" -e "s+\\(R_DOC_DIR=\\).*+\\1$(rdocdir)+;"\
< R.fe > "$(Rexecbindir)/R")
@cp "$(Rexecbindir)/R" $(bindir)/R
@chmod 755 $(bindir)/R "$(Rexecbindir)/R"
installdirs:
@$(MKINSTALLDIRS) $(bindir)
install-cmds:
@$(MKINSTALLDIRS) "$(Rexecbindir)"
@for f in $(SCRIPTS_S); do \
$(INSTALL_SCRIPT) $(srcdir)/$${f} "$(Rexecbindir)"; \
done
@for f in $(SCRIPTS_B); do \
$(INSTALL_SCRIPT) $${f} "$(Rexecbindir)"; \
done
@$(INSTALL_SCRIPT) $(top_builddir)/libtool "$(Rexecbindir)"
install-strip:
$(MAKE) INSTALL_PROGRAM="${INSTALL_PROGRAM} -s" install
uninstall:
@for f in $(SCRIPTS_S) $(SCRIPTS_B) libtool R; do \
rm -f "$(Rexecbindir)/$${f}"; \
done
@rm -f $(bindir)/R
mostlyclean: clean
clean:
-@test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean: clean
-@test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean: distclean
TAGS info dvi check:
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
test -f $(distdir)/$${f} \
|| ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \
|| cp -p $(srcdir)/$${f} $(distdir)/$${f}; \
done