Skip to content

Instantly share code, notes, and snippets.

@sblack4
Created March 19, 2024 16:28
Show Gist options
  • Save sblack4/58deea171eb990cede78a97d95addc2b to your computer and use it in GitHub Desktop.
Save sblack4/58deea171eb990cede78a97d95addc2b to your computer and use it in GitHub Desktop.
# looops through subdirs
# look for file or symlink named Makeifle
# creates a new one
for folder in $(echo *); do
if [ -d $folder ]; then
cd $folder
# test for file
if [ -f "Makefile" ]
then
echo $folder
rm Makefile
echo "include ../Makefile" > Makefile
echo >> Makefile
fi
# test for symlink
if [ -L "Makefile" ]
then
echo $folder
rm Makefile
echo "include ../Makefile" > Makefile
echo >> Makefile
fi
cd ..
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment