bdsproj2mak: make won't stop on compile failure


2006-09-26 05:07:44 AM
cppbuilder30
Another issue with the group makefile generated by bdsproj2mak: it doesn't
stop when a compile errors out.
Details below, but my essential question comes down to this:
Is all of the Borland make magic (temp makefile, use of &&, etc.) documented
somewhere? Or, since they give make away as a command line util anyway,
maybe I could convince them to provide the source? =)
Anyhow, here are the details: make doesn't stop on an error because the
makefile uses pushd and popd on a single line, concatenated with single
ampersands:
@pushd $(<D) & $(MAKE) $(SILENT) -f $(<F) $(TARGET) & @popd
Which means that if make errors, and popd succeeds, the entire command will
succeed.
I expect the right thing to do instead would be use double ampersands ...
but double ampersands make things break in {*word*193} ways, apparently because to
borland make, && means "the name of the temporary make file, MAKE000.@@@@ or
whatever".
A workaround is to simply swipe the @popd off the end, which works because
each of these commands is executed in its own shell:
@pushd $(<D) & $(MAKE) $(SILENT) -f $(<F) $(TARGET)
Or alternatively,
@cd $(<D) & $(MAKE) $(SILENT) -f $(<F) $(TARGET)
Or maybe you could just use and escape &&, assuming Borland make gives you a
way to do this ... which brings us back to documentation for the make
utility.
--
Matt Lowe
Milsoft Utility Solutions