summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Richter <Simon.Richter@hogyros.de>2019-02-11 16:51:35 +0100
committerMatt Turner <mattst88@gmail.com>2019-03-27 15:12:52 -0700
commitef4fb03248ae7748090ec52f02261c331590579c (patch)
tree0539f0828948b8cb4b61f2230900a566d446c9e4
parent55d8f956c2da14ea2235c066dbc6e431b973e042 (diff)
downloadpixman-ef4fb03248ae7748090ec52f02261c331590579c.tar.gz
Windows: Support building with SHELL=cmd.exe
When GNU Make is not from msys, the startup cost for sh.exe is massive compared to cmd.exe. Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--Makefile.win32.common16
1 files changed, 14 insertions, 2 deletions
diff --git a/Makefile.win32.common b/Makefile.win32.common
index 0048cf8..1b2f894 100644
--- a/Makefile.win32.common
+++ b/Makefile.win32.common
@@ -1,5 +1,17 @@
LIBRARY = pixman-1
+ifeq ($(shell echo ""),)
+# POSIX style shell
+mkdir_p = mkdir -p $1
+rm = $(RM) $1
+echo = echo "$1"
+else
+# DOS/Windows style shell
+mkdir_p = if not exist $(subst /,\,$1) md $(subst /,\,$1)
+echo = echo $1
+rm = del $(subst /,\,$1)
+endif
+
CC = cl
LD = link
AR = lib
@@ -50,12 +62,12 @@ endif
endif
$(CFG_VAR):
- @mkdir $@
+ @$(call mkdir_p,$@)
$(CFG_VAR)/%.obj: %.c $(libpixman_headers) | $(CFG_VAR)
$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
clean: inform $(CFG_VAR)
- @cd $(CFG_VAR) && echo > silence_error.exe && $(RM) *.exe *.ilk *.lib *.obj *.pdb
+ -$(call rm,$(CFG_VAR)/*.exe $(CFG_VAR)/*.ilk $(CFG_VAR)/*.lib $(CFG_VAR)/*.obj $(CFG_VAR)/*.pdb)
.PHONY: inform clean