I have a question regarding a GNU-make macro like this (which I use to link a MSVC .dll):
define do_link_DLL link $(LDFLAGS) -dll -out:$(1) -implib:$(2) \ -pdb:$(1:.dll=.pdb) -map:$(1:.dll=.map) $(3) > link.tmp cat link.tmp >> $(1:.dll=.map) rm -f $(2:.lib=.exp) link.tmp endef Using this as (in a Wireshark makefile): wiretap.dll: $(WIRETAP_OBJ) $(call do_link_DLL,wiretap.dll,wiretap_imp.lib, $^ $(EXTRA_LIBS)) AFAICS, if the 'link' stage fails, the rule continues to the 'cat' + 'rm' part regardless. But from gmake's perspective all the commands succeeds (since cat+rm returns 0). No? How can I define my macro for gmake to quit on 'link' error? Can the macro be written into a Perl-like: exec("link $args") || die "link failed"; If so, how? PS. Since I have '-verbose' in LDFLAGS, it is handy to redirect those (error) messages into 'link.tmp' in case of a link-failure. -- --gv _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make