Permalink
Browse files

start on re-organizing the build process

git-svn-id: https://svn.r-project.org/R/trunk@56465 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information...
ripley
ripley committed Jul 21, 2011
1 parent bd2c625 commit c4f80bc6dce685c7be431d30519014515e41aa1e
View
@@ -124,7 +124,7 @@ mklazycomp: $(top_builddir)/library/$(pkg)/R/$(pkg).rdb
mkRsimple:
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
- @rm -f $(top_builddir)/library/$(pkg)/R/$(pkg).Rd?
+ @rm -f $(top_builddir)/library/$(pkg)/R/$(pkg).rd?
mkpo:
@if test -d $(srcdir)/inst/po; then \
View
@@ -1,7 +1,15 @@
## ${R_HOME}/share/make/lazycomp.mk
+## Use for all packages except base, tools, datasets, methods
+
$(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
@$(ECHO) "byte-compiling package '$(pkg)'"
@$(ECHO) "tools:::makeLazyLoading(\"$(pkg)\")" | \
R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1 \
R_DEFAULT_PACKAGES=$(DEFPKGS) LC_ALL=C $(R_EXE) > /dev/null
+
+Rsimple: mkRsimple
+Rlazy: mkRsimple mklazy
+Rlazycomp: mkRsimple mklazycomp
+
+
View
@@ -4,6 +4,8 @@
R_PKGS_BASE = base tools utils grDevices graphics stats datasets methods grid splines stats4 tcltk compiler
## Those which can be installed initially compiled
R_PKGS_BASE1 = utils grDevices graphics stats datasets methods grid splines stats4 tcltk
+## Those with standard make procedures (not datasets, methods)
+R_PKGS_BASE2 = base tools utils grDevices graphics stats grid splines stats4 tcltk compiler
R_PKGS_RECOMMENDED = MASS lattice Matrix nlme survival boot cluster codetools foreign KernSmooth rpart class nnet spatial mgcv
# there are dependencies in src/library/Recommended/Makefile*
View
@@ -179,3 +179,26 @@ distdir: $(DISTFILES)
(cd $${d} && $(MAKE) distdir) \
|| exit 1; \
done
+
+### ----------- targets for R-core use ----------
+### These do not change datasets (never lazy-loaded)
+
+## methods needs to be dumped, so is omitted here.
+Rsimple:
+ @for pkg in $(R_PKGS_BASE2); do \
+ (cd $${pkg} && $(MAKE) Rsimple) || exit 1; \
+ done
+
+## This is not parallel-safe
+Rlazy:
+ @for pkg in $(R_PKGS_BASE2) methods; do \
+ (cd $${pkg} && $(MAKE) Rlazy) || exit 1; \
+ done
+
+## This is not parallel-safe
+Rlazycomp:
+ @for pkg in $(R_PKGS_BASE2) methods; do \
+ (cd $${pkg} && $(MAKE) Rlazycomp) || exit 1; \
+ done
+
+
@@ -39,3 +39,13 @@ $(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R
R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null
@$(INSTALL_DATA) $(srcdir)/baseloader.R \
$(top_builddir)/library/$(pkg)/R/$(pkg)
+
+Rsimple: mkRsimple
+
+Rlazy: mkRsimple
+ @cat $(srcdir)/makebasedb.R | \
+ R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null
+ @$(INSTALL_DATA) $(srcdir)/baseloader.R \
+ $(top_builddir)/library/$(pkg)/R/$(pkg)
+
+Rlazycomp: mkRsimple mklazycomp
@@ -35,3 +35,6 @@ all: Makefile DESCRIPTION
$(top_builddir)/library/$(pkg)/data
include $(top_srcdir)/share/make/basepkg.mk
+
+# dummy targets
+Rsimple Rlazy Rlazycomp:
@@ -27,6 +27,5 @@ all: Makefile DESCRIPTION
@BYTE_COMPILE_PACKAGES_FALSE@ @$(MAKE) mklazy
@BYTE_COMPILE_PACKAGES_TRUE@ @$(MAKE) mklazycomp
-
include $(top_srcdir)/share/make/basepkg.mk
include $(top_srcdir)/share/make/lazycomp.mk
@@ -17,13 +17,15 @@ pkg = methods
RSRC = `LC_COLLATE=C ls $(srcdir)/R/*.R`
R_EXE = $(top_builddir)/bin/R --vanilla --slave
+EXTRAS = R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1
all: Makefile DESCRIPTION
@$(ECHO) "building package '$(pkg)'"
@$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)
@$(MAKE) mkR2 mkdesc mkpo
@$(MAKE) mksrc
- @$(MAKE) RfilesLazy
+@BYTE_COMPILE_PACKAGES_TRUE@ @$(MAKE) RfilesLazy EXTRAS2=$(EXTRAS)
+@BYTE_COMPILE_PACKAGES_FALSE@ @$(MAKE) RfilesLazy
include $(top_srcdir)/share/make/basepkg.mk
@@ -34,13 +36,25 @@ RfilesLazy: $(top_builddir)/library/$(pkg)/R/$(pkg).rdb
## NAMESPACE in the library tree.
## This depends on many other things, including the list of primitives.
## Depending on names.c at least catches the latter.
-EXTRAS = @BYTE_COMPILE_PACKAGES_TRUE@ R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1
$(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R $(srcdir)/NAMESPACE \
$(top_srcdir)/src/main/names.c
@rm -f $(top_builddir)/library/$(pkg)/Meta/nsInfo.rds $@
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
-@BYTE_COMPILE_PACKAGES_TRUE@ @$(ECHO) "byte-compiling '$(pkg)'"
+ @if test -n "$(EXTRAS2)"; then \
+ $(ECHO) "byte-compiling '$(pkg)'"; \
+ fi
@$(ECHO) "invisible(loadNamespace(\"$(pkg)\"))" | \
- $(EXTRAS) R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE)
+ $(EXTRAS2) R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE)
@$(INSTALL_DATA) $(top_srcdir)/share/R/nspackloader.R \
$(top_builddir)/library/$(pkg)/R/$(pkg)
+
+## not supported
+Rsimple:
+
+Rlazy:
+ @rm -f $(top_builddir)/library/$(pkg)/R/$(pkg).rdb
+ @$(MAKE) RfilesLazy
+
+Rlazycomp:
+ @rm -f $(top_builddir)/library/$(pkg)/R/$(pkg).rdb
+ @$(MAKE) RfilesLazy EXTRAS2=$(EXTRAS)
@@ -49,3 +49,13 @@ $(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R
$(ECHO) "makeLazyLoading(\"$(pkg)\")") | \
R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1 \
R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null
+
+Rsimple: mkRsimple
+
+Rlazy: mkRsimple
+ @$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
+ @(cat $(srcdir)/R/makeLazyLoad.R; \
+ $(ECHO) "makeLazyLoading(\"$(pkg)\")") | \
+ R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null
+
+Rlazycomp: mkRsimple mklazycomp

0 comments on commit c4f80bc

Please sign in to comment.