1function [s, t, tobj] = cs_must_compile (srcdir, f, suffix, obj, hfile, force)
2%CS_MUST_COMPILE return 1 if source code f must be compiled, 0 otherwise
3%   Used by cs_make, and MATLAB/Test/cs_test_make.m.
4%
5%   Example:
6%        none, not meant for end users.
7%   See also: CS_MAKE.
8
9% Copyright 2006-2012, Timothy A. Davis, http://www.suitesparse.com
10
11dobj = dir ([f obj]) ;
12if (force | isempty (dobj))                                                 %#ok
13    s = 1 ;
14    t = Inf ;
15    tobj = -1 ;
16    return
17end
18dsrc = dir ([srcdir f suffix '.c']) ;
19dh = dir (hfile) ;
20t = max (datenum (dsrc.date), datenum (dh.date)) ;
21tobj = datenum (dobj.date) ;
22s = (tobj < t) ;
23