Skip to content

Instantly share code, notes, and snippets.

@m-ou-se
m-ou-se / make
Last active December 12, 2015 05:38
#!/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