> From: Gisle Vanem <gva...@yahoo.no> > Date: Wed, 9 Dec 2015 16:19:39 +0100 > > 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?
The Windows shell understands || and && between 2 commands. I think you already know that, so I'm quite sure I'm missing something here, because that's the first thing I'd try. _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make