Fix Makefile and project config

This commit is contained in:
benn 2025-06-16 11:07:02 +02:00
parent 2f99433d11
commit 806b23c3d4

View file

@ -178,8 +178,10 @@ main()
if_no_dir_then_exit $pwd/nbproject "Not a NetBeans project"
if_no_file_then_exit $pwd/nbproject/project.xml "Netbeans project without a configuration file!"
if_no_file_then_exit $pwd/Makefile "Makefile not found"
# update compile_commands.json
if [ ! -f "compile_commands.json" ]; then
echo "WARNING: ./compile_commands.json not found"
echo " Netbeans project without a compilation database"
@ -202,10 +204,16 @@ main()
sed -i "/src\/myapp.cpp/c\"src\/${MAIN}.cpp\"\," compile_commands.json
fi
# update Makefile
sed -i -e "s/myapp/$MAIN/g" Makefile
# update nbproject
cd $pwd/nbproject
sed -i -e "s/<name>.*<\/name>/<name>$PROJECT<\/name>/g" project.xml
# update configurations.xml
sed -i -e "s/myapp/$MAIN/g" configurations.xml
cd "$pwd"/src
if [ -f ./myapp.cpp ]; then
mv myapp.cpp "$MAIN".cpp