If this is the case, I still cannot see why it always performs the action of this rule (excerpt from an attachment in a previous post):
IntermediateFiles/%.o: SourceFiles/%.cpp | IntermediateFiles gcc -c $< -o $@ > Well, when you have: > > target: dependency > action > > GNU make will perform "action" if either "target" doesn't exist or is > older than "dependency". > > If you have: > > target: | dependency > action > > GNU make will perform "action" only if "target" doesn't already exist. > > Angel Tsankov wrote: > >> I didn't get this. Could you give a more detaild explanation? >> >> >>>In my view, all they do is change the meaning of "up to date" from the >>>usual "exists and timestamp is newer" to just "exists". >>> >>>Noel >>> >>>Angel Tsankov wrote: >>> >>> >>>>I'm having a really hard time what order-only prerequsites really do. >>>> >>>>First, I thought that they will do just fine if I want to have my object >>>>files go in a separate folder. This makes it necessary to ensure this >>>>folder (let's name it IntemediateFolder) exists before compilation of >>>>each source file. Of course, this check should not render the target >>>>(object file) out-of-date. As far as I get it all this make the >>>>folder-existence check (and creation if necessary) appropriate for an >>>>order-only prerequiste. However, I must be awfully wrong, 'cause I could >>>>not come up with a makefile that does exactly this. And I've been trying >>>>it since for a whole day... >>>> >>>>So, I've attached the troublesome makefile. I execute it with make 3.80 >>>>on a linux system. Could you explain to me why the script compiles the >>>>soruce files even when the objects do exist and are newer than the >>>>corresponding source files? >>>> >>>>Best wishes, >>>>An unsuccessful rocket sceintist >>>>_______________________________________________ >>>>Help-make mailing list >>>>[email protected] >>>>http://lists.gnu.org/mailman/listinfo/help-make >>> >> >> > > _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
