b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Marek Lindner <lindner_marek@yahoo.de>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Marek Lindner <lindner_marek@yahoo.de>
Subject: [B.A.T.M.A.N.] [PATCH 2/2] batctl: make bisect_* a compile time option
Date: Sat, 25 Aug 2012 01:39:17 +0200	[thread overview]
Message-ID: <1345851557-8085-2-git-send-email-lindner_marek@yahoo.de> (raw)
In-Reply-To: <1345851557-8085-1-git-send-email-lindner_marek@yahoo.de>

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 Makefile |   16 +++++++++++++---
 main.c   |    4 ++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index efe57c1..9b2d3ef 100755
--- a/Makefile
+++ b/Makefile
@@ -18,9 +18,14 @@
 # 02110-1301, USA
 #
 
+# changing the CONFIG_* line to 'y' enables the related feature
+# batctl advanced debugging tool bisect:
+export CONFIG_BATCTL_BISECT=n
+
 # batctl build
 BINARY_NAME = batctl
-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_iv.o ioctl.o
+OBJ = main.o bat-hosts.o functions.o sys.o debug.o ping.o traceroute.o tcpdump.o  hash.o vis.o debugfs.o ioctl.o list-batman.o
+OBJ_BISECT = bisect_iv.o
 MANPAGE = man/batctl.8
 
 # batctl flags and options
@@ -38,6 +43,11 @@ endif
 endif
 
 # standard build tools
+ifeq ($(CONFIG_BATCTL_BISECT),y)
+OBJ += $(OBJ_BISECT)
+CFLAGS += -DBATCTL_BISECT
+endif
+
 CC ?= gcc
 RM ?= rm -f
 INSTALL ?= install
@@ -70,7 +80,7 @@ $(BINARY_NAME): $(OBJ)
 	$(LINK.o) $^ $(LDLIBS) -o $@
 
 clean:
-	$(RM) $(BINARY_NAME) $(OBJ) $(DEP)
+	$(RM) $(BINARY_NAME) $(OBJ) $(OBJ_BISECT) $(DEP)
 
 install: $(BINARY_NAME)
 	$(MKDIR) $(DESTDIR)$(SBINDIR)
@@ -79,7 +89,7 @@ install: $(BINARY_NAME)
 	$(INSTALL) -m 0644 $(MANPAGE) $(DESTDIR)$(MANDIR)/man8
 
 # load dependencies
-DEP = $(OBJ:.o=.d)
+DEP = $(OBJ:.o=.d) $(OBJ_BISECT:.o=.d)
 -include $(DEP)
 
 .PHONY: all clean install
diff --git a/main.c b/main.c
index 390736d..01a435b 100644
--- a/main.c
+++ b/main.c
@@ -85,7 +85,9 @@ void print_usage(void)
 	printf(" \tping|p                     <destination>     \tping another batman adv host via layer 2\n");
 	printf(" \ttraceroute|tr              <destination>     \ttraceroute another batman adv host via layer 2\n");
 	printf(" \ttcpdump|td                 <interface>       \ttcpdump layer 2 traffic on the given interface\n");
+#ifdef BATCTL_BISECT
 	printf(" \tbisect_iv                  <file1> .. <fileN>\tanalyze given batman iv log files for routing stability\n");
+#endif
 }
 
 int main(int argc, char **argv)
@@ -172,9 +174,11 @@ int main(int argc, char **argv)
 
 		ret = ioctl_statistics_get(mesh_iface);
 
+#ifdef BATCTL_BISECT
 	} else if ((strcmp(argv[1], "bisect_iv") == 0)) {
 
 		ret = bisect_iv(argc - 1, argv + 1);
+#endif
 
 	} else {
 
-- 
1.7.9.1


  reply	other threads:[~2012-08-24 23:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24 23:39 [B.A.T.M.A.N.] [PATCH 1/2] batctl: rename bisect to bisect_iv Marek Lindner
2012-08-24 23:39 ` Marek Lindner [this message]
2012-08-25  7:48   ` [B.A.T.M.A.N.] [PATCH 2/2] batctl: make bisect_* a compile time option Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345851557-8085-2-git-send-email-lindner_marek@yahoo.de \
    --to=lindner_marek@yahoo.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).