[11/14] Make called tools in clean and install configurable

Message ID 1305983442-1607-11-git-send-email-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit 33cf9a758353ede077289b7eece6d8f81926cb25
Headers

Commit Message

Sven Eckelmann May 21, 2011, 1:10 p.m. UTC
  Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
This patch depends on other patches submitted earlier:
 - batmand: Fix FTBFS on second build attempt
 - batmand: Remove obsolete creation of source packages
 - batmand: Remove subversion/svk revision information
 - batmand: Use nproc to get number of available processors

 Makefile |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
  

Patch

diff --git a/Makefile b/Makefile
index a0a7f88..6c77fe7 100755
--- a/Makefile
+++ b/Makefile
@@ -69,6 +69,9 @@  endif
 
 # standard build tools
 CC ?=		gcc
+RM ?= rm -f
+INSTALL ?= install
+MKDIR ?= mkdir -p
 COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
 LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
 
@@ -91,11 +94,11 @@  $(BINARY_NAME): $(OBJ)
 	$(LINK.o) $^ $(LDLIBS) -o $@
 
 clean:
-	rm -f $(BINARY_NAME) $(OBJ) $(DEP)
+	$(RM) $(BINARY_NAME) $(OBJ) $(DEP)
 
 install: $(BINARY_NAME)
-	mkdir -p $(SBINDIR)
-	install -m 0755 $(BINARY_NAME) $(SBINDIR)
+	$(MKDIR) $(SBINDIR)
+	$(INSTALL) -m 0755 $(BINARY_NAME) $(SBINDIR)
 
 # load dependencies
 DEP = $(OBJ:.o=.d)