mkexport: Deal with ARCHSCRIPT containing multiple files
This fixes "make export" for esp32-core.
This commit is contained in:
parent
58318bbc28
commit
aa205b3732
@ -198,27 +198,31 @@ cp -f "${TOPDIR}/binfmt/libelf/gnu-elf.ld" "${EXPORTDIR}/scripts/."
|
|||||||
# Is there a linker script in this configuration?
|
# Is there a linker script in this configuration?
|
||||||
|
|
||||||
if [ "X${USRONLY}" != "Xy" ]; then
|
if [ "X${USRONLY}" != "Xy" ]; then
|
||||||
if [ ! -z "${LDPATH}" ]; then
|
|
||||||
|
# LDPATH can contain multiple files.
|
||||||
|
# The "Copy additional ld scripts" step might copy a file multiple times.
|
||||||
|
|
||||||
|
for LDSCRIPT in ${LDPATH}; do
|
||||||
|
|
||||||
# Apparently so. Verify that the script exists
|
# Apparently so. Verify that the script exists
|
||||||
|
|
||||||
if [ ! -f "${LDPATH}" ]; then
|
if [ ! -f "${LDSCRIPT}" ]; then
|
||||||
echo "MK: File ${LDPATH} does not exist"
|
echo "MK: File ${LDSCRIPT} does not exist"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy the linker script
|
# Copy the linker script
|
||||||
|
|
||||||
cp -p "${LDPATH}" "${EXPORTDIR}/scripts/." || \
|
cp -p "${LDSCRIPT}" "${EXPORTDIR}/scripts/." || \
|
||||||
{ echo "MK: cp ${LDPATH} failed"; exit 1; }
|
{ echo "MK: cp ${LDSCRIPT} failed"; exit 1; }
|
||||||
|
|
||||||
# Copy additional ld scripts
|
# Copy additional ld scripts
|
||||||
|
|
||||||
LDDIR="$(dirname "${LDPATH}")"
|
LDDIR="$(dirname "${LDSCRIPT}")"
|
||||||
for f in "${LDDIR}"/*.ld ; do
|
for f in "${LDDIR}"/*.ld ; do
|
||||||
[ -f "${f}" ] && cp -f "${f}" "${EXPORTDIR}/scripts/."
|
[ -f "${f}" ] && cp -f "${f}" "${EXPORTDIR}/scripts/."
|
||||||
done
|
done
|
||||||
fi
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Save the compilation options
|
# Save the compilation options
|
||||||
|
Loading…
Reference in New Issue
Block a user