precompilation - compile routine files of the toolbox
precompilation(flag,cmd,incl_path,path,listf)
- flag : string. compiler flag
- 'GCC' : gcc compiler
- 'LCC' : lcc-win32 compiler
- 'VC' : visual c/c++ compiler
- string. cmd : string. command-line of the compiler
- incl_path : vector of strings. the include paths for the compiler
- path : string. directory of the targetted object files
- listf : vector of strings. name of object file to compile.
//precompilation
//Entrée flag : flag compilateur (GCC,LCC,VC)
// cmd : commande du compilateur
// incl_path : répertoires à inclure lors de la compilation
// path : le chemin du répertoire de compilation
// listf : liste des fichiers à compiler sans extension (ex:monmodule)
function []=precompilation(flag,cmd,incl_path,path,listf)
printf(" Make first compilation...\n");
select flag
case 'GCC' then
INCL_PATH=incl_path;
CCFLAG=[];
for i=1:size(INCL_PATH,'*')
CCFLAG=CCFLAG+"-I"+INCL_PATH(i)+" ";
end
CCFLAG=CCFLAG+"-c ";
cmd=cmd+CCFLAG;
listf=listf+'.c';
case 'G77' then
FCFLAG=[];
FCFLAG=FCFLAG+"-c ";
cmd=cmd+FCFLAG;
listf=listf+'.f';
case 'LCC' then
INCL_PATH=incl_path;
CCFLAG=[];
for i=1:size(INCL_PATH,'*')
CCFLAG=CCFLAG+"-I"+INCL_PATH(i)+" ";
end
CCFLAG=CCFLAG+"-c ";
cmd=cmd+CCFLAG;
listf=listf+'.c';
case 'VC' then
INCL_PATH=incl_path;
CCFLAG=[];
for i=1:size(INCL_PATH,'*')
CCFLAG=CCFLAG+"/I "+INCL_PATH(i)+" ";
end
CCFLAG=CCFLAG+"/c ";
cmd=cmd+CCFLAG;
listf=listf+'.c';
case 'trash' then
printf("Compilation aborted\n");
return;
end
//change directory
rep=pwd();
chdir(MODNUM+path);
//compilation
for i=1:size(listf,'*')
unix_g(cmd+listf(i))
end
//change directory
chdir(rep);
endfunction
IRCOM Group
Alan Layec