cryptest

Cryptography-related scribbles
git clone git://git.finwo.net/misc/cryptest
Log | Files | Refs | README

configure (667B)


      1 #!bash -
      2 
      3 echo "Removing old makefile"
      4 rm -f Makefile
      5 
      6 echo "Building makefile"
      7 touch Makefile
      8 
      9 echo -n " - Detecting compiler... "
     10 FCC=$(command -v musl-gcc gcc 2>/dev/null | head -1)
     11 [[ ! -z $FCC ]] && {
     12   echo $FCC
     13   echo "CC="$FCC >> Makefile
     14 } || {
     15   echo ""
     16   echo "No C compiler detected!"
     17   exit 1
     18 }
     19 
     20 
     21 echo " - C flags"
     22 echo "CFLAGS :=" >> Makefile
     23 command -v gcc &>/dev/null && echo "CFLAGS += -Os -s" >> Makefile
     24 echo "CFLAGS += -I inc" >> Makefile
     25 
     26 echo " - Other variables"
     27 for i in $(ls make/0* | sort) ; do echo "   - "$i ; cat $i >> Makefile ; done
     28 
     29 echo " - Build targets"
     30 for i in $(ls make/9* | sort) ; do echo "   - "$i ; cat $i >> Makefile ; done