detobel36

Compilation

Mar 21st, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.27 KB | None | 0 0
  1. #!/bin/bash
  2. # -*- coding:Utf8 -*-
  3.  
  4. ###########################################
  5. # Programme Bash type                     #
  6. # Bruxelles, 2015                         #
  7. ###########################################
  8.  
  9. ##################################
  10. #   =>  Projet: compile.sh  <=   #
  11. ##################################
  12.  
  13. echo "Compilation de fichier assembleur: "
  14. if [ -a IO.cpp ]
  15. then
  16.     echo "Quel est le nom du fichier que vous voulez compiler (sans le .asm)"
  17.     read -p "" -e input
  18.     if [ -a $input.asm ]
  19.     then
  20.         nasm -f elf $input.asm
  21.         if [ -a $input.o ]
  22.         then
  23.             g++ IO.cpp $input.o -m32 -o executable
  24.  
  25.             if [ -a executable ]
  26.             then
  27.                 ./executable
  28.             else
  29.                 echo "La commande 'g++ IO.cpp" $input".o -m32 -o executable' n'a pas fonctionnnée"
  30.             fi
  31.         else
  32.             echo "La commande 'nasm -f elf" $input".asm' n'a pas fonctionnée "
  33.         fi
  34.  
  35.     else
  36.         echo "Le fichier que vous avez spécifié n'existe pas"
  37.     fi
  38.  
  39. else
  40.     echo "Le fichier IO.cpp est introuvable.  Téléchargez le sur l'uv"
  41.     echo "Lien: http://bit.ly/1MTjYnx"
  42. fi
  43.  
  44. echo "Appuyer la touche <Entrée> pour fermer..."
  45. read touche
  46. echo "Fin de la compilation"
Advertisement
Add Comment
Please, Sign In to add comment