The R Project SVN R

Rev

Rev 86911 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 86911 Rev 88582
Line 21... Line 21...
21
 
21
 
22
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
22
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
23
DISTFILES = Makefile.in Makefile.win $(SCRIPTS_S) $(SCRIPTS_B_IN) R.sh.in
23
DISTFILES = Makefile.in Makefile.win $(SCRIPTS_S) $(SCRIPTS_B_IN) R.sh.in
24
 
24
 
25
CLEANFILES =
25
CLEANFILES =
26
DISTCLEANFILES = Makefile R.fe R.sh $(SCRIPTS_B)
26
DISTCLEANFILES = Makefile R.sh $(SCRIPTS_B)
27
 
27
 
28
all: Makefile R
28
all: Makefile R
29
 
29
 
30
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
30
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
31
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
31
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
32
 
32
 
33
R: $(SCRIPTS_B) R.fe
33
R: $(SCRIPTS_B) R.sh
34
	@$(MAKE) DESTDIR="" rhome=$(top_builddir) install-cmds
34
	@$(MAKE) DESTDIR="" rhome=$(top_builddir) install-cmds
35
	@$(INSTALL_SCRIPT) R.fe $(top_builddir)/bin/R
35
	@$(INSTALL_SCRIPT) R.sh $(top_builddir)/bin/R
36
 
36
 
37
## <NOTE>
37
## <NOTE>
38
## Seems we need target rules for creating FOO from FOO.in: pattern
38
## Seems we need target rules for creating FOO from FOO.in: pattern
39
## rules ('%:%.in') are not portable, and some versions of Make do not
39
## rules ('%:%.in') are not portable, and some versions of Make do not
40
## allow separated dependencies for single suffix rules.
40
## allow separated dependencies for single suffix rules.
Line 58... Line 58...
58
	    $(ECHO) "$${f}: \$$(srcdir)/$${f}.in $${dep}"; \
58
	    $(ECHO) "$${f}: \$$(srcdir)/$${f}.in $${dep}"; \
59
	    $(ECHO) "	$${cmd}"; \
59
	    $(ECHO) "	$${cmd}"; \
60
	  done)
60
	  done)
61
## </NOTE>
61
## </NOTE>
62
 
62
 
63
## <NOTE>
-
 
64
## The front-end shell script now (2000-08-02) also contains the version
-
 
65
## information.  As we keep this information outside configure (as
-
 
66
## otherwise developers would have to reconfigure and hence rebuild
-
 
67
## every day), we now first create 'R.sh' from 'R.sh.in' via configure,
-
 
68
## and then use sed to create the front end ('R.fe') which gets
-
 
69
## installed as 'R'.
-
 
70
R.sh: $(srcdir)/R.sh.in $(top_builddir)/config.status
63
R.sh: $(srcdir)/R.sh.in $(top_builddir)/config.status
71
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
64
	@cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
72
R.fe: R.sh $(top_srcdir)/VERSION $(top_builddir)/SVN-REVISION
-
 
73
	@$(ECHO) "creating $(subdir)/$@"
-
 
74
	@(v=`cat $(top_srcdir)/VERSION`; \
-
 
75
	  dat=`sed -e 1d -e 's/^Last Changed Date: //' $(top_builddir)/SVN-REVISION`; \
-
 
76
	  v="$${v} ($${dat})"; \
-
 
77
	  y=`$(ECHO) $${dat} | cut -d- -f1`; \
-
 
78
	  d=`$(ECHO) "$(abs_top_builddir)" | sed 's,/,\\\/,g'`; \
-
 
79
	  sed "1,/R_HOME_DIR/s/\\(R_HOME_DIR=\\).*/\\1\"$${d}\"/; \
-
 
80
	       s@REPLACE_BY_VERSION@$${v}@; \
-
 
81
	       s@REPLACE_BY_YEAR@$${y}@" < R.sh > $@)
-
 
82
	@chmod +x $@
65
	@chmod +x $@
83
## </NOTE>
-
 
84
 
66
 
85
$(top_builddir)/libtool:
67
$(top_builddir)/libtool:
86
	@(cd $(@D); $(MAKE) $(@F))
68
	@(cd $(@D); $(MAKE) $(@F))
87
 
69
 
88
install: installdirs install-cmds
70
install: installdirs install-cmds
89
	@rm -f $(DESTDIR)$(bindir)/R
71
	@rm -f $(DESTDIR)$(bindir)/R
90
	@(d=`$(ECHO) '$(rhome)' | sed 's,/,\\\/,g';`; \
72
	@(d=`$(ECHO) '$(rhome)' | sed 's,/,\\\/,g';`; \
91
	  d2=`$(ECHO) '$(rsharedir)' | sed 's,/,\\\/,g';`; \
73
	  d2=`$(ECHO) '$(rsharedir)' | sed 's,/,\\\/,g';`; \
92
	  d3=`$(ECHO) '$(rincludedir)' | sed 's,/,\\\/,g';`; \
74
	  d3=`$(ECHO) '$(rincludedir)' | sed 's,/,\\\/,g';`; \
93
	  d4=`$(ECHO) '$(rdocdir)' | sed 's,/,\\\/,g';`; \
75
	  d4=`$(ECHO) '$(rdocdir)' | sed 's,/,\\\/,g';`; \
94
	  sed -e "1,/R_HOME_DIR=/s/\\(R_HOME_DIR=\\).*/\\1$${d}/;" -e "s/\\(R_SHARE_DIR=\\).*/\\1$${d2}/;" -e  "s/\\(R_INCLUDE_DIR=\\).*/\\1$${d3}/;" -e "s/\\(R_DOC_DIR=\\).*/\\1$${d4}/;"\
76
	  sed -e "1,/R_HOME_DIR=/s/\\(R_HOME_DIR=\\).*/\\1\"$${d}\"/;" -e "s/\\(R_SHARE_DIR=\\).*/\\1\"$${d2}\"/;" -e  "s/\\(R_INCLUDE_DIR=\\).*/\\1\"$${d3}\"/;" -e "s/\\(R_DOC_DIR=\\).*/\\1\"$${d4}\"/;"\
95
	  < R.fe > "$(DESTDIR)$(Rexecbindir)/R")
77
	  < R.sh > "$(DESTDIR)$(Rexecbindir)/R")
96
	@$(INSTALL_SCRIPT)  "$(DESTDIR)$(Rexecbindir)/R" "$(DESTDIR)$(bindir)/R"
78
	@$(INSTALL_SCRIPT)  "$(DESTDIR)$(Rexecbindir)/R" "$(DESTDIR)$(bindir)/R"
97
	@chmod 755 "$(DESTDIR)$(bindir)/R" "$(DESTDIR)$(Rexecbindir)/R"
79
	@chmod 755 "$(DESTDIR)$(bindir)/R" "$(DESTDIR)$(Rexecbindir)/R"
98
## why of all the scripts does this alone chmod just one copy?
80
## why of all the scripts does this alone chmod just one copy?
99
installdirs:
81
installdirs:
100
	@$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
82
	@$(MKINSTALLDIRS) $(DESTDIR)$(bindir)