[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 |
|
---|
| 8 | ifdef V
|
---|
| 9 | Q =
|
---|
| 10 | else
|
---|
| 11 | Q = @
|
---|
| 12 | endif
|
---|
[f4ed135] | 13 |
|
---|
[63a051c] | 14 | LANG=C
|
---|
| 15 | LC_ALL=C
|
---|
[63fc514] | 16 | TRACKING_DIR = tracking-dir
|
---|
[f4ed135] | 17 | TOPDIR=$(shell pwd)
|
---|
[63fc514] | 18 | BLFS_XML = $(TOPDIR)/blfs-xml
|
---|
| 19 | XSLDIR = $(TOPDIR)/xsl
|
---|
| 20 |
|
---|
| 21 | RENDERTMP = $(BLFS_XML)/tmp
|
---|
| 22 | BLFS_FULL = $(RENDERTMP)/blfs-full.xml
|
---|
| 23 | PACK_LIST = $(TOPDIR)/packages.xml
|
---|
| 24 | MENU = $(TOPDIR)/menu
|
---|
| 25 | CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
|
---|
| 26 | CONFIG_OUT = $(TOPDIR)/configuration
|
---|
| 27 | BOOK_XML = $(TOPDIR)/book.xml
|
---|
| 28 | TRACKFILE = $(TRACKING_DIR)/instpkg.xml
|
---|
| 29 |
|
---|
| 30 | define 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>
|
---|
| 37 | endef
|
---|
| 38 |
|
---|
| 39 | SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
|
---|
| 40 |
|
---|
| 41 | ALLXML := $(filter-out $(RENDERTMP)/%, \
|
---|
| 42 | $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml))
|
---|
| 43 | ALLXSL := $(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)' > $@ && \
|
---|
| 72 | $(MAKE) $(PACK_LIST) && \
|
---|
| 73 | for track in $(TRACKING_DIR)/*-*; do \
|
---|
[52389b5] | 74 | if [ -f $track ]; then \
|
---|
[63fc514] | 75 | pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \
|
---|
| 76 | xsltproc --stringparam packages $(PACK_LIST) \
|
---|
| 77 | --stringparam package $$pack \
|
---|
| 78 | -o track.tmp $(XSLDIR)/bump.xsl $@ && \
|
---|
| 79 | sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \
|
---|
| 80 | xmllint --format --postvalid track.tmp > $@; \
|
---|
[52389b5] | 81 | fi; \
|
---|
[63fc514] | 82 | done; \
|
---|
| 83 | rm -f track.tmp; \
|
---|
| 84 | fi
|
---|
[f4ed135] | 85 |
|
---|
[63fc514] | 86 | $(TRACKING_DIR):
|
---|
| 87 | @echo Creating $(TRACKING_DIR)
|
---|
| 88 | $(Q)mkdir -p $@
|
---|
| 89 |
|
---|
| 90 | $(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
|
---|
| 91 | $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
|
---|
| 92 |
|
---|
| 93 | $(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
|
---|
| 94 | @echo "Validating the book..."
|
---|
| 95 | $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
|
---|
| 96 | $(Q)xmllint --nonet --noent --xinclude --postvalid \
|
---|
| 97 | -o $@ $(BLFS_XML)/index.xml
|
---|
| 98 |
|
---|
| 99 | all: update $(BOOK_XML)
|
---|
| 100 |
|
---|
| 101 | update: $(BLFS_XML)
|
---|
| 102 | @echo Updating the book sources
|
---|
| 103 | $(Q)cd $(BLFS_XML) && svn up
|
---|
| 104 |
|
---|
| 105 | $(BLFS_XML):
|
---|
| 106 | @echo Getting the book sources...
|
---|
| 107 | $(Q)svn co $(SVN) $@
|
---|
[f4ed135] | 108 |
|
---|
| 109 | # Clean up
|
---|
| 110 |
|
---|
| 111 | clean:
|
---|
[63fc514] | 112 | rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml
|
---|
| 113 | rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
|
---|
| 114 | - $(MAKE) -C $(MENU) clean
|
---|
[f4ed135] | 115 |
|
---|
[63fc514] | 116 | .PHONY: clean all update $(CONFIG_OUT)
|
---|