Skip to content

Instantly share code, notes, and snippets.

@m-ou-se
Last active December 12, 2015 05:38
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 m-ou-se/4722560 to your computer and use it in GitHub Desktop.
Save m-ou-se/4722560 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ ! -f Makefile -a "$1" != "-C" ]; then
if [ -f build/Makefile ]; then
/usr/bin/make -C build "$@"
elif [ -f CMakeLists.txt ]; then
( mkdir build && cd build && cmake .. && make "$@" )
else
echo "No Makefile, build/Makefile or CMakeLists.txt found." >&2
exit 1
fi
else
/usr/bin/make "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment