source: BLFS/Makefile@ 96a30c7

ablfs
Last change on this file since 96a30c7 was 63fc514, checked in by Pierre Labastie <pierre@…>, 13 years ago

Initial modificaiton of BLFS tools

  • Property mode set to 100644
File size: 3.2 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
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>
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
[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
93all: update $(BOOK_XML)
94
95update: $(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
105clean:
[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)
Note: See TracBrowser for help on using the repository browser.