summaryrefslogblamecommitdiffstats
path: root/build.sh
blob: c5ed95bf1058aaee951ae610cc34e3d04d047444 (plain) (tree)
1
2
3
4
5
6
7
8
9
           




                                         


              
                                          
                  


                           







                                                                   

                                 
                                        
 
            
                                                  
                    
       
#!/bin/bash
#########################################
#                                       #
#      fbsplash builder with CMake      #
#                                       #
#########################################
DIR=$(pwd)
BUILDDIR=build

# if -c option was given, remove build dir
if [ "$1" = "-c" ]
then
  rm -rf $BUILDDIR
  echo "$BUILDDIR removed."
fi

if [ ! -f CMakeLists.txt ]
then
  echo "No CMakeLists.txt found."
  echo "Run this script from the folder containing CMakeLists.txt."
  exit 1
fi

# make build dir if its not there
[ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR

cd $BUILDDIR
# create Makefile from CMakeLists.txt and run make
cmake "$DIR" && make
cd $DIR