source: BLFS/Makefile@ 30732c6a

ablfs-more legacy trunk
Last change on this file since 30732c6a was a4af6811, checked in by Pierre Labastie <pierre@…>, 5 years ago

Various fixes for Kconfiglib:

  • remove the old setting of LANG in BLFS/Makefile
  • explicitly use python3, because now menuconfig.py has #!/usr/bin/python, we may have only python3 available
  • add quotes in Config.in for BLFS
  • Property mode set to 100644
File size: 6.4 KB
RevLine 
[f4ed135]1# From the Build Scripts Written By: Jim Gifford <lfs@jg555.com>
[e415656]2# Modified By: Joe Ciccone <jciccone@linuxfromscratch.org>
[f4ed135]3# Additional changes: George Boudreau <georgeb@linuxfromscratch.org>
[e576789]4# Pierre Labastie <pierre.labastie at neuf.fr>
[f4ed135]5
[5795ad7]6# $Id$
[f4ed135]7
[e576789]8ifdef V
9 Q =
10else
11 Q = @
12endif
13
[84440e6]14# Makefile should reside in a directory where there are two subdirectories
15# initially:
16TOPDIR = $(shell pwd)
17# the stylesheets
18XSLDIR = $(TOPDIR)/xsl
19# the menu program sources
20MENU = $(TOPDIR)/menu
21
22# Those directories and files will be created and populated by make:
23# directory of the book sources:
[506120ee]24LFS_XML = $(TOPDIR)/lfs-xml
[84440e6]25BLFS_XML = $(TOPDIR)/blfs-xml
26# contains the REV used in the preceding call:
27REVFILE = $(TOPDIR)/revision
28# the list of packages:
29PACK_LIST = $(TOPDIR)/packages.xml
30# the generated menu input:
[e576789]31CONFIG_CONFIG_IN = $(TOPDIR)/Config.in
[84440e6]32# menu output:
33CONFIG_OUT = $(TOPDIR)/configuration
34# the linear book:
35BOOK_XML = $(TOPDIR)/book.xml
36
[506120ee]37LFSTMP = $(LFS_XML)/tmp
[84440e6]38RENDERTMP = $(BLFS_XML)/tmp
[506120ee]39LFS_FULL = $(LFSTMP)/lfs-full.xml
[84440e6]40BLFS_FULL = $(RENDERTMP)/blfs-full.xml
41
42# The right-hand side is updated by jhalfs:
43# Where the tracking file resides:
44TRACKING_DIR = tracking-dir
45
46# Will be created by make, if not existent
47TRACKFILE = $(TRACKING_DIR)/instpkg.xml
[e576789]48
[84440e6]49# Initial content of the tracking file
[e576789]50define INITIAL_TRACK
51<?xml version="1.0" encoding="ISO-8859-1"?>\n\
52\n\
53<!DOCTYPE sublist SYSTEM "$(TOPDIR)/packdesc.dtd">\n\
54<sublist>\n\
55 <name>Installed</name>\n\
56</sublist>
57endef
58
[506120ee]59LFS-SVN = svn://svn.linuxfromscratch.org/LFS/trunk/BOOK
[e576789]60SVN = svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK
61
62ALLXML := $(filter-out $(RENDERTMP)/%, \
[84440e6]63 $(shell if [ -d $(BLFS_XML) ]; then \
64 find $(BLFS_XML) -name \*.xml; \
65 fi))
[506120ee]66ALLXMLLFS:= $(filter-out $(LFSTMP)/%, \
67 $(shell if [ -d $(LFS_XML) ]; then \
68 find $(LFS_XML) -name \*.xml; \
69 fi))
[e576789]70ALLXSL := $(filter-out $(RENDERTMP)/%, \
[84440e6]71 $(shell if [ -d $(BLFS_XML) ]; then \
72 find $(BLFS_XML) -name \*.xsl; \
73 fi))
[506120ee]74ALLXSLLFS := $(filter-out $(LFSTMP)/%, \
75 $(shell if [ -d $(LFS_XML) ]; then \
76 find $(LFS_XML) -name \*.xsl; \
77 fi))
[84440e6]78
79# Try to set the REV variable according to previous runs, except when
80# set on the command line:
81REV1 := $(shell if [ -f $(REVFILE) ] ; then cat $(REVFILE); fi)
82ifneq ($(origin REV),command line)
83 ifdef REV1
84 REV = $(REV1)
85 else
86 REV = not defined
87 endif
88endif
89
90ifneq ($(REV),sysv)
91 ifneq ($(REV),systemd)
92 $(error The REV variable is $(REV), but can only be 'sysv' or 'systemd')
93 endif
94endif
[e576789]95
96$(BOOK_XML): $(CONFIG_OUT)
[607ef21]97 $(Q)$(TOPDIR)/gen_pkg_book.sh $(TOPDIR) $(BLFS_FULL) $(LFS_FULL)
[f4ed135]98
[f596dde]99$(CONFIG_OUT): $(CONFIG_CONFIG_IN)
100 $(Q)CONFIG_="" KCONFIG_CONFIG=configuration \
[a4af6811]101 python3 $(MENU)/menuconfig.py $(CONFIG_CONFIG_IN)
[f4ed135]102
[e576789]103$(CONFIG_CONFIG_IN): $(PACK_LIST) $(XSLDIR)/gen_config.xsl
104 $(Q)xsltproc --nonet -o $@ $(XSLDIR)/gen_config.xsl $(PACK_LIST)
[f4ed135]105
[506120ee]106$(PACK_LIST): $(XSLDIR)/gen_pkg_list.xsl $(XSLDIR)/specialCases.xsl $(TRACKFILE) $(LFS_FULL)
[e576789]107 $(Q)xsltproc --stringparam installed-packages $(TRACKFILE) \
[506120ee]108 --stringparam lfs-full $(LFS_FULL) \
[e576789]109 -o $@.tmp $(XSLDIR)/gen_pkg_list.xsl $(BLFS_FULL)
110 $(Q)xmllint --postvalid --format -o $@ $@.tmp
111 $(Q)rm $@.tmp
[f4ed135]112
[e576789]113# Beware of the echo '$(INITIAL_TRACK)' command below:
114# if shell is bash or sh linked to bash, needs echo -e
115# if shell is dash or sh linked to dash: echo is enough
116# Don't ask me why
117# So use /bin/echo (needs -e)
118$(TRACKFILE): $(TRACKING_DIR)
119 $(Q)if ! [ -f $@ ]; then \
120 echo Initializing $(TRACKFILE) && \
[e415656]121 /bin/echo -e '$(INITIAL_TRACK)' > $@; \
[e576789]122 fi
123 $(Q)for track in $(TRACKING_DIR)/*-*; do \
[e415656]124 if [ -f $$track ]; then \
[e576789]125 pack=$$(echo $$track | sed 's@.*/\(.*\)-[0-9c].*@\1@') && \
126 version=$$(echo $$track | sed 's@.*-\([0-9c].*\)@\1@') && \
127 xsltproc --stringparam packages $(PACK_LIST) \
128 --stringparam package $$pack \
129 --stringparam version $$version \
130 -o track.tmp $(XSLDIR)/bump.xsl $@ && \
131 sed -i 's@PACKDESC@$(TOPDIR)/packdesc.dtd@' track.tmp && \
132 xmllint --format --postvalid track.tmp > $@; \
[e415656]133 fi; \
134 rm -f $$track; \
[e576789]135 done; \
136 rm -f track.tmp
137
138$(TRACKING_DIR):
139 @echo Creating $(TRACKING_DIR)
140 $(Q)mkdir -p $@
141
142$(XSLDIR)/specialCases.xsl: $(TOPDIR)/gen-special.sh $(BLFS_FULL)
143 $(Q)$(TOPDIR)/gen-special.sh $(BLFS_FULL) $@
144
[84440e6]145ifneq ($(REV),$(REV1))
146$(BLFS_FULL): FORCE
[506120ee]147$(LFS_FULL): FORCE
[84440e6]148endif
[506120ee]149$(LFS_FULL): $(LFS_XML) $(LFS_XML)/general.ent $(ALLXMLLFS) $(ALLXSLLFS)
150 @echo "Processing LFS bootscripts..."
151 $(Q)cd $(LFS_XML) && bash process-scripts.sh
152 $(Q)[ -d $(LFSTMP) ] || mkdir -p $(LFSTMP)
153 @echo "Adjusting LFS for revision $(REV)..."
154 $(Q)xsltproc --nonet --xinclude \
155 --stringparam profile.revision $(REV) \
156 --output $(LFSTMP)/lfs-prof.xml \
157 $(LFS_XML)/stylesheets/lfs-xsl/profile.xsl \
158 $(LFS_XML)/index.xml
159 @echo "Validating the LFS book..."
160 $(Q)xmllint --nonet --noent --postvalid \
161 -o $@ $(LFSTMP)/lfs-prof.xml
162 $(Q)rm -f $(LFS_XML)/appendices/*.script
163 $(Q)cd $(LFS_XML) && ./aux-file-data.sh $@
164 $(Q)echo $(REV) > $(REVFILE)
165
[e576789]166$(BLFS_FULL): $(BLFS_XML) $(BLFS_XML)/general.ent $(ALLXML) $(ALLXSL)
167 $(Q)[ -d $(RENDERTMP) ] || mkdir -p $(RENDERTMP)
[506120ee]168 @echo "Adjusting BLFS for revision $(REV)..."
[4f3c433]169 $(Q)xsltproc --nonet --xinclude \
170 --stringparam profile.revision $(REV) \
171 --output $(RENDERTMP)/blfs-prof.xml \
172 $(BLFS_XML)/stylesheets/lfs-xsl/profile.xsl \
173 $(BLFS_XML)/index.xml
[506120ee]174 @echo "Validating the BLFS book..."
[4f3c433]175 $(Q)xmllint --nonet --noent --postvalid \
176 -o $@ $(RENDERTMP)/blfs-prof.xml
[84440e6]177 $(Q)echo $(REV) > $(REVFILE)
[e576789]178
179all: update $(BOOK_XML)
180
[506120ee]181update: $(BLFS_XML) $(LFS_XML)
[e576789]182 @echo Updating the book sources
[506120ee]183 $(Q)cd $(LFS_XML) && svn up
[e576789]184 $(Q)cd $(BLFS_XML) && svn up
185
[506120ee]186$(LFS_XML):
187 @echo Getting the LFS book sources...
188 $(Q)svn co $(LFS-SVN) $@
189
[e576789]190$(BLFS_XML):
[506120ee]191 @echo Getting the BLFS book sources...
[e576789]192 $(Q)svn co $(SVN) $@
[f4ed135]193
194# Clean up
195
196clean:
[e576789]197 rm -f $(CONFIG_OUT) $(CONFIG_OUT).old $(TOPDIR)/packages.xml $(XSLDIR)/specialCases.xsl $(CONFIG_CONFIG_IN) book.xml
198 rm -rf $(TOPDIR)/dependencies $(TOPDIR)/book-html $(TOPDIR)/scripts
[f4ed135]199
[84440e6]200FORCE:
201.PHONY: clean all update $(CONFIG_OUT) FORCE
Note: See TracBrowser for help on using the repository browser.