Hi Przemek,
Thank you very much.
You're welcome.
-M* GCC switches were designed to use with static dependencies files
not to scan source code on each make call so the speed was less
important
because dependencies list is created once at startup and then only
rebuilt
if some files in the list is modified.
If you can add support for optional files with explicit dependencies
then
it's possible to use this functionality in the same way with hbmk2
as with
GCC and GNU make, i.e. you can read .d files. They have format like:
<dstfile>: <srcfiles,...>
\ as last non blank character concatenates lines. To simplify the
format
and resolve possible conflicts with '\' ad path separator in DOS/
Windows
we can define that it has to follow blank (TAB or SPACE) character
or is
the only one non blank character in the line.
Below I'm attaching code which creates hash array indexed by files
with
array of dependent files so it's enough to check if given file is in
such array, i.e.:
if cFile $ hDeps
for each cDep in hDeps[ cFile ]
if hb_FGetDateTime( cDep, @tDepTime ) .and. tDepTime >
tFileTime
lRebuild := .t.
exit
endif
next
endif
Can you add it?
I'll commit something, but I'd like to ask you to test it.
Feel free to even make corrections.
Before I do, I have a few questions:
- Shouldn't Harbour compiler also use this same .d format, so
we can use the method for .prg files, too?
- Am I right that these .d files are supposed to be autodetected?
If so, what is the name? filename.d or filename.c.d?
Here I have a little worry that this extra file existence
check in mass will slow down normal make process, especially
on network shares. I have projects with up to 800 files.
Other options are passing these .d files explicitly, or
add a new switch to enable parsing of .d files, like -head=d.
Brgds,
Viktor
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour