build: Use `del` instead of `rm` on `cmd.exe` shells
authorSimon Richter <Simon.Richter@hogyros.de>
Tue, 22 Dec 2015 21:45:33 +0000 (22:45 +0100)
committerAndrea Canciani <ranma42@gmail.com>
Wed, 23 Dec 2015 20:24:17 +0000 (21:24 +0100)
The `rm` command is not usually available when running on Win32 in a
`cmd.exe` shell. Instead the shell provides the `del` builtin, which
has somewhat more limited wildcars expansion and error handling.

This makes all of the Makefile targets work on Win32 both using
`cmd.exe` and using the MSYS environment.

Signed-off-by: Simon Richter <Simon.Richter@hogyros.de>
Signed-off-by: Andrea Canciani <ranma42@gmail.com>
Acked-by: Oded Gabbay <oded.gabbay@gmail.com>
Makefile.win32.common

index a759ddc8ad37a1b0d1e497952702a9a0d084355a..756fc94a6ee9d02d656b1704b0b53885836ae56d 100644 (file)
@@ -5,6 +5,10 @@ LD = link
 AR = lib
 PERL = perl
 
+ifneq ($(shell echo ""),)
+RM = del
+endif
+
 ifeq ($(top_builddir),)
 top_builddir = $(top_srcdir)
 endif
@@ -51,7 +55,7 @@ $(CFG_VAR):
 $(CFG_VAR)/%.obj: %.c $(libpixman_headers) | $(CFG_VAR)
        @$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
 
-clean: inform
-       @$(RM) $(CFG_VAR)/*.{exe,ilk,lib,obj,pdb} || exit 0
+clean: inform $(CFG_VAR)
+       @cd $(CFG_VAR) && echo > silence_error.exe && $(RM) *.exe *.ilk *.lib *.obj *.pdb
 
 .PHONY: inform clean