Created
August 22, 2016 23:30
-
-
Save infosec-intern/12923c9d7fb44b86df42bdbebff464ed to your computer and use it in GitHub Desktop.
New exercise and skeleton Makefile scripts - makes creating new exercises easier for LearnCTheHardWay
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
CFLAGS=-Wall -g | |
EX= | |
all: | |
make ${EX} | |
ec: | |
gcc ${CFLAGS} -o ec extracredit.c | |
broken: | |
gcc ${CFLAGS} -o broken broken.c | |
clean: | |
rm -f ${EX} broken ec |
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
#!/bin/bash | |
EX="$1" | |
SKEL="#include <stdio.h>\n | |
\n | |
int main(int argc, char *argv[])\n | |
{\n | |
\treturn 0;\n | |
}" | |
mkdir $EX | |
cat Makefile | sed -e "s/EX=/EX=$EX/" > $EX/Makefile | |
echo -e $SKEL > $EX/$EX.c | |
echo -e $SKEL > $EX/broken.c | |
echo -e $SKEL > $EX/extracredit.c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment