]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Added skeleton of the client. Does nothing, but at least compiles.
authorMartin Mares <mj@ucw.cz>
Fri, 29 Oct 1999 09:44:44 +0000 (09:44 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 29 Oct 1999 09:44:44 +0000 (09:44 +0000)
client/Makefile [new file with mode: 0644]
client/client.c [new file with mode: 0644]
client/client.h [new file with mode: 0644]
sysdep/unix/Modules
sysdep/unix/client-main.c [new file with mode: 0644]
tools/Makefile.in
tools/Rules.in

diff --git a/client/Makefile b/client/Makefile
new file mode 100644 (file)
index 0000000..0d01724
--- /dev/null
@@ -0,0 +1,5 @@
+source=client.c
+root-rel=../
+dir-name=client
+
+include ../Rules
diff --git a/client/client.c b/client/client.c
new file mode 100644 (file)
index 0000000..ea12c29
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ *     BIRD Client
+ *
+ *     (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ *     Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include "nest/bird.h"
+#include "client/client.h"
+
+int
+main(int argc, char **argv)
+{
+  return client_main(argc, argv);      /* Call sysdep code */
+}
diff --git a/client/client.h b/client/client.h
new file mode 100644 (file)
index 0000000..b5d6ab1
--- /dev/null
@@ -0,0 +1,11 @@
+/*
+ *     BIRD Client
+ *
+ *     (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ *     Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+/* sysdep code */
+
+int client_main(int argc, char **argv);
index 7d403dd9aedd18fe69ae936aa1ec8e4895b704ff..7534a47b42c89f99446f3732398aace30f9a246a 100644 (file)
@@ -18,3 +18,5 @@ krt-iface.h
 krt-set.c
 krt-set.h
 #endif
+
+client-main.c
diff --git a/sysdep/unix/client-main.c b/sysdep/unix/client-main.c
new file mode 100644 (file)
index 0000000..da01e21
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ *     BIRD Client -- Unix Entry Point
+ *
+ *     (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ *     Can be freely distributed and used under the terms of the GNU GPL.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "nest/bird.h"
+#include "client/client.h"
+
+#include "unix.h"
+
+static char *opt_list = "";
+
+static void
+usage(void)
+{
+  fprintf(stderr, "Usage: birdc\n");
+  exit(1);
+}
+
+static void
+parse_args(int argc, char **argv)
+{
+  int c;
+
+  while ((c = getopt(argc, argv, opt_list)) >= 0)
+    switch (c)
+      {
+      default:
+       usage();
+      }
+  if (optind < argc)
+    usage();
+}
+
+int
+client_main(int argc, char **argv)
+{
+#ifdef HAVE_LIBDMALLOC
+  if (!getenv("DMALLOC_OPTIONS"))
+    dmalloc_debug(0x2f03d00);
+#endif
+
+  parse_args(argc, argv);
+
+  bug("Not implemented yet!");
+}
index 1f41e829a78c587f21b982c5c1f30b5c2829b443..337c1b43812adf3a2e4c464c9228a7b3f25112ac 100644 (file)
@@ -7,17 +7,20 @@ srcdir_abs := $(shell cd $(srcdir) ; pwd)
 
 .PHONY: all subdir depend clean distclean tags
 
-all: .dep-stamp subdir $(exedir)/bird
+all: .dep-stamp subdir $(exedir)/bird $(exedir)/birdc
 
 subdir depend: .dir-stamp
        set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
-       set -e ; for a in $(static-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
+       set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
 
 $(exedir)/bird: $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
        $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
 
+$(exedir)/birdc: client/all.o lib/birdlib.a
+       $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
 .dir-stamp:
-       mkdir -p $(static-dirs)
+       mkdir -p $(static-dirs) $(client-dirs)
        touch .dir-stamp
 
 .dep-stamp:
@@ -25,11 +28,11 @@ $(exedir)/bird: $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
        touch .dep-stamp
 
 tags:
-       cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) -name *.[chY]`
+       cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
 
 clean:
        find . -name "*.[oa]" -or -name core -or -name depend | xargs rm -f
-       rm -f $(exedir)/bird .dep-stamp
+       rm -f $(exedir)/bird $(exedir)/birdc .dep-stamp
 
 distclean: clean
        rm -f config.* configure sysdep/autoconf.h Makefile Rules
index 23f171ac239486e2162579bd5cd29f74f968a31e..fc3d2b1a70b3ff7ebae2437dd034620327e19085 100644 (file)
@@ -10,11 +10,11 @@ static-dirs := nest filter $(addprefix proto/,$(protocols))
 static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
 dynamic-dirs := lib conf
 dynamic-dir-paths := $(dynamic-dirs)
-dir-makefiles := $(addsuffix /Makefile,$(static-dir-paths) $(dynamic-dir-paths))
+client-dirs := client
+client-dir-paths := $(client-dirs)
 
-all-dirs:=$(static-dirs) $(dynamic-dirs)
+all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs)
 clean-dirs:=$(all-dirs) proto sysdep
-dir-objs:=$(addprefix $(objdir)/,$(all-dirs))
 
 CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
 CFLAGS=$(CPPFLAGS) @CFLAGS@