|
It could be done, I suppose, but are you sure this is really the right approach? A customary arrangement would be to factor the platform-dependent stuff to individual #include files or directories, then at compilation time pass in a #define which selects which platform to build for. By and large, this sounds like a more maintainable and scalable approach than what you are proposing (and avoids this pesky issue of copying files and then being sure whatever is there is indeed the correct version).
"Classic" make is not very amenable to conditional dependencies; if GNU make syntax or some other extension is permissible, then it almost sounds doable, but still not necessarilly elegant and sustainable.
Whatever you come up with, I'd think you need to take into account idempotency and concurrency issues; what if a make is aborted, and the files are left lying there for the next make to pick up; or, what if two makes are started at roughly the same time?
Last edited by era; 05-12-2008 at 08:41 AM.
Reason: Idempotency and concurrency remarks
|