source: BLFS/Makefile@ cf2f109

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

Get rid of the GPLv2 license:

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