From ee5eaefbd7a82c48cda43b24f518ba8b681e0472 Mon Sep 17 00:00:00 2001 From: Jerome Benoit Date: Tue, 21 Mar 2017 19:08:10 +0100 Subject: [PATCH] BuildSystem: Sync with latest in more exercices Signed-off-by: Jerome Benoit --- TP_11/exo2/Makefile | 17 ++++++++++------- TP_13/exo1/Makefile | 17 ++++++++++------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/TP_11/exo2/Makefile b/TP_11/exo2/Makefile index 8246f9b..383baaa 100644 --- a/TP_11/exo2/Makefile +++ b/TP_11/exo2/Makefile @@ -17,11 +17,11 @@ # # Automatic dependencies code from: # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr -BINARY_NAME=exo2 +BINARY_NAME:=exo2 SRC_PATH:=src -LIBRARY_NAME=libexo2 +LIBRARY_NAME:=libexo2 LIBRARY_PATH:=lib -BUILD_TYPE=debug +BUILD_TYPE:=debug #BUILD_TYPE=release # ==================================== @@ -72,10 +72,11 @@ DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$(notdir $*).Td POSTCOMPILE = mv -f $(DEPDIR)/$(notdir $*).Td $(DEPDIR)/$(notdir $*).d ifeq ($(UNAME),Cygwin) +CYGWIN_DLIBRARY_NAME := $(subst lib,cyg,$(LIBRARY_NAME)) GOLD_SUPPORT = no BINARY_SUFFIX := .exe DLIB_SUFFIX := .dll -CYGWIN_LDLIBS_NOARCHIVE = +CYGWIN_LDLIBS_NOARCHIVE := CYGWIN_LIBLDFLAGS := -Wl,--out-implib=$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a \ -Wl,--export-all-symbols \ -Wl,--enable-auto-import @@ -106,8 +107,8 @@ $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX): $(LIBOBJS) @$(AR) rcs $@ $^ ifeq ($(UNAME),Cygwin) -$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a: $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) -$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX): $(LIBOBJS) +$(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] $@" @$(LD) $(LIBCFLAGS) $(LIBLDFLAGS) $(CYGWIN_LIBLDFLAGS) -Wl,--whole-archive $^ -Wl,--no-whole-archive $(CYGWIN_LDLIBS_NOARCHIVE) -o $@ else @@ -163,9 +164,11 @@ clean: -@rm $(BINARY_NAME).static$(BINARY_SUFFIX) -@rm $(BINARY_NAME).dynamic$(BINARY_SUFFIX) -@rm $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX) - -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) ifeq ($(UNAME),Cygwin) + -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(CYGWIN_DLIBRARY_NAME)$(DLIB_SUFFIX) -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a +else + -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) endif disassemble: $(BINARY_NAME)$(BINARY_SUFFIX) diff --git a/TP_13/exo1/Makefile b/TP_13/exo1/Makefile index 14935a2..56d4989 100644 --- a/TP_13/exo1/Makefile +++ b/TP_13/exo1/Makefile @@ -17,11 +17,11 @@ # # Automatic dependencies code from: # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#tldr -BINARY_NAME=exo1 +BINARY_NAME:=exo1 SRC_PATH:=src -LIBRARY_NAME=libexo1 +LIBRARY_NAME:=libexo1 LIBRARY_PATH:=lib -BUILD_TYPE=debug +BUILD_TYPE:=debug #BUILD_TYPE=release # ==================================== @@ -72,10 +72,11 @@ DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$(notdir $*).Td POSTCOMPILE = mv -f $(DEPDIR)/$(notdir $*).Td $(DEPDIR)/$(notdir $*).d ifeq ($(UNAME),Cygwin) +CYGWIN_DLIBRARY_NAME := $(subst lib,cyg,$(LIBRARY_NAME)) GOLD_SUPPORT = no BINARY_SUFFIX := .exe DLIB_SUFFIX := .dll -CYGWIN_LDLIBS_NOARCHIVE = +CYGWIN_LDLIBS_NOARCHIVE := CYGWIN_LIBLDFLAGS := -Wl,--out-implib=$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a \ -Wl,--export-all-symbols \ -Wl,--enable-auto-import @@ -106,8 +107,8 @@ $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX): $(LIBOBJS) @$(AR) rcs $@ $^ ifeq ($(UNAME),Cygwin) -$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a: $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) -$(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX): $(LIBOBJS) +$(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] $@" @$(LD) $(LIBCFLAGS) $(LIBLDFLAGS) $(CYGWIN_LIBLDFLAGS) -Wl,--whole-archive $^ -Wl,--no-whole-archive $(CYGWIN_LDLIBS_NOARCHIVE) -o $@ else @@ -163,9 +164,11 @@ clean: -@rm $(BINARY_NAME).static$(BINARY_SUFFIX) -@rm $(BINARY_NAME).dynamic$(BINARY_SUFFIX) -@rm $(LIBRARY_PATH)/$(SLIB_PREFIX)$(LIBRARY_NAME)$(SLIB_SUFFIX) - -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) ifeq ($(UNAME),Cygwin) + -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(CYGWIN_DLIBRARY_NAME)$(DLIB_SUFFIX) -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX).a +else + -@rm $(LIBRARY_PATH)/$(DLIB_PREFIX)$(LIBRARY_NAME)$(DLIB_SUFFIX) endif disassemble: $(BINARY_NAME)$(BINARY_SUFFIX) -- 2.34.1