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
|
# Add a header, some variables and include the function file
|
||||||
# to the top of the real Makefile.
|
# to the top of the real Makefile.
|
||||||
(
|
wrt_Makefile_header
|
||||||
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
|
|
||||||
|
|
||||||
# Add chroot commands
|
# Add chroot commands
|
||||||
if [ "$METHOD" = "chroot" ] ; then
|
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
|
# Add a header, some variables and include the function file
|
||||||
# to the top of the real Makefile.
|
# to the top of the real Makefile.
|
||||||
(
|
wrt_Makefile_header
|
||||||
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
|
|
||||||
|
|
||||||
# Drop in the main target 'all:' and the chapter targets with each sub-target
|
# Drop in the main target 'all:' and the chapter targets with each sub-target
|
||||||
# as a dependency.
|
# 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
|
# Add a header, some variables and include the function file
|
||||||
# to the top of the real Makefile.
|
# to the top of the real Makefile.
|
||||||
(
|
wrt_Makefile_header
|
||||||
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
|
|
||||||
|
|
||||||
# Drop in the main target 'all:' and the chapter targets with each sub-target
|
# Drop in the main target 'all:' and the chapter targets with each sub-target
|
||||||
# as a dependency.
|
# 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
|
# Add a header, some variables and include the function file
|
||||||
# to the top of the real Makefile.
|
# to the top of the real Makefile.
|
||||||
(
|
wrt_Makefile_header
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
# Add chroot commands
|
# Add chroot commands
|
||||||
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
|
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
|
||||||
|
|
|
@ -382,40 +382,7 @@ build_Makefile() { #
|
||||||
|
|
||||||
# Add a header, some variables and include the function file
|
# Add a header, some variables and include the function file
|
||||||
# to the top of the real Makefile.
|
# to the top of the real Makefile.
|
||||||
(
|
wrt_Makefile_header
|
||||||
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
|
|
||||||
|
|
||||||
# Add chroot commands
|
# Add chroot commands
|
||||||
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
|
CHROOT_LOC="`whereis -b chroot | cut -d " " -f2`"
|
||||||
|
|
|
@ -4,10 +4,47 @@
|
||||||
|
|
||||||
#=== MAKEFILE HEADER ===
|
#=== 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
|
# 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