Imported Debian patch 0.13.1-3
[pkg-lisaac.git] / new_path / compiler.li
blob7e19d50cceec648c3eb4996df36cd7eb99a59e4e
1 ////////////////////////////////////////////////////////////////////////////////
2 //                                Lisaac                                      //
3 //                                                                            //
4 //                  LSIIT - ULP - CNRS - INRIA - FRANCE                       //
5 //                                                                            //
6 //    This program is free software; you can redistribute it and/or modify    //
7 //    it under the terms of the CeCILL v2 License as published by the         //
8 //    CEA - CNRS - INRIA.                                                     //
9 //                                                                            //
10 //    This program is distributed in the hope that it will be useful,         //
11 //    but WITHOUT ANY WARRANTY; without even the implied warranty of          //
12 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            //
13 //    CeCILL v2 License for more details.                                     //
14 //                                                                            //
15 //    You should have received a copy of the CeCILL v2 license along with     //
16 //    this program.                                                           //
17 //    If not, see <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>  //
18 //                                                                            //
19 //                    http://isaacproject.u-strasbg.fr/                       //
20 ////////////////////////////////////////////////////////////////////////////////
22 Section Inherit
23   
24   - parent:Expanded PATH;
26 Section PATH
27   
28   - lib_compiler <-
29   (
30     path := path +
31     lisaac + "src/tools/\n" +
32     lisaac + "src/type/\n" +
33     lisaac + "src/item/\n" +
34     lisaac + "src/constant/\n" +
35     lisaac + "src/variable/\n" +
36     lisaac + "src/external/\n" +
37     lisaac + "src/external/logic/\n" +
38     lisaac + "src/external/arithmetic/\n" +
39     lisaac + "src/external/comparison/\n" +
40     lisaac + "src/dispatcher/\n" +
41     lisaac + "src/context/\n" +
42     lisaac + "src/code_life/\n";
43   );
44   
45 Section Public
46   
47   - compiler <-
48   ( + exec:STRING;
49     
50     lib_std;
51     lib_unix;
52     lib_compiler;
53     path := path + lisaac + "src/compiler_any/\n";
54     
55     exec := "gcc " + input_file + " -o " + output_file + option_gcc;
56     
57     (debug_level = 0).if {
58       execute (exec + " -O2 ");
59     } else {
60       execute exec;
61     };
62     finalize := TRUE;
63   );
65   - shorter <-
66   ( + exec:STRING;
67     
68     lib_std;
69     lib_unix;
70     lib_compiler;
71     path := path + lisaac + "src/shorter_any/\n";
72     
73     exec := "gcc " + input_file + " -o " + output_file + option_gcc;
74     
75     (debug_level = 0).if {
76       execute (exec + " -O2 ");
77       execute "cp shorter ../bin/.";
78       execute "cp shorter.c ../bin/.";
79     } else {
80       execute exec;
81     };
82     finalize := TRUE;
83   );
84