Changeset 796cd28 for BLFS/Makefile


Ignore:
Timestamp:
03/02/2017 04:40:34 PM (8 years ago)
Author:
Pierre Labastie <pierre@…>
Branches:
new_features
Children:
a9dadcf
Parents:
eb8667a
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BLFS/Makefile

    reb8667a r796cd28  
    55
    66# $Id$
    7 
    8 ifeq ($(REV),)
    9   REV = sysv
    10 endif
    11 
    12 ifneq ($(REV),sysv)
    13   ifneq ($(REV),systemd)
    14     $(error The REV variable is $(REV), but can only be 'sysv' or 'systemd')
    15   endif
    16 endif
    177
    188ifdef V
     
    2616LC_ALL=C
    2717
    28 # The right-hand side is updated by jhalfs
     18# Makefile should reside in a directory where there are two subdirectories
     19# initially:
     20TOPDIR           = $(shell pwd)
     21# the stylesheets
     22XSLDIR           = $(TOPDIR)/xsl
     23# the menu program sources
     24MENU             = $(TOPDIR)/menu
     25
     26# Those directories and files will be created and populated by make:
     27# directory of the book sources:
     28BLFS_XML         = $(TOPDIR)/blfs-xml
     29# contains the REV used in the preceding call:
     30REVFILE          = $(TOPDIR)/revision
     31# the list of packages:
     32PACK_LIST        = $(TOPDIR)/packages.xml
     33# the generated menu input:
     34CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
     35# menu output:
     36CONFIG_OUT       = $(TOPDIR)/configuration
     37# the linear book:
     38BOOK_XML         = $(TOPDIR)/book.xml
     39
     40RENDERTMP        = $(BLFS_XML)/tmp
     41BLFS_FULL        = $(RENDERTMP)/blfs-full.xml
     42
     43# The right-hand side is updated by jhalfs:
     44# Where the tracking file resides:
    2945TRACKING_DIR = tracking-dir
    30 TOPDIR=$(shell pwd)
    31 BLFS_XML = $(TOPDIR)/blfs-xml
    32 XSLDIR = $(TOPDIR)/xsl
    3346
    34 RENDERTMP = $(BLFS_XML)/tmp
    35 BLFS_FULL = $(RENDERTMP)/blfs-full.xml
    36 PACK_LIST = $(TOPDIR)/packages.xml
    37 MENU = $(TOPDIR)/menu
    38 CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
    39 CONFIG_OUT = $(TOPDIR)/configuration
    40 BOOK_XML = $(TOPDIR)/book.xml
    41 TRACKFILE = $(TRACKING_DIR)/instpkg.xml
     47# Will be created  by make, if not existent
     48TRACKFILE        = $(TRACKING_DIR)/instpkg.xml
    4249
     50# Initial content of the tracking file
    4351define INITIAL_TRACK
    4452<?xml version="1.0" encoding="ISO-8859-1"?>\n\
     
    5361
    5462ALLXML := $(filter-out $(RENDERTMP)/%, \
    55         $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml))
     63              $(shell if [ -d $(BLFS_XML) ]; then \
     64                        find $(BLFS_XML) -name \*.xml; \
     65                      fi))
    5666ALLXSL := $(filter-out $(RENDERTMP)/%, \
    57         $(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl))
     67              $(shell if [ -d $(BLFS_XML) ]; then \
     68                        find $(BLFS_XML) -name \*.xsl; \
     69                      fi))
     70
     71# Try to set the REV variable according to previous runs, except when
     72# set on the command line:
     73REV1 := $(shell if [ -f $(REVFILE) ] ; then cat $(REVFILE); fi)
     74ifneq ($(origin REV),command line)
     75  ifdef REV1
     76    REV = $(REV1)
     77  else
     78    REV = not defined
     79  endif
     80endif
     81
     82ifneq ($(REV),sysv)
     83  ifneq ($(REV),systemd)
     84    $(error The REV variable is $(REV), but can only be 'sysv' or 'systemd')
     85  endif
     86endif
    5887
    5988$(BOOK_XML): $(CONFIG_OUT)
     
    107136        $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
    108137
     138ifneq ($(REV),$(REV1))
     139$(BLFS_FULL): FORCE
     140endif
    109141$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
    110142        $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
     
    118150        $(Q)xmllint --nonet --noent --postvalid \
    119151          -o $@ $(RENDERTMP)/blfs-prof.xml
     152        $(Q)echo $(REV) > $(REVFILE)
    120153
    121154all: update $(BOOK_XML)
     
    136169        - $(MAKE) -C $(MENU) clean
    137170
    138 .PHONY: clean all update $(CONFIG_OUT)
     171FORCE:
     172.PHONY: clean all update $(CONFIG_OUT) FORCE
Note: See TracChangeset for help on using the changeset viewer.