% MAKEMETISDLL : hacked-up script to make a Metis mex-file under Windows

files = {'coarsen' 'fm' 'initpart' 'match' 'ccgraph' 'memory' ...
         'pmetis' 'pqueue' 'refine' 'util' 'timing' 'debug' ...
         'bucketsort' 'graph' 'stat' 'kmetis' 'kwayrefine' ...
         'kwayfm' 'balance' 'ometis' 'srefine' 'sfm' 'separator' ...
         'mincover' 'mmd' 'mesh' 'meshpart' 'frename' 'fortran' ...
         'myqsort' 'compress' 'parmetis' 'estmem' ...
         'mpmetis' 'mcoarsen' 'mmatch' 'minitpart' 'mbalance' ...
         'mrefine' 'mutil' 'mfm' 'mkmetis' 'mkwayrefine' 'mkwayfmh' ...
         'mrefine2' 'minitpart2' 'mbalance2' 'mfm2' ...
         'kvmetis' 'kwayvolrefine' 'kwayvolfm' 'subdomains' };
 
 % Compile all the source files into object files
 for i = 1:length(files)
     fname = char(files(i));
     mex ('-c', '-I.', [fname '.c']);
 end;
 
 % Set up the command to create the dll and execute it
 flist = [];
 for i = 1:length(files)
     flist = [flist char(files(i)) '.obj '];
 end;
 mexstring = ['mex -I. metismex.c ' flist];
 eval(mexstring);