Merge trunk rev 3896:

Unless explicitely set on the command line, the REV parameter
in BLFS tools make is the same as the preceding used one. Formerly, it
was set to sysv unless defined on the command line
This commit is contained in:
Pierre Labastie 2017-03-02 16:40:34 +00:00
parent eb8667a45d
commit 796cd28b08
2 changed files with 66 additions and 29 deletions

View file

@ -5,16 +5,6 @@
# $Id$ # $Id$
ifeq ($(REV),)
REV = sysv
endif
ifneq ($(REV),sysv)
ifneq ($(REV),systemd)
$(error The REV variable is $(REV), but can only be 'sysv' or 'systemd')
endif
endif
ifdef V ifdef V
Q = Q =
else else
@ -25,21 +15,39 @@ endif
LANG=C LANG=C
LC_ALL=C LC_ALL=C
# The right-hand side is updated by jhalfs # Makefile should reside in a directory where there are two subdirectories
TRACKING_DIR = tracking-dir # initially:
TOPDIR=$(shell pwd) TOPDIR = $(shell pwd)
BLFS_XML = $(TOPDIR)/blfs-xml # the stylesheets
XSLDIR = $(TOPDIR)/xsl XSLDIR = $(TOPDIR)/xsl
# the menu program sources
MENU = $(TOPDIR)/menu
RENDERTMP = $(BLFS_XML)/tmp # Those directories and files will be created and populated by make:
BLFS_FULL = $(RENDERTMP)/blfs-full.xml # directory of the book sources:
PACK_LIST = $(TOPDIR)/packages.xml BLFS_XML = $(TOPDIR)/blfs-xml
MENU = $(TOPDIR)/menu # contains the REV used in the preceding call:
REVFILE = $(TOPDIR)/revision
# the list of packages:
PACK_LIST = $(TOPDIR)/packages.xml
# the generated menu input:
CONFIG_CONFIG_IN = $(TOPDIR)/Config.in CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
CONFIG_OUT = $(TOPDIR)/configuration # menu output:
BOOK_XML = $(TOPDIR)/book.xml CONFIG_OUT = $(TOPDIR)/configuration
TRACKFILE = $(TRACKING_DIR)/instpkg.xml # the linear book:
BOOK_XML = $(TOPDIR)/book.xml
RENDERTMP = $(BLFS_XML)/tmp
BLFS_FULL = $(RENDERTMP)/blfs-full.xml
# The right-hand side is updated by jhalfs:
# Where the tracking file resides:
TRACKING_DIR = tracking-dir
# Will be created by make, if not existent
TRACKFILE = $(TRACKING_DIR)/instpkg.xml
# Initial content of the tracking file
define INITIAL_TRACK define INITIAL_TRACK
<?xml version="1.0" encoding="ISO-8859-1"?>\n\ <?xml version="1.0" encoding="ISO-8859-1"?>\n\
\n\ \n\
@ -52,9 +60,30 @@ endef
SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
ALLXML := $(filter-out $(RENDERTMP)/%, \ ALLXML := $(filter-out $(RENDERTMP)/%, \
$(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml)) $(shell if [ -d $(BLFS_XML) ]; then \
find $(BLFS_XML) -name \*.xml; \
fi))
ALLXSL := $(filter-out $(RENDERTMP)/%, \ ALLXSL := $(filter-out $(RENDERTMP)/%, \
$(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl)) $(shell if [ -d $(BLFS_XML) ]; then \
find $(BLFS_XML) -name \*.xsl; \
fi))
# Try to set the REV variable according to previous runs, except when
# set on the command line:
REV1 := $(shell if [ -f $(REVFILE) ] ; then cat $(REVFILE); fi)
ifneq ($(origin REV),command line)
ifdef REV1
REV = $(REV1)
else
REV = not defined
endif
endif
ifneq ($(REV),sysv)
ifneq ($(REV),systemd)
$(error The REV variable is $(REV), but can only be 'sysv' or 'systemd')
endif
endif
$(BOOK_XML): $(CONFIG_OUT) $(BOOK_XML): $(CONFIG_OUT)
$(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL) $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL)
@ -106,6 +135,9 @@ $(TRACKING_DIR):
$(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL) $(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
$(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@ $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
ifneq ($(REV),$(REV1))
$(BLFS_FULL): FORCE
endif
$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL) $(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
$(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP) $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
@echo "Adjusting for revision $(REV)..." @echo "Adjusting for revision $(REV)..."
@ -117,6 +149,7 @@ $(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
@echo "Validating the book..." @echo "Validating the book..."
$(Q)xmllint --nonet --noent --postvalid \ $(Q)xmllint --nonet --noent --postvalid \
-o $@ $(RENDERTMP)/blfs-prof.xml -o $@ $(RENDERTMP)/blfs-prof.xml
$(Q)echo $(REV) > $(REVFILE)
all: update $(BOOK_XML) all: update $(BOOK_XML)
@ -135,4 +168,5 @@ clean:
rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
- $(MAKE) -C $(MENU) clean - $(MAKE) -C $(MENU) clean
.PHONY: clean all update $(CONFIG_OUT) FORCE:
.PHONY: clean all update $(CONFIG_OUT) FORCE

View file

@ -11,12 +11,13 @@ BLFS_ROOT : where the installed tools will be installed, relative to $HOME.
Must start with a '/' (default /blfs_root) Must start with a '/' (default /blfs_root)
BLFS_BRANCH_ID: development, branch-xxx, xxx (where xxx is a valid tag) BLFS_BRANCH_ID: development, branch-xxx, xxx (where xxx is a valid tag)
(default development) (default development)
INIT_SYSTEM : which book do you want? 'sysv' or 'systemd' (default sysv)
Examples: Examples:
1 - If you plan to use the tools to build BLFS on top of LFS, but you did not 1 - If you plan to use the tools to build BLFS on top of LFS, but you did not
use jhalfs, or forgot to include the jhalfs-blfs tools: use jhalfs, or forgot to include the jhalfs-blfs tools:
(as root) mkdir -p /var/lib/jhalfs/BLFS && chown -R <user> /var/lib/jhalfs (as root) mkdir -p /var/lib/jhalfs/BLFS && chown -R <user> /var/lib/jhalfs
(as user) ./install-blfs-tools.sh (as user) INIT_SYSTEM=<your system> ./install-blfs-tools.sh
2 - To install with only user privileges: 2 - To install with only user privileges (default to sysv):
TRACKING_DIR=$HOME/blfs_root/trackdir ./install-blfs-tools.sh TRACKING_DIR=$HOME/blfs_root/trackdir ./install-blfs-tools.sh
inline_doc inline_doc
@ -56,6 +57,7 @@ BLFS_TOOL='y'
BUILDDIR=$(cd ~;pwd) BUILDDIR=$(cd ~;pwd)
BLFS_ROOT="${BLFS_ROOT:=/blfs_root}" BLFS_ROOT="${BLFS_ROOT:=/blfs_root}"
TRACKING_DIR="${TRACKING_DIR:=/var/lib/jhalfs/BLFS}" TRACKING_DIR="${TRACKING_DIR:=/var/lib/jhalfs/BLFS}"
INIT_SYSTEM="${INIT_SYSTEM:=sysv}"
[[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}" [[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
@ -90,9 +92,9 @@ cp -r menu ${BUILDDIR}${BLFS_ROOT}
cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT} cp $COMMON_DIR/progress_bar.sh ${BUILDDIR}${BLFS_ROOT}
cp README.BLFS ${BUILDDIR}${BLFS_ROOT} cp README.BLFS ${BUILDDIR}${BLFS_ROOT}
[[ $VERBOSITY > 0 ]] && echo "... OK" [[ $VERBOSITY > 0 ]] && echo "... OK"
[[ $VERBOSITY > 0 ]] && echo -n Cleaning the ${BUILDDIR}${BLFS_ROOT} directory
# Clean-up # Clean-up
[[ $VERBOSITY > 0 ]] && echo Cleaning the ${BUILDDIR}${BLFS_ROOT} directory
make -C ${BUILDDIR}${BLFS_ROOT}/menu clean make -C ${BUILDDIR}${BLFS_ROOT}/menu clean
rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn rm -rf ${BUILDDIR}${BLFS_ROOT}/libs/.svn
rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn rm -rf ${BUILDDIR}${BLFS_ROOT}/xsl/.svn
@ -112,9 +114,10 @@ sed -i s@tracking-dir@$TRACKING_DIR@ \
mkdir -p $TRACKING_DIR mkdir -p $TRACKING_DIR
[[ $VERBOSITY > 0 ]] && echo "... OK" [[ $VERBOSITY > 0 ]] && echo "... OK"
[[ $VERBOSITY > 0 ]] && echo -n "Downloading and validating the book (may take some time)" [[ $VERBOSITY > 0 ]] && echo "Downloading and validating the book (may take some time)"
make -j1 -C $BUILDDIR$BLFS_ROOT \ make -j1 -C $BUILDDIR$BLFS_ROOT \
TRACKING_DIR=$TRACKING_DIR \ TRACKING_DIR=$TRACKING_DIR \
REV=$INIT_SYSTEM \
SVN=svn://svn.linuxfromscratch.org/BLFS/$BLFS_TREE \ SVN=svn://svn.linuxfromscratch.org/BLFS/$BLFS_TREE \
$BUILDDIR$BLFS_ROOT/packages.xml $BUILDDIR$BLFS_ROOT/packages.xml
[[ $VERBOSITY > 0 ]] && echo "... OK" [[ $VERBOSITY > 0 ]] && echo "... OK"