BuildSystem: Sync with latest in more exercices
authorJerome Benoit <jerome.benoit@sap.com>
Tue, 21 Mar 2017 18:08:10 +0000 (19:08 +0100)
committerJerome Benoit <jerome.benoit@sap.com>
Tue, 21 Mar 2017 18:08:10 +0000 (19:08 +0100)
Signed-off-by: Jerome Benoit <jerome.benoit@sap.com>
TP_11/exo2/Makefile
TP_13/exo1/Makefile

index 8246f9bbbf236949dd6933f0c6702a99922b60c6..383baaa9825a88b513df631c7b9c69767c797a2d 100644 (file)
 #
 # 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)
index 14935a2fd8dc79e9181f3b6f5673762de50e7387..56d4989a6989a76679149132492cd0ae8e7814a7 100644 (file)
 #
 # 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)