source: BLFS/Makefile@ 34986b8

ablfs
Last change on this file since 34986b8 was 34986b8, checked in by Pierre Labastie <pierre@…>, 13 years ago

Add the version parameter of bump.xsl to Makefile
Separates first install of instpkg.xml from subsequent updates due to
new packages present in TRACK_DIR

  • Property mode set to 100644
File size: 3.5 KB
RevLine 
[f4ed135]1# From the Build Scripts Written By: Jim Gifford <lfs@jg555.com>
2# Modified By: Joe Ciccone <jciccone@linuxfromscratch.org
3# Additional changes: George Boudreau <georgeb@linuxfromscratch.org>
[63fc514]4# Pierre Labastie <pierre.labastie at neuf.fr>
[f4ed135]5
[63fc514]6# $Id: Makefile 36 2012-02-22 13:01:46Z labastie $
7
8ifdef V
9 Q =
10else
11 Q = @
12endif
[f4ed135]13
[63a051c]14LANG=C
15LC_ALL=C
[63fc514]16TRACKING_DIR = tracking-dir
[f4ed135]17TOPDIR=$(shell pwd)
[63fc514]18BLFS_XML = $(TOPDIR)/blfs-xml
19XSLDIR = $(TOPDIR)/xsl
20
21RENDERTMP = $(BLFS_XML)/tmp
22BLFS_FULL = $(RENDERTMP)/blfs-full.xml
23PACK_LIST = $(TOPDIR)/packages.xml
24MENU = $(TOPDIR)/menu
25CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
26CONFIG_OUT = $(TOPDIR)/configuration
27BOOK_XML = $(TOPDIR)/book.xml
28TRACKFILE = $(TRACKING_DIR)/instpkg.xml
29
30define INITIAL_TRACK
[52389b5]31<?xml version="1.0" encoding="ISO-8859-1"?>\n\
32\n\
33<!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\n\
34<sublist>\n\
35 <name>Installed</name>\n\
[63fc514]36</sublist>
37endef
38
39SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
40
41ALLXML := $(filter-out $(RENDERTMP)/%, \
42 $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml))
43ALLXSL := $(filter-out $(RENDERTMP)/%, \
44 $(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl))
45
46$(BOOK_XML): $(CONFIG_OUT)
47 $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL)
48
49$(CONFIG_OUT): $(CONFIG_CONFIG_IN) $(MENU)/mconf
50 $(Q)$(MENU)/mconf $(CONFIG_CONFIG_IN)
[f4ed135]51
[63fc514]52$(MENU)/mconf:
53 $(Q)$(MAKE) -C $(MENU) ncurses conf mconf
[f4ed135]54
[63fc514]55$(CONFIG_CONFIG_IN): $(PACK_LIST) $(XSLDIR)/gen_config.xsl
56 $(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST)
[f4ed135]57
[63fc514]58$(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE)
59 $(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \
60 -o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL)
61 $(Q)xmllint --postvalid --format -o $@ $@.tmp
62 $(Q)rm $@.tmp
[f4ed135]63
[52389b5]64# Beware of the echo '$(INITIAL_TRACK)' command below:
65# if default shell is bash, needs echo -e
66# if default shell is sh : echo is enough
67# Don't ask me why
[63fc514]68$(TRACKFILE): $(TRACKING_DIR)
69 $(Q)if ! [ -f $@ ]; then \
70 echo Initializing $(TRACKFILE) && \
71 echo '$(INITIAL_TRACK)' > $@ && \
[34986b8]72 $(MAKE) $(PACK_LIST); \
73 fi
74 @for track in $(TRACKING_DIR)/*-*; do \
75 if [ -f $$track ]; then \
[63fc514]76 pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \
[34986b8]77 version=$$(echo $$track | sed 's@.*-\([0-9c].*\)@\1@') && \
[63fc514]78 xsltproc --stringparam packages $(PACK_LIST) \
79 --stringparam package $$pack \
[34986b8]80 --stringparam version $$version \
[63fc514]81 -o track.tmp $(XSLDIR)/bump.xsl $@ && \
82 sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \
83 xmllint --format --postvalid track.tmp > $@; \
[52389b5]84 fi; \
[63fc514]85 done; \
[34986b8]86 rm -f track.tmp
[f4ed135]87
[63fc514]88$(TRACKING_DIR):
89 @echo Creating $(TRACKING_DIR)
90 $(Q)mkdir -p $@
91
92$(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
93 $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
94
95$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
96 @echo "Validating the book..."
97 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
98 $(Q)xmllint --nonet --noent --xinclude --postvalid \
99 -o $@ $(BLFS_XML)/index.xml
100
101all: update $(BOOK_XML)
102
103update: $(BLFS_XML)
104 @echo Updating the book sources
105 $(Q)cd $(BLFS_XML) && svn up
106
107$(BLFS_XML):
108 @echo Getting the book sources...
109 $(Q)svn co $(SVN) $@
[f4ed135]110
111# Clean up
112
113clean:
[63fc514]114 rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml
115 rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
116 - $(MAKE) -C $(MENU) clean
[f4ed135]117
[63fc514]118.PHONY: clean all update $(CONFIG_OUT)
Note: See TracBrowser for help on using the repository browser.