The R Project SVN R

Rev

Rev 5320 | Rev 7002 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5320 Rev 6098
Line 13... Line 13...
13
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
13
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
14
DISTFILES = Makefile.in
14
DISTFILES = Makefile.in
15
 
15
 
16
R = $(top_builddir)/bin/R --vanilla
16
R = $(top_builddir)/bin/R --vanilla
17
 
17
 
18
PKGS = base eda lqs modreg mva stepfun ts
18
PKGS = $(R_PKGS)
19
EX_IN = $(PKGS:=-Ex.R)
19
EX_IN = $(PKGS:=-Ex.R)
20
EX_OUT = $(EX_IN:.R=.Rout)
20
EX_OUT = $(EX_IN:.R=.Rout)
-
 
21
 
21
.SUFFIXES:
22
.SUFFIXES:
22
.SUFFIXES: .R .Rout
23
.SUFFIXES: .R .Rout
23
.SECONDARY: $(EX_IN)
-
 
24
 
24
 
25
all: Makefile test-Examples
25
all: Makefile Makedeps test-Examples
26
 
26
 
27
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
27
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
28
	cd $(top_builddir) && \
28
	@cd $(top_builddir) && \
29
	  CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
29
	  CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
30
	  $(SHELL) ./config.status
30
	  $(SHELL) ./config.status
31
 
31
 
-
 
32
Makedeps: Makefile
-
 
33
	@(for p in $(PKGS); do \
-
 
34
	    dep="$${p}-Ex.Rout: $${p}-Ex.R"; \
-
 
35
	    dep="$${dep} \$$(top_builddir)/library/$${p}/R/$${p}"; \
-
 
36
	    tmp="library/$${p}/libs/$${p}" ; \
-
 
37
	    if test -f $(top_builddir)/$${tmp}.$(SHLIBEXT); then \
-
 
38
	      dep="$${dep} \$$(top_builddir)/$${tmp}.\$$(SHLIBEXT)"; \
-
 
39
	    fi; \
-
 
40
	    dep="$${dep} \$$(FORCE)"; \
-
 
41
	    echo $${dep}; \
-
 
42
	  done) >> Makefile
-
 
43
	@touch $@
-
 
44
 
32
test-Examples: R $(EX_OUT)
45
test-Examples: Makefile R
-
 
46
	@$(MAKE) Makedeps
-
 
47
	@$(MAKE) $(EX_OUT)
33
 
48
 
34
R:
49
R:
35
	@cd $(top_builddir) && $(MAKE) R
50
	@cd $(top_builddir) && $(MAKE) R
36
 
51
 
37
.R.Rout:
52
.R.Rout:
38
	@if [ -f $@.bak ]; then mv $@.bak $@.bakk ; fi
53
	@if [ -f $@.bak ]; then mv $@.bak $@.bakk ; fi
39
	@if [ -f $@ ]; then mv $@ $@.bak ; fi
54
	@if [ -f $@ ];     then cp $@     $@.bak  ; fi
40
	@echo "Running all help() examples ..."
55
	@echo "running code in $< ..."
41
	$(R) < $< > $@
56
	$(R) < $< > $@
42
 
57
 
43
$(EX_IN): FORCE
58
$(EX_IN): FORCE
44
	@(pkg=`echo $@ | sed -e 's/-Ex.R$$//g'`; \
59
	@(pkg=`echo $@ | sed -e 's/-Ex.R$$//g'`; \
45
	  if test -f $@.bak ; then mv $@.bak $@.bakk ; fi; \
60
	  if test -f $@.bak ; then mv $@.bak $@.bakk ; fi; \
46
	  if test -f $@     ; then mv $@     $@.bak  ; fi; \
61
	  if test -f $@     ; then cp $@     $@.bak  ; fi; \
47
	  echo "Collecting components of $@ ..."; \
62
	  echo "updating $@ ..."; \
48
	  (cd $(top_builddir)/src/library && \
63
	  (cd $(top_builddir)/src/library && \
49
	    OPTS="--nroff --example" $(MAKE) PKGS="$${pkg}" DOCS); \
64
	    OPTS="--nroff --example" $(MAKE) PKGS="$${pkg}" DOCS); \
50
	  echo "Massaging examples into $@ ..."; \
65
	  f=/tmp/R$$$$; \
51
	  $(top_builddir)/bin/massage-Examples $${pkg} \
66
	  $(top_builddir)/bin/massage-Examples $${pkg} \
52
	    $(top_builddir)/library/$${pkg}/R-ex/*.R > $@)
67
	    $(top_builddir)/library/$${pkg}/R-ex/*.R > $${f}; \
-
 
68
	  $(top_srcdir)/tools/move-if-change $${f} $@)
53
FORCE:
69
FORCE:
54
 
70
 
-
 
71
$(EX_OUT): Makefile \
-
 
72
  $(top_builddir)/bin/R.X11 \
-
 
73
  $(top_builddir)/library/base/R/base
-
 
74
 
55
mostlyclean: clean
75
mostlyclean: clean
56
clean:
76
clean:
57
	@rm -f *.R *.Rout *.Rd* *.ps *.tex *.dat* data foo*
77
	@rm -f *.R *.Rout *.Rd* *.ps *.tex *.dat* data foo* Makedeps
58
distclean: clean
78
distclean: clean
59
	@rm -f *.R*bak *.R*bakk .RData sink-examp.txt Makefile
79
	@rm -f *.R*bak *.R*bakk .RData sink-examp.txt Makefile
60
maintainer-clean: distclean
80
maintainer-clean: distclean
61
 
81
 
62
distdir: $(DISTFILES)
82
distdir: $(DISTFILES)
63
	@for f in $(DISTFILES); do \
83
	@for f in $(DISTFILES); do \
64
	  test -f $(distdir)/$${f} \
84
	  test -f $(distdir)/$${f} \
65
	    || ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \
85
	    || ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \
66
	    || cp -p $(srcdir)/$${f} $(distdir)/$${f}; \
86
	    || cp -p $(srcdir)/$${f} $(distdir)/$${f}; \
67
        done
87
        done
-
 
88
 
-
 
89
## Automagically generated dependencies: