From: Jerome Benoit Date: Mon, 4 Sep 2017 08:20:31 +0000 (+0200) Subject: Makefile: Use a variable for DLL archive targets. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5668eb729c9f8bc27bb6a2120a37a41fd1043761;p=TD_C.git Makefile: Use a variable for DLL archive targets. --- diff --git a/TP_13/exo1/Makefile b/TP_13/exo1/Makefile index f520703..8a257d3 100644 --- a/TP_13/exo1/Makefile +++ b/TP_13/exo1/Makefile @@ -82,7 +82,7 @@ BINARY_SUFFIX := .exe DLIB_SUFFIX := .dll # do not archive external libraries CYGWIN_LDLIBS_NOARCHIVE := $(filter-out -l$(BINARY_NAME),$(LDLIBS)) -CYGWIN_LIBLDFLAGS := -Wl,--out-implib=$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a \ +CYGWIN_LIBLDFLAGS := -Wl,--out-implib=$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX)$(SLIB_SUFFIX) \ -Wl,--export-all-symbols \ -Wl,--enable-auto-import endif @@ -125,7 +125,7 @@ $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX): $(LIBOBJS) @$(AR) rcs $@ $^ 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)$(LIBRARY_NAME)$(DLIB_SUFFIX)$(SLIB_SUFFIX): $(LIBRARY_PATH)/$(DLIB_PREFIX)$(CYGWIN_DLIBRARY_NAME)$(DLIB_SUFFIX) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(CYGWIN_DLIBRARY_NAME)$(DLIB_SUFFIX): $(LIBOBJS) @echo "[LD DLL] $@" @$(LD) $(LIBCFLAGS) $(LIBLDFLAGS) $(CYGWIN_LIBLDFLAGS) -Wl,--whole-archive $^ -Wl,--no-whole-archive $(CYGWIN_LDLIBS_NOARCHIVE) -o $@ @@ -148,7 +148,7 @@ $(BINARY_NAME).static$(BINARY_SUFFIX): $(OBJS) $(LIBRARY_PATH)/$(SLIB_PREFIX)$(L @$(LD) $(CFLAGS) $(STATICLIBLDFLAGS) $^ $(LDLIBS) -o $@ ifeq ($(findstring CYGWIN_NT,$(UNAME)),CYGWIN_NT) -$(BINARY_NAME).dynamic$(BINARY_SUFFIX): $(OBJS) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a +$(BINARY_NAME).dynamic$(BINARY_SUFFIX): $(OBJS) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX)$(SLIB_SUFFIX) else $(BINARY_NAME).dynamic$(BINARY_SUFFIX): $(OBJS) $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) endif @@ -186,7 +186,7 @@ endif -@rm $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX) 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 + -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX)$(SLIB_SUFFIX) else -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) endif