Hi everyone,
and thanks for all the replies. I'll answer to them in the order they arrived in my mailbox in this one long mail (so I do not pollute the list unnecessarily).
For each inaccessible source file ..\part12\inaccessible_source_file.cpp
you create inaccessible_source_file.cpp in your part11 folder containing just 2
lines:
// part11/inaccessible_source_file.cpp
#include "..\part12\inaccessible_source_file.cpp // bring it in
[What??? To #include a source file???]
Ugly.
I use it b/c other solutions are no better IMHO.
Alex, indeed I was thinking of this method, but it contradicts the goal of automating the build as much as possible. New files appear and old ones disappear in the folder structure over time. So we would be maintaining even more files than before.
Probably, but not if you want to use "build". I would point out that
the one-library-per-directory scheme is exactly how Windows and Windows
CE are themselves built.
Tim, I know. But this doesn't necessarily mean that there is no other way (I hoped) 
MAKEFILE.INC is your potential friend here. In it you may create your own
inference rules to wherever you source files exist.
David, thanks. That's a good pointer. Can you give me a hint which of the rules could be best used to reach the goal? I have had a look into MAKEFILE.NEW in order to find out what should be done in MAKEFILE.INC, but I don't get it.
And for what it is worth, the technique of using 'surrogate' target files
that include the actual target file does not confuse BUILD nor
MAKEFILE.NEW nor the debugger (as you have pointed out) since the PDB gets the full
path to the source files *and* #include files. Things get a little tricky
with precompiled header usage (the #include must be in the surrogate) but even
that is not all that onerous.
David: Only, the "surrogate" source files will be those which contain the #include clause.
What is wrong with this method? Or better, what gain are you expecting
to achieve? I understand it is a bit tedious to create such a structure
(one I did it for rather big existing sources base) but once it is done
it works and results are equivalent.
Michal, surely I would have done that already, if it was an option. It isn't. The simple problem is, that the team that is working on the source tree I am talking about is pretty conservative and that we (my team) are now challenged with creating a single driver LIB that can be used by third parties. Changing the structure is not up for debate.
I tend now to setup projects, even ones that do not involve NTBUILD,
within the narrow confines of how NTBUILD works. It only sucks when you have to
take some gigantic 'over engineered' effort for some other build
environment and just make it work in NTBUILD. At that point, I tend to pull out all
of the stops, put the clothespin on my nose, and do what it takes.
David, bingo - exactly the case here. Also, the interesting part is that the source tree in question is otherwise built with numerous compilers on numerous processor platforms/operating systems/build environments. So yes, the structure is liberal, but apart from BUILD.EXE no other tool has trouble with it.
Hmm, then... those who want to play these linuxy games,
can create symlinks (or hard links) to the .c files in same folder with
SOURCES.
Windows does support links.
Pavel, hardlinks are too volatile and symlinks only exist in Vista and later for files. Why are hardlinks volatile? Well, most applications are totally unaware of them. Try editing a .doc file in MS Word - it'll break the hardlink every single time, because of the way it opens/copies/renames the files.
( IMHO, strange structure of source directories is often self-inflictied
damage, or maybe a team management issue, when several ambitious "agile" folks
must be prevented from fighting over common files , rather than cooperating )
Pavel: Well, sometimes it's rather a legacy. And if I could disclose more about the structure you would perhaps not find it too strange after all. It's just that BUILD.EXE imposes more restrictions than other build tools.
Do you want to merge several LIBs built with the usual WDK procedure,
into one LIB?
Pavel: Yes, this is what I want to achieve.
Sorry, don't know how to do this with the build utilities
(never tried or needed); maybe you can simply run lib (= link /lib)
to merge the libs, instead?
Pavel: That's what we do at the moment due to the lack of a more elegant way. My problem with this is, that it relies on a feature of DDKBUILD.CMD (ddkpostbld.cmd) and therefore wouldn't work with the OSR .bat or Mark Roddy's version. A method based solely on the WDK build environment would be perfect. But as I saw from the discussion the only trick (by David) that may do it will cause lots of unnecessary compiles.
C files can be located in the parent dir of SOURCES
(referred as ..\ ) If this doesn't work for you, can you please give
more details?
Pavel: It doesn't work because the tree is branched further than just one level.
Another idea could be to place the files in folders virtually, while
they really are in same filesystem folder at the build time:
Pavel: Sadly the directory structure will not be changed. It's not a matter of "can" or "should", but rather that it isn't even up for debate.
Thanks for all your help.
I'll further look into what MAKEFILE.INC can do for me in the respective subfolders, but if it doesn't work, I'll stick with what we have at the moment. Just thought that someone here found a really elegant way around how BUILD.EXE works.
// Oliver
DDKWizard and DDKBUILD: http:
Trunk (potentially unstable) version: http:</http:></http:>