# Enable verbose make output with V=1 on the command line
# Copyright (C) 2016 Georgi D. Sotirov <gdsotirov@dir.bg>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
#
diff -urNad xvidcore-1.3.4-orig/build/generic/Makefile xvidcore-1.3.4/build/generic/Makefile
--- xvidcore-1.3.4-orig/build/generic/Makefile	2015-06-21 17:21:32.000000000 +0300
+++ xvidcore-1.3.4/build/generic/Makefile	2016-08-16 22:11:21.000000000 +0300
@@ -45,6 +45,9 @@
 include platform.inc
 endif
 
+AT_0 = @
+AT_1 =
+AT = $(AT_$(V))
 RM = rm -rf
 
 ##############################################################################
@@ -85,7 +88,7 @@
 
 $(BUILD_DIR):
 	@echo "  D: $(BUILD_DIR)"
-	@$(INSTALL) -d $(BUILD_DIR)
+	$(AT)$(INSTALL) -d $(BUILD_DIR)
 
 #-----------------------------------------------------------------------------
 # Generic assembly rule
@@ -93,8 +96,8 @@
 
 .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
 	@echo "  A: $(@D)/$(<F)"
-	@$(INSTALL) -d $(BUILD_DIR)/$(@D)
-	@$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
+	$(AT)$(INSTALL) -d $(BUILD_DIR)/$(@D)
+	$(AT)$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
 
 #-----------------------------------------------------------------------------
 # Generic C rule
@@ -104,8 +107,8 @@
 
 .c.$(OBJECT_EXTENSION):
 	@echo "  C: $(@D)/$(<F)"
-	@$(INSTALL) -d $(BUILD_DIR)/$(@D)
-	@$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
+	$(AT)$(INSTALL) -d $(BUILD_DIR)/$(@D)
+	$(AT)$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
 
 #-----------------------------------------------------------------------------
 # Static Library
@@ -113,7 +116,7 @@
 
 $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
 	@echo "  L: $(@F)"
-	@cd $(BUILD_DIR) && $(AR) rc $(@F) $(OBJECTS) && $(RANLIB) $(@F)
+	$(AT)cd $(BUILD_DIR) && $(AR) rc $(@F) $(OBJECTS) && $(RANLIB) $(@F)
 
 #-----------------------------------------------------------------------------
 # Shared Library
@@ -132,9 +135,9 @@
 
 $(SHARED_LIB): $(BUILD_DIR) $(OBJECTS)
 	@echo "  L: $(@F)"
-	@$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def
-	@$(INSTALL) -m 644 libxvidcore.ld $(BUILD_DIR)/libxvidcore.ld
-	@cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS)
+	$(AT)$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def
+	$(AT)$(INSTALL) -m 644 libxvidcore.ld $(BUILD_DIR)/libxvidcore.ld
+	$(AT)cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS)
 
 #-----------------------------------------------------------------------------
 # Installation
@@ -142,23 +145,23 @@
 
 install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
 	@echo "  D: $(includedir)"
-	@$(INSTALL) -d $(DESTDIR)$(includedir)
+	$(AT)$(INSTALL) -d $(DESTDIR)$(includedir)
 	@echo "  I: $(includedir)/xvid.h"
-	@$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h
+	$(AT)$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h
 	@echo "  D: $(libdir)"
-	@$(INSTALL) -d $(DESTDIR)$(libdir)
+	$(AT)$(INSTALL) -d $(DESTDIR)$(libdir)
 	@echo "  I: $(libdir)/$(STATIC_LIB)"
-	@$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
+	$(AT)$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
 ifeq ($(SHARED_EXTENSION),dll)
 	@echo "  I: $(libdir)/$(SHARED_LIB).a"
-	@$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB).a $(DESTDIR)$(libdir)/$(SHARED_LIB).a
+	$(AT)$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB).a $(DESTDIR)$(libdir)/$(SHARED_LIB).a
 	@echo "  D: $(bindir)"
-	@$(INSTALL) -d $(DESTDIR)$(bindir)
+	$(AT)$(INSTALL) -d $(DESTDIR)$(bindir)
 	@echo "  I: $(bindir)/$(SHARED_LIB)"
-	@$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(bindir)/$(SHARED_LIB)
+	$(AT)$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(bindir)/$(SHARED_LIB)
 else
 	@echo "  I: $(libdir)/$(SHARED_LIB)"
-	@$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
+	$(AT)$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
 	@test -z "$(SO_API_MAJOR_LINK)" || \
 		$(LN_S) $(SHARED_LIB) $(DESTDIR)$(libdir)/$(SO_API_MAJOR_LINK)
 	@test -z "$(SO_LINK)" || \
@@ -185,23 +188,23 @@
 
 clean:
 	@echo "  Cl: Build directory"
-	@$(RM) $(BUILD_DIR)
+	$(AT)$(RM) $(BUILD_DIR)
 
 distclean: clean
 	@echo "  Cl: Generated build files"
-	@$(RM) platform.inc
-	@$(RM) config.log
-	@$(RM) config.status
-	@$(RM) autom4te.cache
+	$(AT)$(RM) platform.inc
+	$(AT)$(RM) config.log
+	$(AT)$(RM) config.status
+	$(AT)$(RM) autom4te.cache
 
 mrproper: distclean
 	@echo "  Cl: Bootstrapped build files"
-	@$(RM) configure
-	@$(RM) install-sh
-	@$(RM) missing
-	@$(RM) config.guess
-	@$(RM) mkinstalldirs
-	@$(RM) config.sub
+	$(AT)$(RM) configure
+	$(AT)$(RM) install-sh
+	$(AT)$(RM) missing
+	$(AT)$(RM) config.guess
+	$(AT)$(RM) mkinstalldirs
+	$(AT)$(RM) config.sub
 
 list-objects:
 	@echo
