Permalink
Browse files

Make targets for build and (un)install more recursive.

git-svn-id: https://svn.r-project.org/R/trunk@14068 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
hornik
hornik committed May 11, 2001
1 parent aeb6aa1 commit 89cc593559085975d668afb171d6bfbd96702851
View
@@ -17,7 +17,7 @@ DISTFILES = $(INSTFILES) \
acconfig.h acinclude.m4 aclocal.m4 \
config.site configure configure.in \
date-stamp
-SUBDIRS = src afm doc etc share tests tools
+SUBDIRS = tools afm doc etc share src tests
GZIP = --best
@@ -47,7 +47,7 @@ R: Makefile
$(INSTALL_DATA) $(srcdir)/$${f} $(top_builddir); \
done; \
fi
- @for d in tools afm doc etc share src; do \
+ @for d in $(SUBDIRS); do \
(cd $${d} && $(MAKE) R) || exit 1; \
done
@if [ ! -f src/library/stamp-docs ]; then \
@@ -62,89 +62,25 @@ help html latex examples: FORCE
FORCE:
install: installdirs
- @for d in afm doc etc share; do \
+ @for d in $(SUBDIRS); do \
(cd $${d} && $(MAKE) $@) || exit 1; \
done
@for f in $(INSTFILES); do \
$(INSTALL_DATA) $(srcdir)/$${f} $(rhome); \
done
-## FIXME:
-## This is really ugly, but should disappear anyway when we convert to
-## Automake.
- @echo "installing executables ..."
- @$(INSTALL_PROGRAM) bin/R.bin $(rhome)/bin
- @sed "s@R_HOME_DIR=.*@R_HOME_DIR=$(rhome)@" < bin/R \
- > $(rhome)/bin/R
- @rm -f $(bindir)/R
- @sed "s@R_HOME_DIR=.*@R_HOME_DIR=$(rhome)@" < bin/R \
- > $(bindir)/R
- @chmod 755 $(bindir)/R $(rhome)/bin/R
- @for f in `find bin -type f -print \
- | grep -v '^bin/R$$' \
- | grep -v '^bin/R.bin' \
- | grep -v '^bin/libR' \
- | grep -v '^bin/R_'`; do \
- $(INSTALL_SCRIPT) $${f} $(Rexecbindir); \
- done
- @echo "installing shlibs ..."
-## <FIXME>
-## Add bin/*.la when using libtool for shlibs
-## Note: if there are no shared libraries, the ls call may generate an error.
- @-for f in `ls bin/*.$(SHLIB_EXT) 2> /dev/null`; do \
- $(INSTALL_PROGRAM) $${f} $(Rexeclibdir); \
- done
-## </FIXME>
-@USE_LIBTOOL_TRUE@ @$(LIBTOOL) --quiet --mode=finish $(Rexeclibdir)
- @echo "installing modules ..."
-## <FIXME>
-## Add modules/*.la when using libtool for shlib modules
- @-for f in `ls modules/*.$(SHLIB_EXT) 2> /dev/null`; do \
- $(INSTALL_PROGRAM) $${f} $(Rexecmodulesdir); \
- done
-## </FIXME>
-@USE_LIBTOOL_TRUE@ @$(LIBTOOL) --quiet --mode=finish $(Rexecmodulesdir)
- @echo "installing headers ..."
- @for f in include/*.h; do \
- $(INSTALL_DATA) $${f} $(rhome)/include; \
- done
- @for f in include/R_ext/*.h; do \
- $(INSTALL_DATA) $${f} $(rhome)/include/R_ext; \
- done
-## </FIXME>
- @echo "installing packages ..."
- @cp -r library $(rhome) || \
- (cd library; \
- $(TAR) cf - [a-z]* | (cd $(rhome)/library; $(TAR) xof -))
- @echo " building HTML index ..."
- @$(rhome)/bin/R CMD build-help --rhome $(rhome) --htmllists
installdirs:
- @$(MKINSTALLDIRS) $(bindir)
- @$(MKINSTALLDIRS) $(rhome)/bin
- @$(MKINSTALLDIRS) $(rhome)/include
- @$(MKINSTALLDIRS) $(rhome)/include/R_ext
- @$(MKINSTALLDIRS) $(rhome)/library
- @$(MKINSTALLDIRS) $(rhome)/modules
+ @$(MKINSTALLDIRS) $(rhome)
install-strip:
$(MAKE) INSTALL_PROGRAM="${INSTALL_PROGRAM} -s" install
uninstall:
- @echo "uninstalling library ..."
- @(cd $(rhome)/library; \
- for p in $(R_PKGS); do rm -rf $${p}; done)
- @echo "uninstalling headers ..."
- @rm -rf $(rhome)/include
- @echo "uninstalling modules ..."
- @rm -rf $(rhome)/modules
- @echo "uninstalling executables ..."
- @rm -rf $(rhome)/bin
- @rm -rf $(rhome)/gnome
- @rm -f $(bindir)/R
+ @(for d in $(SUBDIRS); do rsd="$${d} $${rsd}"; done; \
+ for d in $${rsd}; do (cd $${d} && $(MAKE) $@); done)
@for f in $(INSTFILES); do \
rm -f $(rhome)/$${f}; \
done
- @for d in afm doc etc share; do \
- (cd $${d} && $(MAKE) $@); \
- done
+ @rm -rf $(Rexecbindir)
@rm -rf $(rhome)/demos
+ @rm -rf $(rhome)/gnome
mostlyclean: clean
clean:
View
@@ -26,7 +26,7 @@ INSTFILES = \
## </FIXME>
## FIXME:
## build-help really should not create package.html in *this* directory.
-CLEANFILES = packages.html
+CLEANFILES = packages.html packages-foot.html
## </FIXME>
DISTFILES = Makefile.in $(INSTFILES) index-default.html
SUBDIRS = search
@@ -70,13 +70,12 @@ install-sources:
$(INSTALL_DATA) $(srcdir)/$${f} $(rhome)/$(subdir); \
done
install-strip: install
-
uninstall:
@echo "uninstalling $(subdir) ..."
@for d in $(SUBDIRS); do \
(cd $${d} && $(MAKE) $@); \
done
- @for f in $(CLEANFILES) $(OBJECTS); do \
+ @for f in $(CLEANFILES) $(INSTFILES) $(OBJECTS); do \
rm -f $(rhome)/$(subdir)/$${f}; \
done
@rmdir $(rhome)/$(subdir) 2>/dev/null \
View
@@ -92,6 +92,8 @@ distclean: clean
@-rm -f Makefile
maintainer-clean: distclean
+install install-strip uninstall TAGS info dvi check:
+
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
test -f $(distdir)/$${f} \
View
@@ -27,8 +27,6 @@ R: Makefile
(cd $${d} && $(MAKE) $@) || exit 1; \
done
-install install-strip uninstall TAGS info dvi check docs:
-
mostlyclean: clean
clean:
@for d in $(SUBDIRS); do \
@@ -38,6 +36,8 @@ distclean: clean
@rm -f Makefile
maintainer-clean: distclean
+install install-strip uninstall TAGS info dvi check:
+
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
test -f $(distdir)/$${f} \
@@ -69,6 +69,8 @@ distclean: clean
@-rm -f Makefile
maintainer-clean: distclean
+install install-strip uninstall TAGS info dvi check:
+
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
test -f $(distdir)/$${f} \
View
@@ -38,19 +38,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
$(SHELL) ./config.status
-R: Makefile Rconfig.h Rversion.h
- @$(MKINSTALLDIRS) $(top_builddir)/include
- @$(MKINSTALLDIRS) $(top_builddir)/include/R_ext
- @for f in $(SRC_HEADERS); do \
- $(INSTALL_DATA) $(srcdir)/$${f} $(top_builddir)/include; \
- done
- @for f in $(R_EXT_HEADERS); do \
- $(INSTALL_DATA) $(srcdir)/R_ext/$${f} \
- $(top_builddir)/include/R_ext; \
- done
- @for f in $(OBJ_HEADERS); do \
- $(INSTALL_DATA) $${f} $(top_builddir)/include; \
- done
+R: Makefile $(OBJ_HEADERS)
+ @$(MAKE) rhome=$(top_builddir) install
config.h: stamp-h
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
@@ -67,14 +56,33 @@ Rconfig.h: $(top_srcdir)/VERSION config.h
Rversion.h: $(top_srcdir)/VERSION $(top_srcdir)/date-stamp
@$(top_srcdir)/tools/GETVERSION > $@
-mostlyclean:
+install: installdirs
+ @for f in $(SRC_HEADERS); do \
+ $(INSTALL_DATA) $(srcdir)/$${f} $(rhome)/include; \
+ done
+ @for f in $(R_EXT_HEADERS); do \
+ $(INSTALL_DATA) $(srcdir)/R_ext/$${f} \
+ $(rhome)/include/R_ext; \
+ done
+ @for f in $(OBJ_HEADERS); do \
+ $(INSTALL_DATA) $${f} $(rhome)/include; \
+ done
+installdirs:
+ @$(MKINSTALLDIRS) $(rhome)/include
+ @$(MKINSTALLDIRS) $(rhome)/include/R_ext
+install-strip:
+ $(MAKE) INSTALL_PROGRAM="${INSTALL_PROGRAM} -s" install
+uninstall:
+ @rm -rf $(rhome)/include
+
+mostlyclean: clean
clean:
- @rm -f Rconfig.h Rversion.h FFDecl.h FFTab.h
+ @rm -f $(OBJ_HEADERS) FFDecl.h FFTab.h
distclean: clean
@rm -f Makefile config.h stamp-h
maintainer-clean: distclean
-install install-strip uninstall::
+TAGS info dvi check:
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
View
@@ -13,7 +13,7 @@ include $(top_builddir)/Makeconf
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
DISTFILES = Makefile.in
-SUBDIRS = profile $(R_PKGS)
+SUBDIRS = $(R_PKGS) profile
PKGS = $(R_PKGS)
@@ -26,10 +26,11 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
R:
@$(MKINSTALLDIRS) $(top_builddir)/library
- @for pkg in $(R_PKGS) profile; do \
+ @for pkg in $(SUBDIRS); do \
(cd $${pkg} && $(MAKE)) || exit 1; \
done
- @cp $(top_srcdir)/doc/html/R.css $(top_builddir)/library
+ @$(INSTALL_DATA) $(top_srcdir)/doc/html/R.css \
+ $(top_builddir)/library
docs:
@echo "building all R object docs (help, HTML, LaTeX, examples)"
@@ -63,6 +64,22 @@ DOCS:
cat $(top_builddir)/library/*/CONTENTS \
> $(top_builddir)/doc/html/search/index.txt
+install: installdirs
+ @echo "installing packages ..."
+ @cp -r $(top_builddir)/library $(rhome) || \
+ (cd $(top_builddir)/library; \
+ $(TAR) cf - [a-z]* | (cd $(rhome)/library; $(TAR) xof -))
+ @echo " building HTML index ..."
+ @$(rhome)/bin/R CMD build-help --rhome $(rhome) --htmllists
+installdirs:
+ @$(MKINSTALLDIRS) $(rhome)/library
+install-strip:
+ $(MAKE) INSTALL_PROGRAM="${INSTALL_PROGRAM} -s" install
+uninstall:
+ @echo "uninstalling packages ..."
+ @(cd $(rhome)/library; \
+ for p in $(R_PKGS); do rm -rf $${p}; done)
+
mostlyclean: clean
clean:
@for d in $(SUBDIRS); do \
@@ -74,10 +91,9 @@ distclean:
(cd $${d} && $(MAKE) $@); \
done
@rm -f Makefile
-
maintainer-clean: distclean
-install install-strip uninstall TAGS info dvi check::
+TAGS info dvi check:
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
View
@@ -144,14 +144,23 @@ $(srcdir)/gram.c: @MAINTAINER_MODE_TRUE@ $(srcdir)/gram.y
install: installdirs
@$(MAKE) install-bin
@if test -f $(libR_la); then $(MAKE) install-lib; fi
+installdirs:
+ @$(MKINSTALLDIRS) $(Rexecbindir)
+ @$(MKINSTALLDIRS) $(Rexeclibdir)
install-bin:
@$(top_srcdir)/tools/copy-if-change R.bin $(Rexecbindir)/R.bin
install-lib:
@USE_LIBTOOL_FALSE@ @$(top_srcdir)/tools/copy-if-change $(libR_la) $(Rexeclibdir)/libR.$(SHLIB_EXT)
@USE_LIBTOOL_TRUE@ @$(LIBTOOL) --mode=install $(INSTALL) $(libR_la) $(Rexeclibdir)
-installdirs:
- @$(MKINSTALLDIRS) $(Rexecbindir)
- @$(MKINSTALLDIRS) $(Rexeclibdir)
+install-strip:
+ $(MAKE) INSTALL_PROGRAM="${INSTALL_PROGRAM} -s" install
+uninstall:
+ @rm -f $(Rexecbindir)/R.bin
+ @rmdir $(Rexecbindir) 2>/dev/null \
+ || echo " subdir $(Rexecbindir) not removed"
+ @rm -f $(Rexeclibdir)/libR.$(SHLIBEXT)
+ @rmdir $(Rexeclibdir) 2>/dev/null \
+ || echo " subdir $(Rexeclibdir) not removed"
mostlyclean: clean
clean:
@@ -169,16 +178,15 @@ tags: TAGS
TAGS: $(SOURCES) $(EXTRA_SOURCES_C) $(HEADERS)
etags $(SOURCES) $(EXTRA_SOURCES_C) $(HEADERS)
+## Unused targets
+info dvi check:
+
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
-# Unused targets
-
-install-strip uninstall info dvi check::
-
## Automagically generated dependencies:
View
@@ -27,10 +27,23 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
R: Makefile
@for g in $(MODULES) ""; do \
if test -n "$${g}"; then \
- (cd $${g} && $(MAKE) R) || exit 1; \
+ (cd $${g} && $(MAKE) $@) || exit 1; \
fi; \
done
+install install-strip:
+## <FIXME>
+## This should really work for all subdirs ...
+ @for g in $(MODULES) ""; do \
+ if test -n "$${g}"; then \
+ (cd $${g} && $(MAKE) $@); \
+ fi; \
+ done
+## </FIXME>
+installdirs:
+uninstall:
+ @rm -rf $(Rexecmodulesdir)
+
mostlyclean: clean
clean:
## <FIXME>
@@ -56,6 +69,8 @@ distclean: clean
@-rm -f Makefile
maintainer-clean: distclean
+TAGS info dvi check:
+
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
test -f $(distdir)/$${f} \
@@ -71,6 +71,10 @@ install: installdirs
@USE_LIBTOOL_TRUE@ @$(LIBTOOL) --mode=install $(INSTALL) $(R_X11_la) $(Rexecmodulesdir)
installdirs:
@$(MKINSTALLDIRS) $(Rexecmodulesdir)
+install-strip:
+ $(MAKE) INSTALL_PROGRAM="${INSTALL_PROGRAM} -s" install
+uninstall:
+ @rm -f $(Rexecmodulesdir)/R_X11.$(SHLIB_EXT)
mostlyclean: clean
clean:
@@ -80,6 +84,8 @@ distclean: clean
@-rm -f Makefile
maintainer-clean: distclean
+TAGS info dvi check:
+
distdir: $(DISTFILES)
@for f in $(DISTFILES); do \
test -f $(distdir)/$${f} \
Oops, something went wrong.

0 comments on commit 89cc593

Please sign in to comment.