1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) DIGITEO - 2009-2011 - Allan CORNET
4 // This file must be used under the terms of the CeCILL.
5 // This source file is licensed as described in the file COPYING, which
6 // you should have received as part of this distribution. The terms
7 // are also available at
8 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 //=============================================================================
10 function ilib_gen_cleaner(makename,loadername,files)
19 loadername = 'loader.sce';
26 cleanername = 'cleaner.sce';
28 fd = mopen(cleanername,"wt");
29 mfprintf(fd,"// This file is released under the 3-clause BSD license. See COPYING-BSD.\n");
30 mfprintf(fd,"// Generated by builder.sce : Please, do not edit this file\n");
31 mfprintf(fd,"// cleaner.sce\n");
32 mfprintf(fd,"// ------------------------------------------------------\n");
33 mfprintf(fd,"curdir = pwd();\n");
34 mfprintf(fd,"cleaner_path = get_file_path(''cleaner.sce'');\n");
35 mfprintf(fd,"chdir(cleaner_path);\n");
36 mfprintf(fd,"// ------------------------------------------------------\n");
37 mfprintf(fd,"if fileinfo(''%s'') <> [] then\n",loadername);
38 mfprintf(fd," mdelete(''%s'');\n",loadername);
40 mfprintf(fd,"// ------------------------------------------------------\n");
42 if getos() == 'Windows' then
43 // Load dynamic_link Internal lib if it"s not already loaded
44 if ~ exists("dynamic_linkwindowslib") then
45 load("SCI/modules/dynamic_link/macros/windows/lib");
48 dlwGenerateCleaner(fd, makename);
52 for i = 1:size(files,'*')
53 if ( files(i) <> '' ) then
54 mfprintf(fd,"if fileinfo(''%s'') <> [] then\n", files(i));
55 mfprintf(fd," mdelete(''%s'');\n", files(i));
57 mfprintf(fd,"// ------------------------------------------------------\n");
62 mfprintf(fd,"chdir(curdir);\n");
63 mfprintf(fd,"// ------------------------------------------------------\n");
66 if ilib_verbose() > 1 then
67 disp(mgetl('cleaner.sce'));
70 //=============================================================================