From dcfb55cedc50f087df3863942a0471f4f56f6a35 Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Wed, 5 Apr 2017 07:42:29 +0200 Subject: [PATCH] Add special rules for MinGW Some (all?) variants of MinGW do not have a working 'fmt'. This is not indispensable to the rule working, it makes it just look good. The sed -e 's/\\\\...' rule appears necessary when executing the command within 'make'. This is definitely a bug. If I execute the command within the Windows CMD, I need the extra \\. If I execute the command within bash or sh, I do not. --- config.mingw.mk | 5 +++++ rules.mk | 1 + 2 files changed, 6 insertions(+) diff --git a/config.mingw.mk b/config.mingw.mk index 39d3c46..3e1f14b 100644 --- a/config.mingw.mk +++ b/config.mingw.mk @@ -28,6 +28,11 @@ OS_NAME_mingw=windows include $(BUILD)config.gnu.mk +# We need a special treatment of this on Windows +POSTPROCESS_DEPENDENCY= \ + ( sed -e 's/.*://' -e 's/\\$$//' < $@ | \ + sed -e 's/^ *//' -e 's/$$/:/' -e 's/\\\\:$$/:/' >> $@ ) + # Windows overrides for extensions EXE_EXT= .exe LIB_EXT= .lib diff --git a/rules.mk b/rules.mk index 4e8fd71..9bf87dc 100644 --- a/rules.mk +++ b/rules.mk @@ -320,6 +320,7 @@ OBJ_DEPS=$(OBJDIR_DEPS) $(MAKEFILE_DEPS) | hello prebuild # http://scottmcpeak.com/autodepend/autodepend.html POSTPROCESS_DEPENDENCY= \ ( sed -e 's/.*://' -e 's/\\$$//' < $@ | \ + fmt -1 | \ sed -e 's/^ *//' -e 's/$$/:/' >> $@ ) $(OBJDIR)/%.c$(OBJ_EXT).d: %.c $(OBJ_DEPS)