--- /dev/null
+source=client.c
+root-rel=../
+dir-name=client
+
+include ../Rules
--- /dev/null
+/*
+ * 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 */
+}
--- /dev/null
+/*
+ * 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);
krt-set.c
krt-set.h
#endif
+
+client-main.c
--- /dev/null
+/*
+ * 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!");
+}
.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:
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
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@