[04/14] batctl: Directly specify objects in Makefile

Message ID 1305980898-30494-4-git-send-email-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit a6f3c761b6393692f1ffb0760fc887b404d521a7
Headers

Commit Message

Sven Eckelmann May 21, 2011, 12:28 p.m. UTC
  The information about header and source files aren't needed by the
Makefile. Only the dependencies to headers provide useful information,
but these are automatically included by the generated *.d files.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 Makefile |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)
  

Comments

Marek Lindner May 22, 2011, 9:38 a.m. UTC | #1
On Saturday 21 May 2011 14:28:08 Sven Eckelmann wrote:
> The information about header and source files aren't needed by the
> Makefile. Only the dependencies to headers provide useful information,
> but these are automatically included by the generated *.d files.

Applied in revision a6f3c76.

Thanks,
Marek
  

Patch

diff --git a/Makefile b/Makefile
index cf0b5c5..1bc4879 100644
--- a/Makefile
+++ b/Makefile
@@ -32,12 +32,8 @@  LDFLAGS += -lm
 
 SBINDIR = $(INSTALL_PREFIX)/usr/sbin
 
-EXTRA_MODULES_C := bisect.c
-EXTRA_MODULES_H := bisect.h
-
-SRC_C = main.c bat-hosts.c functions.c sys.c debug.c ping.c traceroute.c tcpdump.c list-batman.c hash.c vis.c debugfs.c $(EXTRA_MODULES_C)
-SRC_H = main.h bat-hosts.h functions.h sys.h debug.h ping.h traceroute.h tcpdump.h list-batman.h hash.h allocate.h vis.h debugfs.h $(EXTRA_MODULES_H)
-SRC_O = $(SRC_C:.c=.o)
+OBJ = main.o bat-hosts.o functions.o sys.o debug.o ping.o traceroute.o tcpdump.o list-batman.o hash.o vis.o debugfs.o bisect.o
+DEP = $(OBJ:.o=.d)
 
 BINARY_NAME = batctl
 
@@ -49,15 +45,15 @@  REVISION_VERSION =\"\ $(REVISION)\"
 
 all: $(BINARY_NAME)
 
-$(BINARY_NAME): $(SRC_O) $(SRC_H) Makefile
-	$(Q_LD)$(CC) -o $@ $(SRC_O) $(LDFLAGS)
+$(BINARY_NAME): $(OBJ) Makefile
+	$(Q_LD)$(CC) -o $@ $(OBJ) $(LDFLAGS)
 
 .c.o:
 	$(Q_CC)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -MD -c $< -o $@
--include $(SRC_C:.c=.d)
+-include $(DEP)
 
 clean:
-	rm -f $(BINARY_NAME) *.o *.d
+	rm -f $(BINARY_NAME) $(OBJ) $(DEP)
 
 install:
 	mkdir -p $(SBINDIR)