The R Project SVN R

Rev

Rev 33359 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

#
# ${R_HOME}/etc/Makefile

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

top_builddir = ..
subdir = etc

include $(top_builddir)/Makeconf

## <NOTE>
## Need target rules for all elements of SOURCES/OBJECTS.
SOURCES = Makeconf.in Renviron.in
OBJECTS = $(SOURCES:.in=)
## </NOTE>
INSTFILES = repositories
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = Makefile.in $(INSTFILES) $(SOURCES)

EXPORTFILES = @USE_EXPORTFILES_TRUE@ R.exp Rlapack.exp

CLEANFILES = $(EXPORTFILES)
DISTCLEANFILES = $(OBJECTS) Makefile

all: Makefile R

Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
    @cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@

## <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.
Makeconf: $(srcdir)/Makeconf.in $(top_builddir)/config.status
    @cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
Renviron: $(srcdir)/Renviron.in $(top_builddir)/config.status
    @cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
## </NOTE>

R: $(OBJECTS)
    @if test "$(BUILDDIR_IS_SRCDIR)" = no ; then \
      for f in $(INSTFILES); do \
        $(INSTALL_DATA) $(srcdir)/$${f} .; \
      done \
    fi

install: installdirs
    @echo "installing $(subdir) ..."
    @$(INSTALL_DATA) $(srcdir)/repositories "$(rhome)/$(subdir)"
    @for f in $(OBJECTS) $(EXPORTFILES); do \
      $(INSTALL_DATA) $${f} "$(rhome)/$(subdir)"; \
    done
installdirs:
    @$(MKINSTALLDIRS) "$(rhome)/$(subdir)"
install-strip: install

uninstall:
    @echo "uninstalling $(subdir) ..."
    @if test -d "$(rhome)/$(subdir)" \
      && test "`cd \"$(rhome)\"; $(GETWD)`" \
           != "`cd $(top_builddir); $(GETWD)`"; then \
      (cd "$(rhome)/$(subdir)" && \
        rm -f $(OBJECTS) $(INSTFILES) $(EXPORTFILES)); \
      rmdir "$(rhome)/$(subdir)" 2> /dev/null \
        || echo "  subdir $(subdir) not removed"; \
    fi

mostlyclean: clean
clean:
    -@test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
    @if test "$(BUILDDIR_IS_SRCDIR)" = no ; then \
      rm -f $(INSTFILES) ; \
    fi
distclean: clean
    -@test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean: distclean

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