Makefile.in 7.53 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#
# ${R_HOME}/Makefile

VPATH = @srcdir@
srcdir = @srcdir@
top_srcdir = @top_srcdir@

top_builddir = .

include $(top_builddir)/Makeconf

12 13
GIT = `if [ -d "$(top_builddir)/.git" ]; then echo "git"; fi`

14
distdir = $(PACKAGE)-$(VERSION)
15
INSTFILES = COPYING
16
NON_SVN_INSTFILES = SVN-REVISION
17
DISTFILES = $(INSTFILES) \
18
	ChangeLog INSTALL README VERSION VERSION-NICK \
19
	Makeconf.in Makefile.in Makefile.fw \
20
	config.site configure configure.ac
21 22
SUBDIRS = m4 tools doc etc share src tests
SUBDIRS_WITH_NO_BUILD = po
23

24
all: Makefile Makeconf R docs recommended vignettes javaconf
25
recommended: @USE_RECOMMENDED_PACKAGES_TRUE@ stamp-recommended
26 27

Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
28 29 30 31
	@cd $(top_builddir) && $(SHELL) ./config.status $@
Makeconf: $(srcdir)/Makeconf.in $(top_builddir)/config.status
	@cd $(top_builddir) && $(SHELL) ./config.status $@

32
ACLOCAL_M4 = aclocal.m4
33
## NB: this is duplicated in m4/Makefile.in
34 35
ACINCLUDE_DEPENDENCIES = \
	m4/R.m4 \
36
	m4/bigendian.m4 \
37
	m4/cairo.m4 \
38
	m4/clibs.m4 \
39
	m4/codeset.m4 \
40
	m4/cxx_11.m4 \
41
	m4/gettext.m4 m4/gettext-lib.m4 \
42
	m4/libtool.m4 m4/ltoptions.m4 m4/ltversion.m4 m4/ltsugar.m4 m4/lt~obsolete.m4 \
43
	m4/openmp.m4 \
44
	m4/stat-time.m4
45 46 47 48
CONFIGURE_DEPENDENCIES = $(srcdir)/VERSION
config.status: $(srcdir)/configure
	@$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
49 50 51 52 53
	@BD=`pwd`; cd $(srcdir) && $(AUTOCONF) -B $${BD}
$(ACLOCAL_M4): $(srcdir)/configure.ac acinclude.m4
	@BD=`pwd`; cd $(srcdir) && $(ACLOCAL) --output=$${BD}/$@ -I $${BD}
acinclude.m4: $(srcdir)/configure.ac $(ACINCLUDE_DEPENDENCIES)
	@(cd $(srcdir) && cat $(ACINCLUDE_DEPENDENCIES)) > $@
54 55 56 57 58

LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
	$(SHELL) ./config.status --recheck

59
R: Makefile svnonly
60 61 62 63 64 65
	@if test "$(BUILDDIR_IS_SRCDIR)" = no ; then \
	  for f in $(INSTFILES); do \
	    $(INSTALL_DATA) $(srcdir)/$${f} $(top_builddir); \
	  done; \
	fi
	@for d in $(SUBDIRS); do \
66 67
	  (cd $${d} && $(MAKE) R) || exit 1; \
	done
68
	@test -f src/library/stamp-docs || \
69
	  $(ECHO) "you should 'make docs' now ..."
70

71
docs: R FORCE
72 73
	-@(cd doc && $(MAKE) $@)
	-@(cd src/library && $(MAKE) $@)
74 75
FORCE:

76 77 78
stamp-recommended: R docs
	@(cd src/library/Recommended && $(MAKE))

79
## One of the grid vignettes requires lattice
80
vignettes: stamp-recommended
81
	@(cd src/library && $(MAKE) $@)
82

83
## This needs packages built, hence 'R' dependence on 'javaconf'
84 85
## javareconf gets remade often.
stamp-java : etc/javaconf $(srcdir)/src/scripts/javareconf.in
86 87
@WANT_JAVA_TRUE@	@$(ECHO) "configuring Java ..."
@WANT_JAVA_TRUE@	@-bin/R CMD javareconf
88 89 90 91 92 93
	@touch stamp-java

javaconf: R
	@$(MAKE) stamp-java


94
install install-strip: installdirs svnonly
95
	@for d in $(SUBDIRS); do \
96 97
	  (cd $${d} && $(MAKE) $@) || exit 1; \
	done
98
	@for f in $(INSTFILES); do \
99
	  $(INSTALL_DATA) $(srcdir)/$${f} "$(DESTDIR)$(rhome)"; \
100
	done
101
	@for f in $(NON_SVN_INSTFILES); do \
102
	  $(INSTALL_DATA) $${f} "$(DESTDIR)$(rhome)"; \
103
	done
104
@WANT_R_FRAMEWORK_TRUE@		$(MAKE) -f $(srcdir)/Makefile.fw top_srcdir=$(top_srcdir) $@
105

106
svnonly:
107
	@if test ! -f "$(srcdir)/doc/FAQ" || test -f non-tarball ; then \
108
	  (cd doc/manual && $(MAKE) front-matter html-non-svn) ; \
109
	  touch non-tarball ; \
110
	  (cd $(srcdir); LC_ALL=C TZ=GMT $(GIT) svn info || $(ECHO) "Revision: -99") 2> /dev/null \
111
	    | sed -n -e '/^Revision/p' -e '/^Last Changed Date/'p \
112
	    | cut -d' ' -f1,2,3,4 > SVN-REVISION-tmp ; \
113 114 115 116
	  if test "`cat SVN-REVISION-tmp`" = "Revision: -99"; then \
	    $(ECHO) "ERROR: not an svn checkout"; \
	    exit 1; \
	  fi; \
117
	  $(SHELL) $(top_srcdir)/tools/move-if-change SVN-REVISION-tmp SVN-REVISION ; \
118
	  rm -f SVN-REVISION-tmp ; \
119 120 121 122 123 124 125
	else \
	  if test "$(BUILDDIR_IS_SRCDIR)" = no ; then \
	    for f in $(NON_SVN_INSTFILES); do \
	      $(INSTALL_DATA) $(srcdir)/$${f} $(top_builddir); \
	    done \
	  fi \
	fi
126

127
@WANT_R_STATIC_FALSE@libR_la = libR$(R_DYLIB_EXT)
128
@WANT_R_STATIC_TRUE@libR_la = libR.a
129
install-libR:
130
	@if test -f lib$(R_ARCH)/$(libR_la); then $(MAKE) install-libR-exists; fi
131
install-libR-exists:
132
	@$(MKINSTALLDIRS) "$(DESTDIR)${libdir}"
133
	@$(INSTALL_DATA) -m755 lib$(R_ARCH)/$(libR_la) "$(DESTDIR)${libdir}"
134
uninstall-libR:
135
	@rm -f "$(DESTDIR)${libdir}/$(libR_la)"
136

137
installdirs:
138
	@$(MKINSTALLDIRS) "$(DESTDIR)$(rhome)"
139
uninstall:
140 141
	@(for d in $(SUBDIRS); do rsd="$${d} $${rsd}"; done; \
	  for d in $${rsd}; do (cd $${d} && $(MAKE) $@); done)
142
	@for f in $(INSTFILES) $(NON_SVN_INSTFILES); do \
143
	  rm -f "$(DESTDIR)$(rhome)/$${f}"; \
144
	done
145 146
	@rm -rf "$(DESTDIR)$(Rexecbindir)" "$(DESTDIR)$(rhome)/lib"
	@rmdir "$(DESTDIR)$(rhome)" 2>/dev/null \
147
          || $(ECHO) "  dir $(DESTDIR)$(rhome) not removed"
148
	@rm -f "$(DESTDIR)${libdir}/libR$(R_DYLIB_EXT)"
149 150 151

mostlyclean: clean
clean:
152 153 154
	@(for d in $(SUBDIRS); do rsd="$${d} $${rsd}"; done; \
	  for d in $${rsd}; do (cd $${d} && $(MAKE) $@); done)
	@if test "$(BUILDDIR_IS_SRCDIR)" = no ; then \
155
	  rm -f $(INSTFILES); \
156
	fi
157
distclean: clean
158 159
	@(for d in $(SUBDIRS); do rsd="$${d} $${rsd}"; done; \
	  for d in $${rsd}; do (cd $${d} && $(MAKE) $@); done)
160
	@rm -f po/Makefile
161
	-@rm -rf bin include lib library modules gnome
162
	@if test -f non-tarball ; then \
163
	  rm -f $(NON_SVN_INSTFILES) non-tarball doc/FAQ doc/RESOURCES doc/html/resources.html doc/html/NEWS.html; \
164 165 166
	fi
	@if test "$(BUILDDIR_IS_SRCDIR)" = no ; then \
	  rm -f $(NON_SVN_INSTFILES); \
167
	  rm -rf $(SUBDIRS) $(SUBDIRS_WITH_NO_BUILD); \
168
	fi
169
	-@rm -rf libconftest.dSYM
170
	-@rm -f Makeconf Makefile Makefile.bak Makefrag.* \
171
	  config.cache config.log config.status libtool stamp-java \
172
	  $(ACLOCAL_M4) acinclude.m4 $(distdir).tar.gz
173
maintainer-clean: distclean
174 175
	@$(ECHO) "This command is intended for maintainers to use; it"
	@$(ECHO) "deletes files that may need special rules to rebuild"
176 177
	@(for d in $(SUBDIRS); do rsd="$${d} $${rsd}"; done; \
	  for d in $${rsd}; do (cd $${d} && $(MAKE) $@); done)
178
	-@(cd $(srcdir) && rm -rf autom4te.cache)
179 180 181 182

dist: dist-unix
dist-unix: distdir
	-chmod -R a+r $(distdir)
183 184
	-chmod -R go-w $(distdir)
	distname=`$(srcdir)/tools/GETDISTNAME`; \
185
	  dirname=`$(ECHO) $${distname} | sed -e s/_.*//`; \
186 187 188
          if test $(distdir) != $${dirname} ; then \
            mv $(distdir) $${dirname}; \
          fi ; \
189 190
	  GZIP=$(GZIP) $(TAR) czf $${distname}.tar.gz $${dirname}; \
	  rm -rf $${dirname}
191
dist-win:
192
distdir: $(DISTFILES) vignettes
193 194 195 196 197
	@rm -rf $(distdir)
	@mkdir $(distdir)
	@-chmod 755 $(distdir)
	@for f in $(DISTFILES); do \
	  test -f $(distdir)/$${f} \
198
	    || ln $(srcdir)/$${f} $(distdir)/$${f} 2>/dev/null \
199 200
	    || cp -p $(srcdir)/$${f} $(distdir)/$${f}; \
	done
201
	@for f in $(NON_SVN_INSTFILES) ; do \
202 203
	  cp -p $${f} $(distdir)/$${f}; \
	done
204 205 206 207 208 209 210
	@for d in $(SUBDIRS); do \
	  test -d $(distdir)/$${d} \
	    || mkdir $(distdir)/$${d} \
	    || exit 1; \
	  chmod 755 $(distdir)/$${d}; \
	  (cd $${d} && $(MAKE) distdir) \
	    || exit 1; \
211
	done
212 213 214
	@for d in $(SUBDIRS_WITH_NO_BUILD); do \
	  ((cd $(srcdir); $(TAR) -c -f - $(DISTDIR_TAR_EXCLUDE) $${d}) \
	      | (cd $(distdir); $(TAR) -x -f -)) \
215 216
	    || exit 1; \
	done
217 218 219 220
	@for d in grid parallel utils; do \
	  mkdir -p $(distdir)/src/library/$${d}/inst/doc; \
	  cp library/$${d}/doc/*.pdf $(distdir)/src/library/$${d}/inst/doc; \
	done
221
	@(cd $(distdir); tools/link-recommended)
222

223
info pdf:
224
	-@(cd doc && $(MAKE) $@)
225
install-info install-pdf:
226
	-@(cd doc/manual && $(MAKE) $@)
227
uninstall-info uninstall-pdf:
228 229
	-@(cd doc/manual && $(MAKE) $@)

230 231 232 233 234 235 236 237
install-tests:
	-@(cd tests && $(MAKE) $@)
	-@(cd src/library && $(MAKE) $@)

uninstall-tests:
	-@(cd src/library && $(MAKE) $@)
	-@(cd tests && $(MAKE) $@)

238
check check-devel check-all check-recommended:
239
	@(cd tests && $(MAKE) $@)
240

241 242 243
reset-recommended:
	@(cd src/library/Recommended && $(MAKE) clean)

244
TAGS: