Skip to content

Commit

Permalink
start on re-organizing the build process
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@56465 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Jul 21, 2011
1 parent bd2c625 commit c4f80bc
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 6 deletions.
2 changes: 1 addition & 1 deletion share/make/basepkg.mk
Expand Up @@ -124,7 +124,7 @@ mklazycomp: $(top_builddir)/library/$(pkg)/R/$(pkg).rdb


mkRsimple: mkRsimple:
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg) @$(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: mkpo:
@if test -d $(srcdir)/inst/po; then \ @if test -d $(srcdir)/inst/po; then \
Expand Down
8 changes: 8 additions & 0 deletions share/make/lazycomp.mk
@@ -1,7 +1,15 @@
## ${R_HOME}/share/make/lazycomp.mk ## ${R_HOME}/share/make/lazycomp.mk
## Use for all packages except base, tools, datasets, methods

$(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R $(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg) @$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg)
@$(ECHO) "byte-compiling package '$(pkg)'" @$(ECHO) "byte-compiling package '$(pkg)'"
@$(ECHO) "tools:::makeLazyLoading(\"$(pkg)\")" | \ @$(ECHO) "tools:::makeLazyLoading(\"$(pkg)\")" | \
R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1 \ R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1 \
R_DEFAULT_PACKAGES=$(DEFPKGS) LC_ALL=C $(R_EXE) > /dev/null R_DEFAULT_PACKAGES=$(DEFPKGS) LC_ALL=C $(R_EXE) > /dev/null

Rsimple: mkRsimple
Rlazy: mkRsimple mklazy
Rlazycomp: mkRsimple mklazycomp


2 changes: 2 additions & 0 deletions share/make/vars.mk
Expand Up @@ -4,6 +4,8 @@
R_PKGS_BASE = base tools utils grDevices graphics stats datasets methods grid splines stats4 tcltk compiler R_PKGS_BASE = base tools utils grDevices graphics stats datasets methods grid splines stats4 tcltk compiler
## Those which can be installed initially compiled ## Those which can be installed initially compiled
R_PKGS_BASE1 = utils grDevices graphics stats datasets methods grid splines stats4 tcltk 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 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* # there are dependencies in src/library/Recommended/Makefile*
Expand Down
23 changes: 23 additions & 0 deletions src/library/Makefile.in
Expand Up @@ -179,3 +179,26 @@ distdir: $(DISTFILES)
(cd $${d} && $(MAKE) distdir) \ (cd $${d} && $(MAKE) distdir) \
|| exit 1; \ || exit 1; \
done 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


10 changes: 10 additions & 0 deletions src/library/base/Makefile.in
Expand Up @@ -39,3 +39,13 @@ $(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R
R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null
@$(INSTALL_DATA) $(srcdir)/baseloader.R \ @$(INSTALL_DATA) $(srcdir)/baseloader.R \
$(top_builddir)/library/$(pkg)/R/$(pkg) $(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
3 changes: 3 additions & 0 deletions src/library/datasets/Makefile.in
Expand Up @@ -35,3 +35,6 @@ all: Makefile DESCRIPTION
$(top_builddir)/library/$(pkg)/data $(top_builddir)/library/$(pkg)/data


include $(top_srcdir)/share/make/basepkg.mk include $(top_srcdir)/share/make/basepkg.mk

# dummy targets
Rsimple Rlazy Rlazycomp:
1 change: 0 additions & 1 deletion src/library/graphics/Makefile.in
Expand Up @@ -27,6 +27,5 @@ all: Makefile DESCRIPTION
@BYTE_COMPILE_PACKAGES_FALSE@ @$(MAKE) mklazy @BYTE_COMPILE_PACKAGES_FALSE@ @$(MAKE) mklazy
@BYTE_COMPILE_PACKAGES_TRUE@ @$(MAKE) mklazycomp @BYTE_COMPILE_PACKAGES_TRUE@ @$(MAKE) mklazycomp



include $(top_srcdir)/share/make/basepkg.mk include $(top_srcdir)/share/make/basepkg.mk
include $(top_srcdir)/share/make/lazycomp.mk include $(top_srcdir)/share/make/lazycomp.mk
22 changes: 18 additions & 4 deletions src/library/methods/Makefile.in
Expand Up @@ -17,13 +17,15 @@ pkg = methods
RSRC = `LC_COLLATE=C ls $(srcdir)/R/*.R` RSRC = `LC_COLLATE=C ls $(srcdir)/R/*.R`


R_EXE = $(top_builddir)/bin/R --vanilla --slave R_EXE = $(top_builddir)/bin/R --vanilla --slave
EXTRAS = R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1


all: Makefile DESCRIPTION all: Makefile DESCRIPTION
@$(ECHO) "building package '$(pkg)'" @$(ECHO) "building package '$(pkg)'"
@$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg) @$(MKINSTALLDIRS) $(top_builddir)/library/$(pkg)
@$(MAKE) mkR2 mkdesc mkpo @$(MAKE) mkR2 mkdesc mkpo
@$(MAKE) mksrc @$(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 include $(top_srcdir)/share/make/basepkg.mk


Expand All @@ -34,13 +36,25 @@ RfilesLazy: $(top_builddir)/library/$(pkg)/R/$(pkg).rdb
## NAMESPACE in the library tree. ## NAMESPACE in the library tree.
## This depends on many other things, including the list of primitives. ## This depends on many other things, including the list of primitives.
## Depending on names.c at least catches the latter. ## 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_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R $(srcdir)/NAMESPACE \
$(top_srcdir)/src/main/names.c $(top_srcdir)/src/main/names.c
@rm -f $(top_builddir)/library/$(pkg)/Meta/nsInfo.rds $@ @rm -f $(top_builddir)/library/$(pkg)/Meta/nsInfo.rds $@
@$(INSTALL_DATA) all.R $(top_builddir)/library/$(pkg)/R/$(pkg) @$(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)\"))" | \ @$(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 \ @$(INSTALL_DATA) $(top_srcdir)/share/R/nspackloader.R \
$(top_builddir)/library/$(pkg)/R/$(pkg) $(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)
10 changes: 10 additions & 0 deletions src/library/tools/Makefile.in
Expand Up @@ -49,3 +49,13 @@ $(top_builddir)/library/$(pkg)/R/$(pkg).rdb: all.R
$(ECHO) "makeLazyLoading(\"$(pkg)\")") | \ $(ECHO) "makeLazyLoading(\"$(pkg)\")") | \
R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1 \ R_COMPILE_PKGS=1 R_COMPILER_SUPPRESS_ALL=1 \
R_DEFAULT_PACKAGES=NULL LC_ALL=C $(R_EXE) > /dev/null 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.