Skip to content

Instantly share code, notes, and snippets.

@v-i-s-h
Created September 1, 2018 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save v-i-s-h/386aae25d965c20623d2ca120421a8b8 to your computer and use it in GitHub Desktop.
Save v-i-s-h/386aae25d965c20623d2ca120421a8b8 to your computer and use it in GitHub Desktop.
Shell script to build programs
# Shell script to build programs
CFLAGS=`pkg-config --cflags libzmq`
LIBS=`pkg-config --libs libzmq`
# If no input, build all
if [ -z "$1" ]
then
for file in *.c
do
gcc $file -o ./out/${file%.c} $CFLAGS $LIBS
done
else
gcc $1 -o ./out/${1%.c} $CFLAGS $LIBS
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment