Moved Makefile header creation to a common function.
This commit is contained in:
parent
fe30c61a75
commit
195ed9f9a9
6 changed files with 44 additions and 158 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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`"
|
||||
|
|
|
@ -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`"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
#=======================
|
||||
|
||||
|
|
Reference in a new issue