msvc.mak: make sure perl is only run if it exists

Only try to run a Perl interpreter if the system actually has one
available. Because timestamps on Windows are apparently not preserved
on archive extraction, otherwise it might happen that nmake will try
to rebuild files even through they already exist.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2025-10-01 19:20:37 -07:00
parent 03391e61ec
commit 959644a017

View File

@ -49,7 +49,11 @@ LIBS =
PERL = perl
PERLFLAGS = -I$(srcdir)/perllib -I$(srcdir)
!IF [$(PERL) $(PERLFLAGS) -e "exit 0;"] == 0
RUNPERL = $(PERL) $(PERLFLAGS)
!ELSE
RUNPERL = :
!ENDIF
MAKENSIS = makensis
@ -184,10 +188,12 @@ NDISLIB = libndis.$(A)
all: nasm$(X) ndisasm$(X)
nasm$(X): $(NASM) $(MANIFEST) $(NASMLIB)
$(CC) /Fe:$@ $(NASM) $(NASMLIB) $(LIBS) $(ALL_LDFLAGS)
$(CC) /Fe:$@ $(ALL_CFLAGS) $(NASM) $(NASMLIB) $(LIBS) \
$(ALL_LDFLAGS)
ndisasm$(X): $(NDISASM) $(MANIFEST) $(NDISLIB) $(NASMLIB)
$(CC) /Fe:$@ $(NDISASM) $(NDISLIB) $(NASMLIB) $(LIBS) $(ALL_LDFLAGS)
$(CC) /Fe:$@ $(ALL_CFLAGS) $(NDISASM) $(NDISLIB) $(NASMLIB) $(LIBS) \
$(ALL_LDFLAGS)
$(NASMLIB): $(LIBOBJ)
$(AR) $(ARFLAGS) /out:$@ $**