diff --git a/CLFS/master.sh b/CLFS/master.sh index f791e84..73176c8 100644 --- a/CLFS/master.sh +++ b/CLFS/master.sh @@ -1121,40 +1121,7 @@ set -e # Add a header, some variables and include the function file # to the top of the real Makefile. -( - cat << EOF -$HEADER - -SRC = /sources -MOUNT_PT = $BUILDDIR -PKG_LST = $PKG_LST -LUSER = $LUSER -LGROUP = $LGROUP -SCRIPT_ROOT = $SCRIPT_ROOT -ADD_BLFS_TOOLS = $BLFS_TOOL - -BASEDIR = \$(MOUNT_PT) -SRCSDIR = \$(BASEDIR)/sources -CMDSDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands -LOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs -TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs - -crSRCSDIR = /sources -crCMDSDIR = /\$(SCRIPT_ROOT)/$PROGNAME-commands -crLOGDIR = /\$(SCRIPT_ROOT)/logs -crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs - -SU_LUSER = su - \$(LUSER) -c -LUSER_HOME = /home/\$(LUSER) -PRT_DU = echo -e "\nKB: \`du -skx --exclude=jhalfs --exclude=lost+found \$(MOUNT_PT)\`\n" -PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n" - -export PATH := \${PATH}:/usr/sbin - -include makefile-functions - -EOF -) > $MKFILE + wrt_Makefile_header # Add chroot commands if [ "$METHOD" = "chroot" ] ; then diff --git a/CLFS2/master.sh b/CLFS2/master.sh index 6fe43c1..50962fa 100644 --- a/CLFS2/master.sh +++ b/CLFS2/master.sh @@ -432,33 +432,7 @@ build_Makefile() { # Construct a Makefile from the book scripts # Add a header, some variables and include the function file # to the top of the real Makefile. -( - cat << EOF -$HEADER - -SRC = /sources -MOUNT_PT = $BUILDDIR -PKG_LST = $PKG_LST -LUSER = $LUSER -LGROUP = $LGROUP -SCRIPT_ROOT = $SCRIPT_ROOT - -BASEDIR = \$(MOUNT_PT) -SRCSDIR = \$(BASEDIR)/sources -CMDSDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands -LOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs -TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs - -SU_LUSER = su - \$(LUSER) -c -PRT_DU = echo -e "\nKB: \`du -skx --exclude=jhalfs --exclude=lost+found \$(MOUNT_PT)\`\n" -LUSER_HOME = /home/\$(LUSER) - -export PATH := \${PATH}:/usr/sbin - -include makefile-functions - -EOF -) > $MKFILE + wrt_Makefile_header # Drop in the main target 'all:' and the chapter targets with each sub-target # as a dependency. diff --git a/CLFS3/master.sh b/CLFS3/master.sh index 77026bc..148f775 100644 --- a/CLFS3/master.sh +++ b/CLFS3/master.sh @@ -426,33 +426,7 @@ build_Makefile() { # Construct a Makefile from the book scripts # Add a header, some variables and include the function file # to the top of the real Makefile. -( - cat << EOF -$HEADER - -SRC = /sources -MOUNT_PT = $BUILDDIR -PKG_LST = $PKG_LST -LUSER = $LUSER -LGROUP = $LGROUP -SCRIPT_ROOT = $SCRIPT_ROOT - -BASEDIR = \$(MOUNT_PT) -SRCSDIR = \$(BASEDIR)/sources -CMDSDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands -LOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs -TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs - -SU_LUSER = su - \$(LUSER) -c -PRT_DU = echo -e "\nKB: \`du -skx --exclude=jhalfs --exclude=lost+found \$(MOUNT_PT)\`\n" -LUSER_HOME = /home/\$(LUSER) - -export PATH := \${PATH}:/usr/sbin - -include makefile-functions - -EOF -) > $MKFILE + wrt_Makefile_header # Drop in the main target 'all:' and the chapter targets with each sub-target # as a dependency. diff --git a/HLFS/master.sh b/HLFS/master.sh index de5dbd9..7353115 100644 --- a/HLFS/master.sh +++ b/HLFS/master.sh @@ -494,40 +494,7 @@ build_Makefile() { # Construct a Makefile from the book scripts # Add a header, some variables and include the function file # to the top of the real Makefile. -( - cat << EOF -$HEADER - -SRC = /sources -MOUNT_PT = $BUILDDIR -PKG_LST = $PKG_LST -LUSER = $LUSER -LGROUP = $LGROUP -SCRIPT_ROOT = $SCRIPT_ROOT - -BASEDIR = \$(MOUNT_PT) -SRCSDIR = \$(BASEDIR)/sources -CMDSDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands -LOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs -TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs - -crSRCSDIR = /sources -crCMDSDIR = /\$(SCRIPT_ROOT)/$PROGNAME-commands -crLOGDIR = /\$(SCRIPT_ROOT)/logs -crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs - -SU_LUSER = su - \$(LUSER) -c -LUSER_HOME = /home/\$(LUSER) -PRT_DU = echo -e "\nKB: \`du -skx --exclude=jhalfs --exclude=lost+found \$(MOUNT_PT)\`\n" -PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n" - -export PATH := \${PATH}:/usr/sbin - -include makefile-functions - -EOF -) > $MKFILE - + wrt_Makefile_header # Add chroot commands CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`" diff --git a/LFS/master.sh b/LFS/master.sh index 0fe98dc..22a56e4 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -382,40 +382,7 @@ build_Makefile() { # # Add a header, some variables and include the function file # to the top of the real Makefile. -( - cat << EOF -$HEADER - - -SRC = /sources -MOUNT_PT = $BUILDDIR -PKG_LST = $PKG_LST -LUSER = $LUSER -LGROUP = $LGROUP -SCRIPT_ROOT = $SCRIPT_ROOT - -BASEDIR = \$(MOUNT_PT) -SRCSDIR = \$(BASEDIR)/sources -CMDSDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands -LOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs -TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs - -crSRCSDIR = /sources -crCMDSDIR = /\$(SCRIPT_ROOT)/$PROGNAME-commands -crLOGDIR = /\$(SCRIPT_ROOT)/logs -crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs - -SU_LUSER = su - \$(LUSER) -c -LUSER_HOME = /home/\$(LUSER) -PRT_DU = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found \$(MOUNT_PT) \`\n" -PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n" - -export PATH := \${PATH}:/usr/sbin - -include makefile-functions - -EOF -) > $MKFILE + wrt_Makefile_header # Add chroot commands CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`" diff --git a/common/libs/func_wrt_Makefile b/common/libs/func_wrt_Makefile index ab68443..f102c80 100644 --- a/common/libs/func_wrt_Makefile +++ b/common/libs/func_wrt_Makefile @@ -4,10 +4,47 @@ #=== MAKEFILE HEADER === -HEADER="# This file is automatically generated by jhalfs +#----------------------------------# +wrt_Makefile_header() { # +#----------------------------------# +( + cat << EOF +# This file is automatically generated by jhalfs # DO NOT EDIT THIS FILE MANUALLY # -# Generated on `date \"+%F %X %Z\"`" +# Generated on `date "+%F %X %Z"` + + +SRC = /sources +MOUNT_PT = $BUILDDIR +PKG_LST = $PKG_LST +LUSER = $LUSER +LGROUP = $LGROUP +SCRIPT_ROOT = $SCRIPT_ROOT +ADD_BLFS_TOOLS = $BLFS_TOOL + +BASEDIR = \$(MOUNT_PT) +SRCSDIR = \$(BASEDIR)/sources +CMDSDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands +LOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs +TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs + +crCMDSDIR = /\$(SCRIPT_ROOT)/$PROGNAME-commands +crLOGDIR = /\$(SCRIPT_ROOT)/logs +crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs + +SU_LUSER = su - \$(LUSER) -c +LUSER_HOME = /home/\$(LUSER) +PRT_DU = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found \$(MOUNT_PT) \`\n" +PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n" + +export PATH := \${PATH}:/usr/sbin + +include makefile-functions + +EOF +) > $MKFILE +} #=======================