Future-proof `make clean` under Windows

In Windows cmd, `del foo` succeeds if `foo` doesn't exist, but
`del *.ext` fails if `*.ext` doesn't match any files. Therefore we use
the idiom `if exist *.ext del *.ext` to delete files matching
wildcards.

We've accidentally used `if exist $(some_list) del $(some_list)`, and
that's wrong, because it's only syntactically correct if
`$(some_list)` contains exactly one element. As long as `$(some_list)`
contains actual file names and not wildcards, just use `del $(some_list)`.
This commit is contained in:
Gilles Peskine 2020-03-10 13:29:19 +01:00
Родитель a647f1296e
Коммит 5ec51f923a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -363,7 +363,7 @@ ifndef WINDOWS
else
if exist *.o del /Q /F *.o
if exist *.exe del /Q /F *.exe
if exist $(EXTRA_GENERATED) del /S /Q /F $(EXTRA_GENERATED)
del /S /Q /F $(EXTRA_GENERATED)
endif
$(MAKE) -C fuzz clean