Created
May 20, 2022 05:15
-
-
Save Pixailz/6a9022f8b379b0e8b7063eaaf5de33fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# little script found on this repo https://github.com/gpoblon/libft | |
# need the see whats going one here (even in the make file, style method with tputs for the "cursor") | |
MYPATH=$(pwd) | |
CUR_MAKEFILE=$MYPATH/Makefile | |
if [ -e $CUR_MAKEFILE ] | |
then | |
echo "regenerate Makefile" | |
sed "`grep -n 'SRC =' $CUR_MAKEFILE | sed 's/:.*//'`, \$d" $CUR_MAKEFILE > NEWMAKEFILE | |
grep 'SRC =' $CUR_MAKEFILE >> NEWMAKEFILE | |
expr "$(find ./src | grep "\.c$" | sed -e 's/src\///' -e 's/\.\///' -e 's/$/\\/')" : "\(.*\).$" >> NEWMAKEFILE | |
echo "" >> NEWMAKEFILE | |
echo "INC_D = inc/" >> NEWMAKEFILE | |
sed "1, `grep -n 'INC_D =' $CUR_MAKEFILE | sed 's/:.*//'`d" $CUR_MAKEFILE >> NEWMAKEFILE | |
mv $CUR_MAKEFILE ~/Documents/.OLDMakefile | |
mv NEWMAKEFILE $CUR_MAKEFILE | |
echo "Makefile done (copy still alive in ~/Documents/.OLDMakefile)" | |
else | |
echo "Makefile not found." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment