source: BLFS/Makefile@ 7bbcce3

new_features
Last change on this file since 7bbcce3 was 7bd0866, checked in by Pierre Labastie <pierre@…>, 8 years ago

Merge trunk up to revision 3864

  • Property mode set to 100644
File size: 4.1 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>
[e576789]4# Pierre Labastie <pierre.labastie at neuf.fr>
[f4ed135]5
[5795ad7]6# $Id$
[f4ed135]7
[7bd0866]8ifeq ($(REV),)
9 REV = sysv
10endif
11
12ifneq ($(REV),sysv)
13 ifneq ($(REV),systemd)
14 $(error The REV variable is $(REV), but can only be 'sysv' or 'systemd')
15 endif
16endif
17
[e576789]18ifdef V
19 Q =
20else
21 Q = @
22endif
23
24# Known behavior
[63a051c]25LANG=C
26LC_ALL=C
[e576789]27
28# The right-hand side is updated by jhalfs
29TRACKING_DIR = tracking-dir
[f4ed135]30TOPDIR=$(shell pwd)
[e576789]31BLFS_XML = $(TOPDIR)/blfs-xml
32XSLDIR = $(TOPDIR)/xsl
33
34RENDERTMP = $(BLFS_XML)/tmp
35BLFS_FULL = $(RENDERTMP)/blfs-full.xml
36PACK_LIST = $(TOPDIR)/packages.xml
37MENU = $(TOPDIR)/menu
38CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
39CONFIG_OUT = $(TOPDIR)/configuration
40BOOK_XML = $(TOPDIR)/book.xml
41TRACKFILE = $(TRACKING_DIR)/instpkg.xml
42
43define INITIAL_TRACK
44<?xml version="1.0" encoding="ISO-8859-1"?>\n\
45\n\
46<!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\n\
47<sublist>\n\
48 <name>Installed</name>\n\
49</sublist>
50endef
51
52SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
53
54ALLXML := $(filter-out $(RENDERTMP)/%, \
55 $(wildcard $(BLFS_XML)/*.xml $(BLFS_XML)/*/*.xml $(BLFS_XML)/*/*/*.xml $(BLFS_XML)/*/*/*/*.xml $(BLFS_XML)/*/*/*/*/*.xml))
56ALLXSL := $(filter-out $(RENDERTMP)/%, \
57 $(wildcard $(BLFS_XML)/*.xsl $(BLFS_XML)/*/*.xsl $(BLFS_XML)/*/*/*.xsl $(BLFS_XML)/*/*/*/*.xsl $(BLFS_XML)/*/*/*/*/*.xsl))
58
59$(BOOK_XML): $(CONFIG_OUT)
60 $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL)
[f4ed135]61
[e576789]62$(CONFIG_OUT): $(CONFIG_CONFIG_IN) $(MENU)/mconf
63 $(Q)$(MENU)/mconf $(CONFIG_CONFIG_IN)
[f4ed135]64
[e576789]65$(MENU)/mconf:
66 $(Q)$(MAKE) -C $(MENU) ncurses conf mconf
[f4ed135]67
[e576789]68$(CONFIG_CONFIG_IN): $(PACK_LIST) $(XSLDIR)/gen_config.xsl
69 $(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST)
[f4ed135]70
[e576789]71$(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE)
72 $(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \
73 -o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL)
74 $(Q)xmllint --postvalid --format -o $@ $@.tmp
75 $(Q)rm $@.tmp
[f4ed135]76
[e576789]77# Beware of the echo '$(INITIAL_TRACK)' command below:
78# if shell is bash or sh linked to bash, needs echo -e
79# if shell is dash or sh linked to dash: echo is enough
80# Don't ask me why
81# So use /bin/echo (needs -e)
82$(TRACKFILE): $(TRACKING_DIR)
83 $(Q)if ! [ -f $@ ]; then \
84 echo Initializing $(TRACKFILE) && \
85 /bin/echo -e '$(INITIAL_TRACK)' > $@ && \
86 $(MAKE) $(PACK_LIST); \
87 fi
88 $(Q)for track in $(TRACKING_DIR)/*-*; do \
89 if [ -f $$track ]; then \
90 pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \
91 version=$$(echo $$track | sed 's@.*-\([0-9c].*\)@\1@') && \
92 xsltproc --stringparam packages $(PACK_LIST) \
93 --stringparam package $$pack \
94 --stringparam version $$version \
95 -o track.tmp $(XSLDIR)/bump.xsl $@ && \
96 sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \
97 xmllint --format --postvalid track.tmp > $@; \
98 fi; \
99 done; \
100 rm -f track.tmp
101
102$(TRACKING_DIR):
103 @echo Creating $(TRACKING_DIR)
104 $(Q)mkdir -p $@
105
106$(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
107 $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
108
109$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
110 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[7bd0866]111 @echo "Adjusting for revision $(REV)..."
112 $(Q)xsltproc --nonet --xinclude \
113 --stringparam profile.revision $(REV) \
114 --output $(RENDERTMP)/blfs-prof.xml \
115 $(BLFS_XML)/stylesheets/lfs-xsl/profile.xsl \
116 $(BLFS_XML)/index.xml
117 @echo "Validating the book..."
118 $(Q)xmllint --nonet --noent --postvalid \
119 -o $@ $(RENDERTMP)/blfs-prof.xml
[e576789]120
121all: update $(BOOK_XML)
122
123update: $(BLFS_XML)
124 @echo Updating the book sources
125 $(Q)cd $(BLFS_XML) && svn up
126
127$(BLFS_XML):
128 @echo Getting the book sources...
129 $(Q)svn co $(SVN) $@
[f4ed135]130
131# Clean up
132
133clean:
[e576789]134 rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml
135 rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
136 - $(MAKE) -C $(MENU) clean
[f4ed135]137
[e576789]138.PHONY: clean all update $(CONFIG_OUT)
Note: See TracBrowser for help on using the repository browser.