Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. CC=gcc
  4.  
  5. PRONAME=$0
  6. if [ -z $1 ];then
  7. echo -e "\033[0;31mUsage : $PRONAME < C-Programs File's name >\033[0m"
  8. exit 1
  9. fi
  10. FLAGS="$* -g -lpthread"
  11.  
  12. FILN=$1
  13. FILO=$(echo "$1"|sed 's/\.[Cc]$//g')
  14.  
  15.  
  16. #echo $FILN
  17. #echo $FILO
  18. #echo $FLAGS
  19.  
  20. if [ ${FILN} = ${FILO} ];then
  21. echo -e "\033[0;31m Input filename is not a C-Program file !\033[0m"
  22. exit 1
  23. fi
  24.  
  25. echo "Compiling ..."
  26. echo -e "CC \033[0;35m${FLAGS}\033[0m"
  27. ${CC} -o ${FILO} ${FLAGS}
  28. #echo $CC
  29. #echo ${FILO}
  30. #echo ${FLAGS}
  31. if [ 0 -ne $? ];then
  32. echo -e "\033[43;33mERROR ${CC} -o ${FILO} ${FILN} ${FLAGS}\033[0m"
  33. else
  34. # echo "${FILO} is OK."
  35. echo -e "\033[0;36m Completed .\033[0m"
  36. fi
  37. echo -e "\033[0;31m $(date)\033[0m"
  38. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement