Skip to content

Instantly share code, notes, and snippets.

@serverwentdown
Created August 31, 2014 08:14
Show Gist options
  • Save serverwentdown/2d9bddc30cc05e825ff9 to your computer and use it in GitHub Desktop.
Save serverwentdown/2d9bddc30cc05e825ff9 to your computer and use it in GitHub Desktop.
Makefile for all my CS C labs
all:
for f in `find * -type d -maxdepth 0 ! -regex .`; do\
gcc -o $$f/main.o $$f/main.c;\
done;
all:
make compile && make zip
compile:
for f in `find * -type d -maxdepth 0 ! -regex .`; do\
echo "making in ./$$f/...";\
make -C $$f/ > /dev/null;\
done;
zip:
for f in `find * -type d -maxdepth 0 ! -regex .`; do\
rm AmbroseChua$$f.zip;\
echo "zipping up ./$$f/...";\
zip -r AmbroseChua$$f.zip $$f > /dev/null;\
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment