Created
December 5, 2015 21:27
-
-
Save donwilson/92805c3d42a2023fd4a8 to your computer and use it in GitHub Desktop.
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 | |
SOURCE_FILE=$1 | |
if [[ -z "$SOURCE_FILE" ]]; then | |
SOURCE_FILE="main" | |
fi | |
if [[ ! -f "$SOURCE_FILE.cpp" ]]; then | |
echo "!! $SOURCE_FILE.cpp not found, exiting..." | |
exit | |
fi | |
echo "Compiling $1.cpp..." | |
g++ -c $SOURCE_FILE.cpp -I/root/sfml/include | |
g++ $SOURCE_FILE.o -o $SOURCE_FILE -L/root/sfml/lib -lsfml-graphics -lsfml-window -lsfml-system | |
export LD_LIBRARY_PATH=/root/sfml/lib && ./$SOURCE_FILE | |
rm $SOURCE_FILE.o |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment