Added skeleton of the client. Does nothing, but at least compiles.
This commit is contained in:
parent
41be4444f2
commit
ed6081502a
7 changed files with 99 additions and 8 deletions
5
client/Makefile
Normal file
5
client/Makefile
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
source=client.c
|
||||||
|
root-rel=../
|
||||||
|
dir-name=client
|
||||||
|
|
||||||
|
include ../Rules
|
16
client/client.c
Normal file
16
client/client.c
Normal file
|
@ -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 */
|
||||||
|
}
|
11
client/client.h
Normal file
11
client/client.h
Normal file
|
@ -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);
|
|
@ -18,3 +18,5 @@ krt-iface.h
|
||||||
krt-set.c
|
krt-set.c
|
||||||
krt-set.h
|
krt-set.h
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
client-main.c
|
||||||
|
|
54
sysdep/unix/client-main.c
Normal file
54
sysdep/unix/client-main.c
Normal file
|
@ -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!");
|
||||||
|
}
|
|
@ -7,17 +7,20 @@ srcdir_abs := $(shell cd $(srcdir) ; pwd)
|
||||||
|
|
||||||
.PHONY: all subdir depend clean distclean tags
|
.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
|
subdir depend: .dir-stamp
|
||||||
set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
|
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
|
$(exedir)/bird: $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
|
||||||
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
|
$(exedir)/birdc: client/all.o lib/birdlib.a
|
||||||
|
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
.dir-stamp:
|
.dir-stamp:
|
||||||
mkdir -p $(static-dirs)
|
mkdir -p $(static-dirs) $(client-dirs)
|
||||||
touch .dir-stamp
|
touch .dir-stamp
|
||||||
|
|
||||||
.dep-stamp:
|
.dep-stamp:
|
||||||
|
@ -25,11 +28,11 @@ $(exedir)/bird: $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
|
||||||
touch .dep-stamp
|
touch .dep-stamp
|
||||||
|
|
||||||
tags:
|
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:
|
clean:
|
||||||
find . -name "*.[oa]" -or -name core -or -name depend | xargs rm -f
|
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
|
distclean: clean
|
||||||
rm -f config.* configure sysdep/autoconf.h Makefile Rules
|
rm -f config.* configure sysdep/autoconf.h Makefile Rules
|
||||||
|
|
|
@ -10,11 +10,11 @@ static-dirs := nest filter $(addprefix proto/,$(protocols))
|
||||||
static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
|
static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
|
||||||
dynamic-dirs := lib conf
|
dynamic-dirs := lib conf
|
||||||
dynamic-dir-paths := $(dynamic-dirs)
|
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
|
clean-dirs:=$(all-dirs) proto sysdep
|
||||||
dir-objs:=$(addprefix $(objdir)/,$(all-dirs))
|
|
||||||
|
|
||||||
CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
|
CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
|
||||||
CFLAGS=$(CPPFLAGS) @CFLAGS@
|
CFLAGS=$(CPPFLAGS) @CFLAGS@
|
||||||
|
|
Loading…
Reference in a new issue