Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #67442 > unrolled thread
| Started by | Frederick Gotham <cauldwell.thomas@gmail.com> |
|---|---|
| First post | 2019-08-08 07:10 -0700 |
| Last post | 2019-08-09 06:46 -0700 |
| Articles | 10 — 7 participants |
Back to article view | Back to comp.lang.c++
Adding compilation arguments to 4000 make files. . . Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-08-08 07:10 -0700
Re: Adding compilation arguments to 4000 make files. . . Ralf Fassel <ralfixx@gmx.de> - 2019-08-08 17:54 +0200
Re: Adding compilation arguments to 4000 make files. . . Szyk Cech <szykcech@spoko.pl> - 2019-08-08 18:35 +0200
Re: Adding compilation arguments to 4000 make files. . . Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-08-08 19:02 +0000
Re: Adding compilation arguments to 4000 make files. . . scott@slp53.sl.home (Scott Lurndal) - 2019-08-08 19:56 +0000
Re: Adding compilation arguments to 4000 make files. . . Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-08-09 14:01 +0000
Re: Adding compilation arguments to 4000 make files. . . scott@slp53.sl.home (Scott Lurndal) - 2019-08-09 14:36 +0000
Re: Adding compilation arguments to 4000 make files. . . Ian Collins <ian-news@hotmail.com> - 2019-08-10 09:43 +1200
Re: Adding compilation arguments to 4000 make files. . . David Brown <david.brown@hesbynett.no> - 2019-08-10 17:06 +0200
Re: Adding compilation arguments to 4000 make files. . . Frederick Gotham <cauldwell.thomas@gmail.com> - 2019-08-09 06:46 -0700
| From | Frederick Gotham <cauldwell.thomas@gmail.com> |
|---|---|
| Date | 2019-08-08 07:10 -0700 |
| Subject | Adding compilation arguments to 4000 make files. . . |
| Message-ID | <ea8b6885-d11b-47b5-af6f-10ca3b171ba6@googlegroups.com> |
I'm working on a firmware project at the moment, it's running on embedded Linux for a 64-Bit ARM processor (aarch64). There's the main Makefile, which uses "make -C" to invoke further Makefiles in nested subdirectories. Altogether there's four thousand Makefiles. I want to able to print out the function call stack, and so I've got code that calls "backtrace" and "backtrace_symbols". I want to recompile the entire firmware, passing "-funwind-tables" to the compiler, and passing "-rdynamic" to the linker. If all of my four thousand Makefiles were written properly, all I would have to do is: export CPPFLAGS=-funwind-tables export LDEXTRAFLAGS=-rdynamic Unfortunately, not all four thousand Makefiles are written properly. Some of them have a line like "CPPFLAGS=-Wall", i.e. they use = instead of +=, and so this gets rid of my own special arguments. I'm thinking maybe I should replace the compiler binary file, and also the linker binary file, with a one-liner script like this: g++ -funwind-tables -rdynamic $* Any suggestions on how best to do this?
[toc] | [next] | [standalone]
| From | Ralf Fassel <ralfixx@gmx.de> |
|---|---|
| Date | 2019-08-08 17:54 +0200 |
| Message-ID | <yga36ibveji.fsf@akutech.de> |
| In reply to | #67442 |
* Frederick Gotham <cauldwell.thomas@gmail.com> | I want to recompile the entire firmware, passing "-funwind-tables" to | the compiler, and passing "-rdynamic" to the linker. > | If all of my four thousand Makefiles were written properly, all I | would have to do is: > | export CPPFLAGS=-funwind-tables | export LDEXTRAFLAGS=-rdynamic > | Unfortunately, not all four thousand Makefiles are written | properly. Some of them have a line like "CPPFLAGS=-Wall", i.e. they | use = instead of +=, and so this gets rid of my own special arguments. > | I'm thinking maybe I should replace the compiler binary file, and also | the linker binary file, with a one-liner script like this: > | g++ -funwind-tables -rdynamic $* > | Any suggestions on how best to do this? cd /top/of/source/tree find . -name Makefile | xargs sed -i.bak -e 's/CPPFLAGS *=/CPPFLAGS +=/' Probably anchor the matches against beginning of line or somesuch. Untested, of course. HTH R'
[toc] | [prev] | [next] | [standalone]
| From | Szyk Cech <szykcech@spoko.pl> |
|---|---|
| Date | 2019-08-08 18:35 +0200 |
| Message-ID | <ebY2F.306203$_%7.232790@fx21.am4> |
| In reply to | #67442 |
On 08.08.2019 16:10, Frederick Gotham wrote:
>
> I'm working on a firmware project at the moment, it's running on embedded Linux for a 64-Bit ARM processor (aarch64).
>
> There's the main Makefile, which uses "make -C" to invoke further Makefiles in nested subdirectories. Altogether there's four thousand Makefiles.
If you don't produce one exe from those makefiles then you can make your
life simply and use one CMake file. Then you can use CMakeLists.txt:
[!!! NOT COMPLETE EXAMPLE NOR TESTED !!!]
cmake_minimum_required(VERSION 3.9.0)
project(MyProject)
set(CMAKE_CXX_STANDARD 14)
option(WARNINGS_NOT_ALLOWED "Warnings not allowed when compile." OFF)
option(BUILD_TESTS "Build tests." OFF)
list(APPEND HEADER_SUBDIRS Include Src)
list(APPEND SOURCE_SUBDIRS Src)
# List headers
foreach(DIR IN LISTS HEADER_SUBDIRS)
list(APPEND HEADER_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.h)
list(APPEND HEADER_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.hpp)
list(APPEND HEADER_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.hxx)
list(APPEND HEADER_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.h++)
endforeach()
file(GLOB_RECURSE HEADER_FILES FOLLOW_SYMLINKS ${HEADER_EXPANDED_DIRS})
# List sources
foreach(DIR IN LISTS SOURCE_SUBDIRS)
list(APPEND SOURCE_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.c)
list(APPEND SOURCE_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.cpp)
list(APPEND SOURCE_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.cxx)
list(APPEND SOURCE_EXPANDED_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/${DIR}/*.c++)
endforeach()
file(GLOB_RECURSE SOURCE_FILES FOLLOW_SYMLINKS ${SOURCE_EXPANDED_DIRS})
add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})
# Add include dir
foreach(INCLUDE_DIR IN LISTS INCLUDE_DIRS)
message("INCLUDE_DIR: ${INCLUDE_DIR}")
target_include_directories(${PROJECT_NAME} PRIVATE ${INCLUDE_DIR})
endforeach()
# g++ compiler flags
if (CMAKE_COMPILER_IS_GNUCXX)
if(WARNINGS_NOT_ALLOWED)
message("Warnings not allowed.")
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Werror
-Wformat=2
-Wuninitialized -Winit-self -Wswitch-enum -Wundef
-Wpointer-arith -Wdisabled-optimization -Wcast-align
-Wcast-qual)
else()
message("Warnings allowed.")
target_compile_options(${PROJECT_NAME} PRIVATE -Wformat=2 -Wall
-Wuninitialized -Winit-self -Wswitch-enum -Wundef
-Wpointer-arith -Wdisabled-optimization -Wcast-align
-Wcast-qual)
endif()
endif()
[toc] | [prev] | [next] | [standalone]
| From | Jorgen Grahn <grahn+nntp@snipabacken.se> |
|---|---|
| Date | 2019-08-08 19:02 +0000 |
| Message-ID | <slrnqkosec.cdo.grahn+nntp@frailea.sa.invalid> |
| In reply to | #67442 |
On Thu, 2019-08-08, Frederick Gotham wrote: > > I'm working on a firmware project at the moment, it's running on > embedded Linux for a 64-Bit ARM processor (aarch64). > > There's the main Makefile, which uses "make -C" to invoke further > Makefiles in nested subdirectories. Altogether there's four thousand > Makefiles. Someone somewhere should be fired ... (I'm assuming you're not just seeing the internals of cmake or a similar tool auto-generating a gazillion makefiles.) > I want to able to print out the function call stack, and so I've got > code that calls "backtrace" and "backtrace_symbols". > > I want to recompile the entire firmware, passing "-funwind-tables" > to the compiler, and passing "-rdynamic" to the linker. ... > I'm thinking maybe I should replace the compiler binary file, and > also the linker binary file, with a one-liner script like this: > > g++ -funwind-tables -rdynamic $* > > Any suggestions on how best to do this? Am I missing something? Sounds like you have a good solution right there! Put the script(s) in the $PATH somewhere and you should be fine. /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o .
[toc] | [prev] | [next] | [standalone]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2019-08-08 19:56 +0000 |
| Message-ID | <08%2F.113866$qC7.92294@fx11.iad> |
| In reply to | #67459 |
Jorgen Grahn <grahn+nntp@snipabacken.se> writes:
>On Thu, 2019-08-08, Frederick Gotham wrote:
>>
>> I'm working on a firmware project at the moment, it's running on
>> embedded Linux for a 64-Bit ARM processor (aarch64).
>>
>> There's the main Makefile, which uses "make -C" to invoke further
>> Makefiles in nested subdirectories. Altogether there's four thousand
>> Makefiles.
>
>Someone somewhere should be fired ...
Why? Doesn't seem completely out-of-line:
$ find bootloader firmware -name Makefile | wc -l
929
If you're also building linux:
$ find linux -name Makefile | wc -l
2064
>
>(I'm assuming you're not just seeing the internals of cmake or a
>similar tool auto-generating a gazillion makefiles.)
>
>> I want to able to print out the function call stack, and so I've got
>> code that calls "backtrace" and "backtrace_symbols".
>>
>> I want to recompile the entire firmware, passing "-funwind-tables"
>> to the compiler, and passing "-rdynamic" to the linker.
>...
>> I'm thinking maybe I should replace the compiler binary file, and
>> also the linker binary file, with a one-liner script like this:
>>
>> g++ -funwind-tables -rdynamic $*
>>
>> Any suggestions on how best to do this?
I'd look at trying to tell make to use a modified default rule
set, then you can have a rule like:
%.o $(OBJDIR)/%.o: %.c
@$(QUIET) || echo " COMPILE $<"
$(HUSHCOMPILE)$(CC) $(CFLAGS) -funwind-tables -rdynamic -MMD -MP -o $@ -c $<
%.o $(OBJDIR)/%.o: %.cpp
@$(QUIET) || echo " COMPILE $<"
$(HUSHCOMPILE)$(COMPILE.cpp) -funwind-tables -rdynamic -MMD -MP -o $@ $<
I don't see anything in the man page that allows that with gmake, however.
[toc] | [prev] | [next] | [standalone]
| From | Jorgen Grahn <grahn+nntp@snipabacken.se> |
|---|---|
| Date | 2019-08-09 14:01 +0000 |
| Message-ID | <slrnqkqv6n.cdo.grahn+nntp@frailea.sa.invalid> |
| In reply to | #67462 |
On Thu, 2019-08-08, Scott Lurndal wrote: > Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >>On Thu, 2019-08-08, Frederick Gotham wrote: >>> >>> I'm working on a firmware project at the moment, it's running on >>> embedded Linux for a 64-Bit ARM processor (aarch64). >>> >>> There's the main Makefile, which uses "make -C" to invoke further >>> Makefiles in nested subdirectories. Altogether there's four thousand >>> Makefiles. >> >>Someone somewhere should be fired ... > > Why? Doesn't seem completely out-of-line: > > $ find bootloader firmware -name Makefile | wc -l > 929 Because I believe in the Recursive Make Considered Harmful paper: http://aegis.sourceforge.net/auug97.pdf > If you're also building linux: > $ find linux -name Makefile | wc -l > 2064 IIRC, Linux falls into the next category: >>(I'm assuming you're not just seeing the internals of cmake or a >>similar tool auto-generating a gazillion makefiles.) /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o .
[toc] | [prev] | [next] | [standalone]
| From | scott@slp53.sl.home (Scott Lurndal) |
|---|---|
| Date | 2019-08-09 14:36 +0000 |
| Message-ID | <ayf3F.246976$i84.204265@fx34.iad> |
| In reply to | #67480 |
Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >On Thu, 2019-08-08, Scott Lurndal wrote: >> Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >>>On Thu, 2019-08-08, Frederick Gotham wrote: >>>> >>>> I'm working on a firmware project at the moment, it's running on >>>> embedded Linux for a 64-Bit ARM processor (aarch64). >>>> >>>> There's the main Makefile, which uses "make -C" to invoke further >>>> Makefiles in nested subdirectories. Altogether there's four thousand >>>> Makefiles. >>> >>>Someone somewhere should be fired ... >> >> Why? Doesn't seem completely out-of-line: >> >> $ find bootloader firmware -name Makefile | wc -l >> 929 > >Because I believe in the Recursive Make Considered Harmful paper: >http://aegis.sourceforge.net/auug97.pdf That paper has never been convincing to me, nor anyone that I've ever worked with, nor any unix or linux os or other large sourcebase that I've worked on professionally. > >> If you're also building linux: >> $ find linux -name Makefile | wc -l >> 2064 > >IIRC, Linux falls into the next category: > >>>(I'm assuming you're not just seeing the internals of cmake or a >>>similar tool auto-generating a gazillion makefiles.) You do not recall correctly. kernel makefiles are not generated. scott
[toc] | [prev] | [next] | [standalone]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Date | 2019-08-10 09:43 +1200 |
| Message-ID | <gr67nlFu65U1@mid.individual.net> |
| In reply to | #67483 |
On 10/08/2019 02:36, Scott Lurndal wrote: > Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >> On Thu, 2019-08-08, Scott Lurndal wrote: >>> Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >>>> On Thu, 2019-08-08, Frederick Gotham wrote: >>>>> >>>>> I'm working on a firmware project at the moment, it's running on >>>>> embedded Linux for a 64-Bit ARM processor (aarch64). >>>>> >>>>> There's the main Makefile, which uses "make -C" to invoke further >>>>> Makefiles in nested subdirectories. Altogether there's four thousand >>>>> Makefiles. >>>> >>>> Someone somewhere should be fired ... >>> >>> Why? Doesn't seem completely out-of-line: >>> >>> $ find bootloader firmware -name Makefile | wc -l >>> 929 >> >> Because I believe in the Recursive Make Considered Harmful paper: >> http://aegis.sourceforge.net/auug97.pdf > > That paper has never been convincing to me, nor anyone that I've > ever worked with, nor any unix or linux os or other large sourcebase > that I've worked on professionally. It convinced me long ago... Recursive Make makes distributed building much harder. My current project code base is modest (about 3,000 source files in multiple libraries) but we only have one "makefile". It isn't actually a makefile, we use premake to to generate a ninja build file. -- Ian.
[toc] | [prev] | [next] | [standalone]
| From | David Brown <david.brown@hesbynett.no> |
|---|---|
| Date | 2019-08-10 17:06 +0200 |
| Message-ID | <qimmid$f3t$1@dont-email.me> |
| In reply to | #67483 |
On 09/08/2019 16:36, Scott Lurndal wrote: > Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >> On Thu, 2019-08-08, Scott Lurndal wrote: >>> Jorgen Grahn <grahn+nntp@snipabacken.se> writes: >>>> On Thu, 2019-08-08, Frederick Gotham wrote: >>>>> >>>>> I'm working on a firmware project at the moment, it's running on >>>>> embedded Linux for a 64-Bit ARM processor (aarch64). >>>>> >>>>> There's the main Makefile, which uses "make -C" to invoke further >>>>> Makefiles in nested subdirectories. Altogether there's four thousand >>>>> Makefiles. >>>> >>>> Someone somewhere should be fired ... >>> >>> Why? Doesn't seem completely out-of-line: >>> >>> $ find bootloader firmware -name Makefile | wc -l >>> 929 >> >> Because I believe in the Recursive Make Considered Harmful paper: >> http://aegis.sourceforge.net/auug97.pdf > > That paper has never been convincing to me, nor anyone that I've > ever worked with, nor any unix or linux os or other large sourcebase > that I've worked on professionally. > I have had enough trouble dealing with projects that contain separate Makefiles for different parts, yet depend on odd ways across parts, to be convinced by the paper. Far too often I've to do "make clean" before a "make" because of badly coordinated sub-makes. I am sure it is /possible/ to have large systems with recursive makes that work well. Equally, I am sure that often such systems are not done well. >> >>> If you're also building linux: >>> $ find linux -name Makefile | wc -l >>> 2064 >> >> IIRC, Linux falls into the next category: >> >>>> (I'm assuming you're not just seeing the internals of cmake or a >>>> similar tool auto-generating a gazillion makefiles.) > > You do not recall correctly. kernel makefiles are not generated. > > scott >
[toc] | [prev] | [next] | [standalone]
| From | Frederick Gotham <cauldwell.thomas@gmail.com> |
|---|---|
| Date | 2019-08-09 06:46 -0700 |
| Message-ID | <30c01aad-d253-4ef0-9c5b-84ad7d62eb7c@googlegroups.com> |
| In reply to | #67442 |
Here's the *nix bash script I've got for the time being:
#!/bin/bash
EXTRA_COMPILER_FLAGS="-rdynamic -funwind-tables"
EXTRA_LINKER_FLAGS="-funwind-tables"
DIR1="/usr/bin/"
DIR1_FILE1="x86_64-linux-gnu-g++-7"
DIR1_FILE2="x86_64-linux-gnu-gcc-7"
DIR1_FILE3="x86_64-linux-gnu-ld.bfd"
DIR2="./toolchain/arm/bin/"
DIR2_FILE1="aarch64-linux-gnu-g++"
DIR2_FILE2="aarch64-linux-gnu-gcc"
DIR2_FILE3="aarch64-linux-gnu-ld"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
if [ "$1" == "undo" ]; then
echo
echo "Undoing everything. . . "
echo
if [ -f "${DIR1}REAL_${DIR1_FILE1}" ]; then
rm -f "${DIR1}${DIR1_FILE1}"
mv "${DIR1}REAL_${DIR1_FILE1}" "${DIR1}${DIR1_FILE1}"
fi
if [ -f "${DIR1}REAL_${DIR1_FILE2}" ]; then
rm -f "${DIR1}${DIR1_FILE2}"
mv "${DIR1}REAL_${DIR1_FILE2}" "${DIR1}${DIR1_FILE2}"
fi
if [ -f "${DIR1}REAL_${DIR1_FILE3}" ]; then
rm -f "${DIR1}${DIR1_FILE3}"
mv "${DIR1}REAL_${DIR1_FILE3}" "${DIR1}${DIR1_FILE3}"
fi
if [ -f "${DIR2}REAL_${DIR2_FILE1}" ]; then
rm -f "${DIR2}${DIR2_FILE1}"
mv "${DIR2}REAL_${DIR2_FILE1}" "${DIR2}${DIR2_FILE1}"
fi
if [ -f "${DIR2}REAL_${DIR2_FILE2}" ]; then
rm -f "${DIR2}${DIR2_FILE2}"
mv "${DIR2}REAL_${DIR2_FILE2}" "${DIR2}${DIR2_FILE2}"
fi
if [ -f "${DIR2}REAL_${DIR2_FILE3}" ]; then
rm -f "${DIR2}${DIR2_FILE3}"
mv "${DIR2}REAL_${DIR2_FILE3}" "${DIR2}${DIR2_FILE3}"
fi
exit 0
fi
if [ -f "${DIR1}REAL_${DIR1_FILE1}" ]; then
echo "This script has already been run. It cannot be run a second time. You must do \"./replacer_script.sh undo\" first."
exit 1
fi
if [ ! -d "./toolchain" ]; then
echo "This script must be run from within the firmware directory, e.g. ~/svndir/illustra_amb_02_00, or ~/svndir/i825md_AMBARELLA"
exit 1
fi
FIRMWARE_DIR=`pwd`
echo "------------------------------------------------------------"
echo "FIRST TO REPLACE: x86_64 compilers in the directory /usr/bin"
echo "------------------------------------------------------------"
echo
echo "1: Navigating into directory: ${DIR1}"
echo
echo " $ cd ${DIR1}"
echo
cd ${DIR1}
echo "2: Renaming '${DIR1_FILE1}' to 'REAL_${DIR1_FILE1}'"
echo
echo " $ mv ${DIR1_FILE1} REAL_${DIR1_FILE1}"
echo
mv ${DIR1_FILE1} REAL_${DIR1_FILE1}
echo " Renaming '${DIR1_FILE2}' to 'REAL_${DIR1_FILE2}'"
echo
echo " $ mv ${DIR1_FILE2} REAL_${DIR1_FILE2}"
echo
mv ${DIR1_FILE2} REAL_${DIR1_FILE2}
echo " Renaming '${DIR1_FILE3}' to 'REAL_${DIR1_FILE3}'"
echo
echo " $ mv ${DIR1_FILE3} REAL_${DIR1_FILE3}"
echo
mv ${DIR1_FILE3} REAL_${DIR1_FILE3}
echo "3: Creating empty script '${DIR1_FILE1}' and enabling the execution flag"
echo
echo " $ touch ${DIR1_FILE1}"
echo " $ chmod +x ${DIR1_FILE1}"
echo
touch ${DIR1_FILE1}
chmod +x ${DIR1_FILE1}
echo " Creating empty script '${DIR1_FILE2}' and enabling the execution flag"
echo
echo " $ touch ${DIR1_FILE2}"
echo " $ chmod +x ${DIR1_FILE2}"
echo
touch ${DIR1_FILE2}
chmod +x ${DIR1_FILE2}
echo " Creating empty script '${DIR1_FILE3}' and enabling the execution flag"
echo
echo " $ touch ${DIR1_FILE3}"
echo " $ chmod +x ${DIR1_FILE3}"
echo
touch ${DIR1_FILE3}
chmod +x ${DIR1_FILE3}
echo "4: Adding two lines to each script"
echo
echo " $ echo \"echo \\\"REAL_${DIR1_FILE1} ${EXTRA_COMPILER_FLAGS} \\\$*\\\"\" > ${DIR1_FILE1}"
echo " $ echo \"REAL_${DIR1_FILE1} ${EXTRA_COMPILER_FLAGS} \\\$*\" >> ${DIR1_FILE1}"
echo "echo \"REAL_${DIR1_FILE1} ${EXTRA_COMPILER_FLAGS} \$*\"" > ${DIR1_FILE1}
echo "REAL_${DIR1_FILE1} ${EXTRA_COMPILER_FLAGS} \$*" >> ${DIR1_FILE1}
echo
echo " $ echo \"echo \\\"REAL_${DIR1_FILE2} ${EXTRA_COMPILER_FLAGS} \\\$*\\\"\" > ${DIR1_FILE2}"
echo " $ echo \"REAL_${DIR1_FILE2} ${EXTRA_COMPILER_FLAGS} \\\$*\" >> ${DIR1_FILE2}"
echo "echo \"REAL_${DIR1_FILE2} ${EXTRA_COMPILER_FLAGS} \$*\"" > ${DIR1_FILE2}
echo "REAL_${DIR1_FILE2} ${EXTRA_COMPILER_FLAGS} \$*" >> ${DIR1_FILE2}
echo
echo " $ echo \"if [[ \$* == *\"-shared\"* ]]; then\" > ${DIR1_FILE3}"
echo " $ echo \"echo \\\"REAL_${DIR1_FILE3} ${EXTRA_LINKER_FLAGS} \\\$*\\\"\" > ${DIR1_FILE3}"
echo " $ echo \"REAL_${DIR1_FILE3} ${EXTRA_LINKER_FLAGS} \\\$*\" >> ${DIR1_FILE3}"
echo " $ echo \"else\" >> ${DIR1_FILE3}"
echo " $ echo \"echo \\\"REAL_${DIR1_FILE3} \\\$*\\\"\" > ${DIR1_FILE3}"
echo " $ echo \"REAL_${DIR1_FILE3} \\\$*\" >> ${DIR1_FILE3}"
echo " $ echo \"fi\" >> ${DIR1_FILE3}"
echo "if [[ \$* == *\"-shared\"* ]]; then" > ${DIR1_FILE3}
echo "echo \"REAL_${DIR1_FILE3} ${EXTRA_LINKER_FLAGS} \$*\"" >> ${DIR1_FILE3}
echo "REAL_${DIR1_FILE3} ${EXTRA_LINKER_FLAGS} \$*" >> ${DIR1_FILE3}
echo "else" >> ${DIR1_FILE3}
echo "echo \"REAL_${DIR1_FILE3} \$*\"" >> ${DIR1_FILE3}
echo "REAL_${DIR1_FILE3} \$*" >> ${DIR1_FILE3}
echo "fi" >> ${DIR1_FILE3}
cd $FIRMWARE_DIR
echo "---------------------------------------------------------------"
echo "SECOND TO REPLACE: aarch64 compilers in the toolchain directory"
echo "---------------------------------------------------------------"
echo
echo "1: Navigating into directory: ${DIR2}"
echo
echo " $ cd ${DIR2}"
echo
cd ${DIR2}
echo "2: Renaming '${DIR2_FILE1}' to 'REAL_${DIR2_FILE1}'"
echo
echo " $ mv ${DIR2_FILE1} REAL_${DIR2_FILE1}"
echo
mv ${DIR2_FILE1} REAL_${DIR2_FILE1}
echo " Renaming '${DIR2_FILE2}' to 'REAL_${DIR2_FILE2}'"
echo
echo " $ mv ${DIR2_FILE2} REAL_${DIR2_FILE2}"
echo
mv ${DIR2_FILE2} REAL_${DIR2_FILE2}
echo " Renaming '${DIR2_FILE3}' to 'REAL_${DIR2_FILE3}'"
echo
echo " $ mv ${DIR2_FILE3} REAL_${DIR2_FILE3}"
echo
mv ${DIR2_FILE3} REAL_${DIR2_FILE3}
echo "3: Creating empty script '${DIR2_FILE1}' and enabling the execution flag"
echo
echo " $ touch ${DIR2_FILE1}"
echo " $ chmod +x ${DIR2_FILE1}"
echo
touch ${DIR2_FILE1}
chmod +x ${DIR2_FILE1}
echo " Creating empty script '${DIR2_FILE2}' and enabling the execution flag"
echo
echo " $ touch ${DIR2_FILE2}"
echo " $ chmod +x ${DIR2_FILE2}"
echo
touch ${DIR2_FILE2}
chmod +x ${DIR2_FILE2}
echo " Creating empty script '${DIR2_FILE3}' and enabling the execution flag"
echo
echo " $ touch ${DIR2_FILE3}"
echo " $ chmod +x ${DIR2_FILE3}"
echo
touch ${DIR2_FILE3}
chmod +x ${DIR2_FILE3}
echo "4: Adding two lines to each script"
echo
echo " $ echo \"echo \\\"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE1} ${EXTRA_COMPILER_FLAGS} \\\$*\\\"\" > ${DIR2_FILE1}"
echo " $ echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE1} ${EXTRA_COMPILER_FLAGS} \\\$*\" >> ${DIR2_FILE1}"
echo "echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE1} ${EXTRA_COMPILER_FLAGS} \$*\"" > ${DIR2_FILE1}
echo "${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE1} ${EXTRA_COMPILER_FLAGS} \$*" >> ${DIR2_FILE1}
echo
echo " $ echo \"echo \\\"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE2} ${EXTRA_COMPILER_FLAGS} \\\$*\\\"\" > ${DIR2_FILE2}"
echo " $ echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE2} ${EXTRA_COMPILER_FLAGS} \\\$*\" >> ${DIR2_FILE2}"
echo "echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE2} ${EXTRA_COMPILER_FLAGS} \$*\"" > ${DIR2_FILE2}
echo "${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE2} ${EXTRA_COMPILER_FLAGS} \$*" >> ${DIR2_FILE2}
echo
echo " $ echo \"if [[ \$* == *\"-shared\"* ]]; then\" > ${DIR2_FILE3}"
echo " $ echo \"echo \\\"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} ${EXTRA_LINKER_FLAGS} \\\$*\\\"\" > ${DIR2_FILE3}"
echo " $ echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} ${EXTRA_LINKER_FLAGS} \\\$*\" >> ${DIR2_FILE3}"
echo " $ echo \"else\" >> ${DIR2_FILE3}"
echo " $ echo \"echo \\\"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} \\\$*\\\"\" > ${DIR2_FILE3}"
echo " $ echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} \\\$*\" >> ${DIR2_FILE3}"
echo " $ echo \"fi\" >> ${DIR2_FILE3}"
echo "if [[ \$* == *\"-shared\"* ]]; then" > ${DIR2_FILE3}
echo "echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} ${EXTRA_LINKER_FLAGS} \$*\"" >> ${DIR2_FILE3}
echo "${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} ${EXTRA_LINKER_FLAGS} \$*" >> ${DIR2_FILE3}
echo "else" >> ${DIR2_FILE3}
echo "echo \"${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} \$*\"" >> ${DIR2_FILE3}
echo "${FIRMWARE_DIR}/${DIR2}/REAL_${DIR2_FILE3} \$*" >> ${DIR2_FILE3}
echo "fi" >> ${DIR2_FILE3}
echo
cd $FIRMWARE_DIR
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.c++
csiph-web