The R Project SVN R

Rev

Rev 24651 | Rev 29659 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2158 hornik 1
#
4580 hornik 2
# ${R_HOME}/src/scripts/Makefile
2158 hornik 3
 
4
VPATH = @srcdir@
5
srcdir = @srcdir@
6
top_srcdir = @top_srcdir@
7
 
8
top_builddir = ../..
2456 hornik 9
subdir = src/scripts
2158 hornik 10
 
11
include $(top_builddir)/Makeconf
12
 
26339 hornik 13
SCRIPTS_S = BATCH LINK Rcmd Rdiff Rd2dvi Rd2txt config mkinstalldirs \
14
  pager texi2dvi
22584 hornik 15
## <NOTE>
16
## Need target rules for all elements of SCRIPTS_B_IN/SCRIPTS_B.
24651 hornik 17
SCRIPTS_B_IN = COMPILE.in INSTALL.in REMOVE.in Rdconv.in Rprof.in \
26339 hornik 18
  SHLIB.in Sd2Rd.in build.in check.in f77.in
11482 hornik 19
SCRIPTS_B = $(SCRIPTS_B_IN:.in=)
22584 hornik 20
## </NOTE>
5122 hornik 21
 
2456 hornik 22
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
5122 hornik 23
DISTFILES = Makefile.in $(SCRIPTS_S) $(SCRIPTS_B_IN) R.sh.in
2456 hornik 24
 
24651 hornik 25
## <FIXME>
26
## Remove eventually.
27
CLEANFILES = Rdindex
28
## </FIXME>
22584 hornik 29
DISTCLEANFILES = Makefile R.fe R.sh $(SCRIPTS_B)
2158 hornik 30
 
5476 hornik 31
all: Makefile R
32
 
33
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
17899 hornik 34
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
5476 hornik 35
 
11493 hornik 36
R: $(SCRIPTS_B) R.fe
14068 hornik 37
	@$(MAKE) rhome=$(top_builddir) install-cmds
10093 hornik 38
	@$(INSTALL_SCRIPT) R.fe $(top_builddir)/bin/R
2158 hornik 39
 
22584 hornik 40
## <NOTE>
41
## Seems we need target rules for creating FOO from FOO.in: pattern
42
## rules ('%:%.in') are not portable, and some versions of Make do not
43
## allow separated dependencies for single suffix rules.
44
COMPILE: $(srcdir)/COMPILE.in $(top_builddir)/config.status
45
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
46
INSTALL: $(srcdir)/INSTALL.in $(top_builddir)/config.status
47
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
48
REMOVE: $(srcdir)/REMOVE.in $(top_builddir)/config.status
49
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
50
Rdconv: $(srcdir)/Rdconv.in $(top_builddir)/config.status
51
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
52
Rprof: $(srcdir)/Rprof.in $(top_builddir)/config.status
53
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
54
SHLIB: $(srcdir)/SHLIB.in $(top_builddir)/config.status
55
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
56
Sd2Rd: $(srcdir)/Sd2Rd.in $(top_builddir)/config.status
57
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
58
build: $(srcdir)/build.in $(top_builddir)/config.status
59
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
60
check: $(srcdir)/check.in $(top_builddir)/config.status
61
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
62
f77: $(srcdir)/f77.in $(top_builddir)/config.status
63
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
64
## The following target helps in automatically generating the above
65
## target rules (provided that echo understands backslash escapes).
66
Makerules:
67
	@(dep="\$$(top_builddir)/config.status"; \
68
	  cmd="@cd \$$(top_builddir)"; \
69
	  cmd="$${cmd} && \$$(SHELL) ./config.status \$$(subdir)/\$$@"; \
70
	  for f in $(SCRIPTS_B); do \
71
	    echo "$${f}: \$$(srcdir)/$${f}.in $${dep}"; \
72
	    echo "	$${cmd}"; \
73
	  done)
74
## </NOTE>
5122 hornik 75
 
18626 hornik 76
## <NOTE>
77
## The front-end shell script now (2000-08-02) also contains the version
78
## information.  As we keep this information outside configure (as
79
## otherwise developers would have to reconfigure and hence rebuild
80
## every day), we now first create 'R.sh' from 'R.sh.in' via configure,
81
## and then use sed to create the front end ('R.fe') which gets
82
## installed as 'R'.
11482 hornik 83
R.sh: $(srcdir)/R.sh.in $(top_builddir)/config.status
23203 hornik 84
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
10093 hornik 85
R.fe: R.sh $(top_srcdir)/VERSION $(top_srcdir)/date-stamp
10110 hornik 86
	@echo "creating $(subdir)/$@"
10093 hornik 87
	@(v=`cat $(top_srcdir)/VERSION`; \
88
	  v="$${v} (`sed 's|/|-|g' $(top_srcdir)/date-stamp`)"; \
89
	  y=`cut -d/ -f1 < $(top_srcdir)/date-stamp`; \
12256 pd 90
	  sed "s@R_HOME_DIR=.*@R_HOME_DIR=`cd $(top_builddir); pwd`@; \
11493 hornik 91
	       s@REPLACE_BY_VERSION@$${v}@; \
92
	       s@REPLACE_BY_YEAR@$${y}@" < R.sh > $@)
10093 hornik 93
	@chmod +x $@
18626 hornik 94
## </NOTE>
10093 hornik 95
 
11203 hornik 96
$(top_builddir)/libtool:
97
	@(cd $(@D); $(MAKE) $(@F))
98
 
14068 hornik 99
install: installdirs install-cmds
100
	@sed "s@R_HOME_DIR=.*@R_HOME_DIR=$(rhome)@" < R.fe \
101
	  > $(Rexecbindir)/R
102
	@rm -f $(bindir)/R
103
	@sed "s@R_HOME_DIR=.*@R_HOME_DIR=$(rhome)@" < R.fe \
104
	  > $(bindir)/R
105
	@chmod 755 $(bindir)/R $(Rexecbindir)/R
106
installdirs:
107
	@$(MKINSTALLDIRS) $(bindir)
108
install-cmds:
109
	@$(MKINSTALLDIRS) $(Rexecbindir)
110
	@for f in $(SCRIPTS_S); do \
111
	  $(INSTALL_SCRIPT) $(srcdir)/$${f} $(Rexecbindir); \
112
	done
113
	@for f in $(SCRIPTS_B); do \
114
	  $(INSTALL_SCRIPT) $${f} $(Rexecbindir); \
115
	done
116
	@$(INSTALL_SCRIPT) $(top_builddir)/libtool $(Rexecbindir)
117
install-strip:
118
	$(MAKE) INSTALL_PROGRAM="${INSTALL_PROGRAM} -s" install
119
uninstall:
120
	@for f in $(SCRIPTS_S) $(SCRIPTS_B) libtool R; do \
121
	  rm -f $(Rexecbindir)/$${f}; \
122
	done
123
	@rmdir $(Rexecbindir) 2>/dev/null \
124
	  || echo "  subdir $(Rexecbindir) not removed"
125
	@rm -f $(bindir)/R
126
 
2158 hornik 127
mostlyclean: clean
128
clean:
22584 hornik 129
	-@test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
130
distclean: clean
131
	-@test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
2158 hornik 132
maintainer-clean: distclean
2456 hornik 133
 
14068 hornik 134
TAGS info dvi check:
135
 
2456 hornik 136
distdir: $(DISTFILES)
137
	@for f in $(DISTFILES); do \
138
	  test -f $(distdir)/$${f} \
139
	    || ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \
140
	    || cp -p $(srcdir)/$${f} $(distdir)/$${f}; \
141
	done