From: Jerome Benoit Date: Sat, 3 Jun 2017 15:11:22 +0000 (+0200) Subject: TP_13: Fix the Cygwin support in the buildsystem X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c9350d147ad498550b6986700978eaf18e9b6451;p=TD_C.git TP_13: Fix the Cygwin support in the buildsystem Signed-off-by: Jerome Benoit --- diff --git a/TP_13/exo2/Makefile b/TP_13/exo2/Makefile index e77c616..d3503c2 100644 --- a/TP_13/exo2/Makefile +++ b/TP_13/exo2/Makefile @@ -73,7 +73,7 @@ $(shell mkdir -p $(DEPDIR)) DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$(notdir $*).Td POSTCOMPILE = mv -f $(DEPDIR)/$(notdir $*).Td $(DEPDIR)/$(notdir $*).d -ifeq ($(filter-out CYGWIN_NT,$(UNAME)),CYGWIN_NT) +ifeq ($(findstring CYGWIN_NT,$(UNAME)),CYGWIN_NT) CYGWIN_DLIBRARY_NAME := $(subst lib,cyg,$(LIBRARY_NAME)) GOLD_SUPPORT = no # Cygwin ncurses do not contain tinfo @@ -124,7 +124,7 @@ $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX): $(LIBOBJS) @echo "[AR StO] $@" @$(AR) rcs $@ $^ -ifeq ($(filter-out CYGWIN_NT,$(UNAME)),CYGWIN_NT) +ifeq ($(findstring CYGWIN_NT,$(UNAME)),CYGWIN_NT) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a: $(LIBRARY_PATH)/$(DLIB_PREFIX)$(CYGWIN_DLIBRARY_NAME)$(DLIB_SUFFIX) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(CYGWIN_DLIBRARY_NAME)$(DLIB_SUFFIX): $(LIBOBJS) @echo "[LD DLL] $@" @@ -147,7 +147,7 @@ $(BINARY_NAME).static$(BINARY_SUFFIX): $(OBJS) $(LIBRARY_PATH)/$(SLIB_PREFIX)$(L @echo "[LD ] $@" @$(LD) $(CFLAGS) $(STATICLIBLDFLAGS) $^ $(LDLIBS) -o $@ -ifeq ($(filter-out CYGWIN_NT,$(UNAME)),CYGWIN_NT) +ifeq ($(findstring CYGWIN_NT,$(UNAME)),CYGWIN_NT) $(BINARY_NAME).dynamic$(BINARY_SUFFIX): $(OBJS) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a else $(BINARY_NAME).dynamic$(BINARY_SUFFIX): $(OBJS) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) @@ -184,7 +184,7 @@ ifneq ($(UNAME),Darwin) endif -@rm $(BINARY_NAME).dynamic$(BINARY_SUFFIX) -@rm $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX) -ifeq ($(filter-out CYGWIN_NT,$(UNAME)),CYGWIN_NT) +ifeq ($(findstring CYGWIN_NT,$(UNAME)),CYGWIN_NT) -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(CYGWIN_DLIBRARY_NAME)$(DLIB_SUFFIX) -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a else