////////////////////////////////////////////////////////////////////////////////
//                                Lisaac                                      //
//                                                                            //
//                  LSIIT - ULP - CNRS - INRIA - FRANCE                       //
//                                                                            //
//    This program is free software; you can redistribute it and/or modify    //
//    it under the terms of the CeCILL v2 License as published by the         //
//    CEA - CNRS - INRIA.                                                     //
//                                                                            //
//    This program is distributed in the hope that it will be useful,         //
//    but WITHOUT ANY WARRANTY; without even the implied warranty of          //
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            //
//    CeCILL v2 License for more details.                                     //
//                                                                            //
//    You should have received a copy of the CeCILL v2 license along with     //
//    this program.                                                           //
//    If not, see <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>  //
//                                                                            //
//                    http://isaacproject.u-strasbg.fr/                       //
////////////////////////////////////////////////////////////////////////////////

Section Inherit
  
  - parent:Expanded PATH;

Section PATH
  
  - lib_compiler <-
  (
    path := path +
    lisaac + "src/tools/\n" +
    lisaac + "src/type/\n" +
    lisaac + "src/item/\n" +
    lisaac + "src/constant/\n" +
    lisaac + "src/variable/\n" +
    lisaac + "src/external/\n" +
    lisaac + "src/external/logic/\n" +
    lisaac + "src/external/arithmetic/\n" +
    lisaac + "src/external/comparison/\n" +
    lisaac + "src/dispatcher/\n" +
    lisaac + "src/context/\n" +
    lisaac + "src/code_life/\n";
  );
  
Section Public
  
  - compiler <-
  ( + exec:STRING;
    
    lib_std;
    lib_unix;
    lib_compiler;
    path := path + lisaac + "src/compiler_any/\n";
    
    exec := "gcc " + input_file + " -o " + output_file + option_gcc;
    
    (debug_level = 0).if {
      execute (exec + " -O2 ");
    } else {
      execute exec;
    };
    finalize := TRUE;
  );

  - shorter <-
  ( + exec:STRING;
    
    lib_std;
    lib_unix;
    lib_compiler;
    path := path + lisaac + "src/shorter_any/\n";
    
    exec := "gcc " + input_file + " -o " + output_file + option_gcc;
    
    (debug_level = 0).if {
      execute (exec + " -O2 ");
      execute "cp shorter ../bin/.";
      execute "cp shorter.c ../bin/.";
    } else {
      execute exec;
    };
    finalize := TRUE;
  );
  
