[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
|
---|
| 31 | <?xml version="1.0" encoding="ISO-8859-1"?>\
|
---|
| 32 | \
|
---|
| 33 | <!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\
|
---|
| 34 | <sublist>\
|
---|
| 35 | <name>Installed</name>\
|
---|
| 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 |
|
---|
[63fc514] | 64 | $(TRACKFILE): $(TRACKING_DIR)
|
---|
| 65 | $(Q)if ! [ -f $@ ]; then \
|
---|
| 66 | echo Initializing $(TRACKFILE) && \
|
---|
| 67 | echo '$(INITIAL_TRACK)' > $@ && \
|
---|
| 68 | $(MAKE) $(PACK_LIST) && \
|
---|
| 69 | for track in $(TRACKING_DIR)/*-*; do \
|
---|
| 70 | pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \
|
---|
| 71 | xsltproc --stringparam packages $(PACK_LIST) \
|
---|
| 72 | --stringparam package $$pack \
|
---|
| 73 | -o track.tmp $(XSLDIR)/bump.xsl $@ && \
|
---|
| 74 | sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \
|
---|
| 75 | xmllint --format --postvalid track.tmp > $@; \
|
---|
| 76 | done; \
|
---|
| 77 | rm -f track.tmp; \
|
---|
| 78 | fi
|
---|
[f4ed135] | 79 |
|
---|
[63fc514] | 80 | $(TRACKING_DIR):
|
---|
| 81 | @echo Creating $(TRACKING_DIR)
|
---|
| 82 | $(Q)mkdir -p $@
|
---|
| 83 |
|
---|
| 84 | $(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
|
---|
| 85 | $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
|
---|
| 86 |
|
---|
| 87 | $(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
|
---|
| 88 | @echo "Validating the book..."
|
---|
| 89 | $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
|
---|
| 90 | $(Q)xmllint --nonet --noent --xinclude --postvalid \
|
---|
| 91 | -o $@ $(BLFS_XML)/index.xml
|
---|
| 92 |
|
---|
| 93 | all: update $(BOOK_XML)
|
---|
| 94 |
|
---|
| 95 | update: $(BLFS_XML)
|
---|
| 96 | @echo Updating the book sources
|
---|
| 97 | $(Q)cd $(BLFS_XML) && svn up
|
---|
| 98 |
|
---|
| 99 | $(BLFS_XML):
|
---|
| 100 | @echo Getting the book sources...
|
---|
| 101 | $(Q)svn co $(SVN) $@
|
---|
[f4ed135] | 102 |
|
---|
| 103 | # Clean up
|
---|
| 104 |
|
---|
| 105 | clean:
|
---|
[63fc514] | 106 | rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml
|
---|
| 107 | rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
|
---|
| 108 | - $(MAKE) -C $(MENU) clean
|
---|
[f4ed135] | 109 |
|
---|
[63fc514] | 110 | .PHONY: clean all update $(CONFIG_OUT)
|
---|