]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Build system reworked to one global Makefile with includes and no nesting
authorJan Moskyto Matejka <mq@ucw.cz>
Tue, 12 Apr 2016 09:14:54 +0000 (11:14 +0200)
committerJan Moskyto Matejka <mq@ucw.cz>
Tue, 10 May 2016 12:07:34 +0000 (14:07 +0200)
Also removed the lib-dir merging with sysdep. Updated #include's
accordingly.

Fixed make doc on recent Debian together with moving generated doc into
objdir.

Moved Makefile.in into root dir

Retired all.o and birdlib.a
Linking the final binaries directly from all the .o files.

58 files changed:
Doc
Makefile.in [new file with mode: 0644]
client/Makefile
conf/Makefile
conf/conf.c
conf/conf.h
conf/confbase.Y
configure.in
doc/LinuxDocTools.pm
doc/Makefile
doc/sgml2html
doc/sgml2latex
doc/sgml2txt
filter/Makefile
lib/Doc
lib/Makefile [new file with mode: 0644]
lib/Modules [deleted file]
lib/birdlib.h
lib/ip.h
lib/unaligned.h
nest/Makefile
nest/password.h
nest/protocol.h
nest/route.h
proto/bfd/Makefile
proto/bfd/io.h
proto/bgp/Makefile
proto/ospf/Makefile
proto/ospf/ospf.h
proto/pipe/Makefile
proto/radv/Makefile
proto/radv/radv.h
proto/rip/Makefile
proto/rip/rip.h
proto/static/Makefile
sysdep/bsd/Makefile [new file with mode: 0644]
sysdep/bsd/Modules [deleted file]
sysdep/bsd/krt-sock.c
sysdep/cf/bsd.h
sysdep/cf/linux.h
sysdep/linux/Makefile [new file with mode: 0644]
sysdep/linux/Modules [deleted file]
sysdep/linux/netlink.c
sysdep/unix/Makefile [new file with mode: 0644]
sysdep/unix/Modules [deleted file]
sysdep/unix/config.Y
sysdep/unix/io.c
sysdep/unix/krt.Y
sysdep/unix/krt.c
sysdep/unix/krt.h
sysdep/unix/log.c
sysdep/unix/main.c
sysdep/unix/unix.h
tools/Makefile-top.in [deleted file]
tools/Makefile.in [deleted file]
tools/Rules.in [deleted file]
tools/mergedirs [deleted file]
tools/progdoc

diff --git a/Doc b/Doc
index f5f15087efd7d6925170fce51e5e7851e0636ceb..7706139044119e032a878b86ce25435d4c28862c 100644 (file)
--- a/Doc
+++ b/Doc
@@ -1,3 +1,4 @@
+D doc/prog-head.sgml
 C doc
 C nest
 C conf
@@ -5,3 +6,4 @@ C filter
 C proto
 C sysdep
 C lib
+D doc/prog-foot.sgml
diff --git a/Makefile.in b/Makefile.in
new file mode 100644 (file)
index 0000000..c2f8ad4
--- /dev/null
@@ -0,0 +1,156 @@
+# Makefile for the BIRD Internet Routing Daemon
+# (c) 1999--2000 Martin Mares <mj@ucw.cz>
+# (c) 2016       Jan Moskyto Matejka <mq@ucw.cz>
+
+# Disable build-in rules
+MAKEFLAGS += -r
+
+# Variable definitions
+CPPFLAGS=-I$(objdir) -I$(srcdir) @CPPFLAGS@
+CFLAGS=$(CPPFLAGS) @CFLAGS@
+LDFLAGS=@LDFLAGS@
+LIBS=@LIBS@
+CLIENT_LIBS=@CLIENT_LIBS@
+CC=@CC@
+M4=@M4@
+BISON=@BISON@
+FLEX=@FLEX@
+RANLIB=@RANLIB@
+INSTALL=@INSTALL@
+INSTALL_PROGRAM=@INSTALL_PROGRAM@
+INSTALL_DATA=@INSTALL_DATA@
+
+client=$(addprefix $(exedir)/,@CLIENT@)
+daemon=$(exedir)/bird
+protocols  = @protocols@
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+sbindir=@sbindir@
+sysconfdir=@sysconfdir@
+localstatedir=@localstatedir@
+docdir=@prefix@/doc
+
+srcdir := @srcdir@
+objdir := @objdir@
+exedir := @exedir@
+
+ifeq ($(objdir),.)
+  objdir := $(realpath .)
+endif
+
+ifeq ($(VERBOSE),)
+  Q:=@
+else
+  Q:=
+endif
+
+# Meta rules
+cleangoals := clean distclean
+docgoals := docs userdocs progdocs
+.PHONY: all daemon cli $(cleangoals) $(docgoals) tags
+all: daemon cli
+
+daemon: $(daemon)
+cli: $(client)
+
+# Include directories
+dirs := client conf doc filter lib nest $(addprefix proto/,$(protocols)) @sysdep_dirs@
+
+conf-y-targets := $(addprefix $(objdir)/conf/,cf-parse.y keywords.h commands.h)
+cf-local = $(conf-y-targets): $(s)config.Y
+
+src-o-files = $(patsubst %.c,$(o)%.o,$(src))
+
+all-daemon = $(exedir)/bird: $(obj)
+all-client = $(exedir)/birdc $(exedir)/birdcl: $(obj)
+
+s = $(dir $(lastword $(MAKEFILE_LIST)))
+ifeq ($(srcdir),.)
+  o = $(objdir)/$(s)
+else
+  o = $(patsubst $(srcdir)%,$(objdir)%,$(s))
+endif
+
+define clean_in =
+clean::
+       rm -f $(addprefix $(o),$(1))
+endef
+
+clean = $(eval $(call clean_in,$(1)))
+
+include $(addsuffix /Makefile,$(addprefix $(srcdir)/,$(dirs)))
+
+# Generic rules
+
+$(objdir)/%.o: $(srcdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
+       $(Q)echo CC -o $@ -c $<
+       $(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
+
+$(objdir)/%.o: $(objdir)/%.c $(objdir)/.dir-stamp $(objdir)/sysdep/paths.h
+       $(Q)echo CC -o $@ -c $<
+       $(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
+
+$(objdir)/.dir-stamp:
+       $(Q)echo MKDIR -p $(addprefix $(objdir)/,$(dirs) doc)
+       $(Q)mkdir -p $(addprefix $(objdir)/,$(dirs) doc)
+       $(Q)touch $@
+
+$(client) $(daemon):
+       $(Q)echo LD $(LDFLAGS) -o $@ $^ $(LIBS)
+       $(Q)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+$(objdir)/sysdep/paths.h: Makefile
+       echo  >$@ "/* Generated by Makefile, don't edit manually! */"
+       echo >>$@ "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""
+       echo >>$@ "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
+       if test -n "@iproutedir@" ; then echo >>$@ "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
+
+# Finally include the computed dependencies
+
+ifneq ($(filter-out $(cleangoals),$(MAKECMDGOALS)),)
+-include $(shell find $(objdir) -name "*.d")
+endif
+
+ifeq ($(MAKECMDGOALS),)
+-include $(shell find $(objdir) -name "*.d")
+endif
+
+tags:
+       cd $(srcdir) ; etags -lc `find $(dirs) -name *.[chY]`
+
+# Install
+
+install: all
+       $(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
+       $(INSTALL_PROGRAM) $(exedir)/bird $(DESTDIR)/$(sbindir)/bird
+       $(INSTALL_PROGRAM) $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl
+       if test -n "@CLIENT@" ; then                                                            \
+               $(INSTALL_PROGRAM) $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc ;                \
+       fi
+       if ! test -f $(DESTDIR)/@CONFIG_FILE@ ; then                                            \
+               $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/@CONFIG_FILE@ ;      \
+       else                                                                                    \
+               echo "Not overwriting old bird.conf" ;                                          \
+       fi
+
+install-docs:
+       $(INSTALL) -d $(DESTDIR)/$(docdir)
+       $(INSTALL_DATA) $(objdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
+
+# Cleanup
+clean::
+       rm -f $(objdir)/sysdep/paths.h
+       rm -f $(addprefix $(exedir)/,bird birdc birdcl)
+       find $(objdir) -name "*.[od]" -exec rm -f '{}' '+'
+
+ifeq ($(objdir),obj)
+distclean: clean
+       rm -rf $(objdir)
+       rm -f config.log config.status configure Makefile
+else
+distclean: clean
+       rm -rf * .dir-stamp
+       rm -f config.log config.status configure Makefile
+endif
index a157876678c08907c9eb5a0a1d5f6bb9571e985d..9bdcb81584bd3ad33b516da8994cc072e5aa08ae 100644 (file)
@@ -1,11 +1,11 @@
-source=commands.c util.c client.c
-root-rel=../
-dir-name=client
+src := commands.c util.c client.c
+obj := $(src-o-files)
 
-clients := $(client) birdcl
+$(all-client)
 
-source-dep := $(source) $(addsuffix .c,$(clients))
+$(o)commands.c.dep: $(objdir)/conf/commands.h
 
-subdir: $(addsuffix .o,$(clients))
+$(exedir)/birdc: $(o)birdc.o
+$(exedir)/birdc: LIBS += $(CLIENT_LIBS)
 
-include ../Rules
+$(exedir)/birdcl: $(o)birdcl.o
index 5d729a421210557237111abf669f0175976d61c6..c41218058b4b5b50c1fc328597670af32c7409f1 100644 (file)
@@ -1,31 +1,29 @@
-source=cf-parse.tab.c cf-lex.c conf.c
-root-rel=../
+src := cf-parse.tab.c cf-lex.c conf.c
+obj := $(src-o-files)
 
-include ../Rules
-
-conf-src=$(srcdir)/conf
-conf-fragments=$(conf-src)/confbase.Y @CONFS@ $(addsuffix /config.Y,$(static-dir-paths))
+$(all-daemon)
 
 ifdef DEBUG
 BISON_DEBUG=-t
 #FLEX_DEBUG=-d
 endif
 
-cf-parse.tab.h: cf-parse.tab.c
+$(o)cf-parse.tab.h: $(o)cf-parse.tab.c
 
-cf-parse.tab.c: cf-parse.y
-       $(BISON) -bcf-parse -dv -pcf_ $(BISON_DEBUG) cf-parse.y
+$(o)cf-parse.tab.c: $(o)cf-parse.y
+       echo $< $@ $(o)
+       $(BISON) -b$(@:.tab.c=) -dv -pcf_ $(BISON_DEBUG) $<
 
-cf-parse.y: $(conf-fragments) $(conf-src)/gen_parser.m4
-       $(M4) -P $(conf-src)/gen_parser.m4 $(conf-fragments) >cf-parse.y
+$(conf-y-targets): $(s)confbase.Y
+       $(M4) -P $| $^ >$@
 
-keywords.h: $(conf-fragments) $(conf-src)/gen_keywords.m4
-       $(M4) -P $(conf-src)/gen_keywords.m4 $(conf-fragments) >keywords.h
+$(o)cf-parse.y: | $(s)gen_parser.m4
+$(o)keywords.h: | $(s)gen_keywords.m4
+$(o)commands.h: | $(s)gen_commands.m4 $(srcdir)/client/cmds.m4
 
-commands.h: $(conf-fragments) $(conf-src)/gen_commands.m4 $(srcdir)/client/cmds.m4
-       $(M4) -P $(conf-src)/gen_commands.m4 $(srcdir)/client/cmds.m4 $(conf-fragments) | sort >commands.h
+$(o)cf-lex.c: $(s)cf-lex.l $(o)cf-parse.tab.h $(o)keywords.h $(o)commands.h
+       $(FLEX) $(FLEX_DEBUG) -s -B -8 -o$@ -Pcf_ $<
 
-cf-lex.c: cf-lex.l
-       $(FLEX) $(FLEX_DEBUG) -s -B -8 -ocf-lex.c -Pcf_ cf-lex.l
+$(addprefix $(o),cf-parse.tab.h cf-parse.tab.c cf-parse.y keywords.h commands.h cf-lex.c): $(objdir)/.dir-stamp
 
-depend: keywords.h commands.h cf-parse.tab.c cf-lex.c
+$(call clean,cf-parse.tab.h cf-parse.tab.c cf-parse.y keywords.h commands.h cf-lex.c cf-parse.output)
index 3fd10ad82b6331f976b2817074df6fe21ec04751..8d4d28e38e46616eef68ac4fc62b9025aa463f6e 100644 (file)
@@ -52,7 +52,7 @@
 #include "lib/resource.h"
 #include "lib/string.h"
 #include "lib/event.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 #include "conf/conf.h"
 #include "filter/filter.h"
 
index 8e490c7b4f15ba1a137e05aea2ea6357f5e490d3..03fecd32a024ad7900bd05443ebba065ff58e718 100644 (file)
@@ -10,7 +10,7 @@
 #define _BIRD_CONF_H_
 
 #include "lib/resource.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 
 
 /* Configuration structure */
index 22aee77075d1b477deb2b758834f72e2bbfe34b7..d5fd2133dfe365ec11f1a13de55d6f721d8d9353 100644 (file)
@@ -14,7 +14,7 @@ CF_HDR
 #include "conf/conf.h"
 #include "lib/resource.h"
 #include "lib/socket.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 #include "lib/string.h"
 #include "nest/protocol.h"
 #include "nest/iface.h"
index 1c2c2fe1dae3e17186a164a144056a079bc2afbb..f1697c1217568b13541e8b359fc69d445036b35f 100644 (file)
@@ -23,24 +23,16 @@ AC_ARG_VAR([M4], [location of the M4 program])
 if test "$srcdir" = . ; then
        # Building in current directory => create obj directory holding all objects
        objdir=obj
-       mkdir -p obj
-       srcdir_rel=..
-       makefiles="Makefile:tools/Makefile-top.in obj/Makefile:tools/Makefile.in obj/Rules:tools/Rules.in"
-       exedir=..
 else
        # Building in separate directory
        objdir=.
-       srcdir_rel=$srcdir
-       makefiles="Makefile:tools/Makefile.in Rules:tools/Rules.in"
-       exedir=.
 fi
-case $srcdir_rel in
-       /*)     srcdir_rel_mf=$srcdir_rel ;;
-       *)      srcdir_rel_mf="\$(root-rel)$srcdir_rel" ;;
-esac
+
+exedir=.
+
 AC_SUBST(objdir)
 AC_SUBST(exedir)
-AC_SUBST(srcdir_rel_mf)
+AC_SUBST(srcdir)
 AC_SUBST(runtimedir)
 
 
@@ -162,7 +154,7 @@ sysname=`echo $sysdesc | sed 's/\.h$//'`
 AC_DEFINE_UNQUOTED(SYSCONF_INCLUDE, "$sysdesc")
 
 AC_MSG_CHECKING([system-dependent directories])
-sysdep_dirs="`sed <$sysdesc '/^Link: /!d;s/^Link: \(.*\)$/\1/' | tr '\012' ' '` lib"
+sysdep_dirs="`sed <$sysdesc '/^Link: /!d;s/^Link: \(.*\)$/\1/' | tr '\012' ' '`"
 AC_MSG_RESULT($sysdep_dirs)
 AC_SUBST(sysdep_dirs)
 
@@ -234,10 +226,10 @@ if test "$enable_debug" = yes ; then
        fi
 fi
 
-CLIENT=
+CLIENT=birdcl
 CLIENT_LIBS=
 if test "$enable_client" = yes ; then
-       CLIENT=birdc
+       CLIENT="$CLIENT birdc"
        AC_CHECK_LIB(history, add_history, CLIENT_LIBS="-lhistory")
        AC_CHECK_LIB(ncurses, tgetent, USE_TERMCAP_LIB=-lncurses,
                AC_CHECK_LIB(curses, tgetent, USE_TERMCAP_LIB=-lcurses,
@@ -255,17 +247,9 @@ AC_SUBST(CLIENT_LIBS)
 
 mkdir -p $objdir/sysdep
 AC_CONFIG_HEADERS([$objdir/sysdep/autoconf.h:sysdep/autoconf.h.in])
-AC_CONFIG_COMMANDS([merge],[[export CPP="$CPP"
-$srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs]],
-       [[srcdir=$srcdir]
-       [srcdir_rel=$srcdir_rel]
-       [objdir=$objdir]
-       [sysdep_dirs="$sysdep_dirs"]])
-AC_CONFIG_FILES($makefiles)
+AC_CONFIG_FILES(Makefile:Makefile.in)
 AC_OUTPUT
 
-rm -f $objdir/sysdep/paths.h
-
 cat >&AC_FD_MSG <<EOF
 
 BIRD was configured with the following options:
index 51d4a04cd2936671a465a60102b6f29aa74b8cdb..39bb401deb0df3c8213eaa89d4036e917f66af15 100644 (file)
@@ -372,6 +372,8 @@ sub process_file
         }
     }
   #
+
+  local $ENV{PATH} = "$ENV{PATH}:/usr/lib/linuxdoc-tools";
   my($precmd) = "|sgmlpre output=$global->{format} $global->{define}";
 
   #
index f88c3205207706c5d06331370970cccea7a8acc1..3ff733894728e63763fbc1b286c9893e21d548d5 100644 (file)
@@ -1,46 +1,48 @@
-root-rel=../
-dir-name=doc
-
-ifneq ($(wildcard ../Rules),)
-include ../Rules
-else
-srcdir=$(shell cd $(root-rel) ; pwd)
-srcdir_abs=$(srcdir)
-endif
-
 # Force rebuilds
-.PHONY: prog.sgml bird.sgml
+.PHONY: progspell docs progdocs userdocs
+
+doc-srcdir := $(shell cd $(s) && pwd)
+sgml2 := $(doc-srcdir)/sgml2
 
 docs: progdocs userdocs
-progdocs: prog.html prog.ps
-userdocs: bird.html bird.ps
 
-prog.sgml:
-       $(srcdir)/tools/progdoc $(srcdir_abs)
+doc-fmt = $(1): $(o)prog.$(1) $(o)bird.$(1)
+$(call doc-fmt,html)
+$(call doc-fmt,dvi)
+$(call doc-fmt,ps)
+$(call doc-fmt,pdf)
+
+progdocs: $(o)prog.html $(o)prog.pdf
+userdocs: $(o)bird.html $(o)bird.pdf
+progspell: $(o)prog.spell
+
+$(o)prog.sgml: $(srcdir)/tools/progdoc $(objdir)/.dir-stamp
+       $(srcdir)/tools/progdoc $(srcdir) $@
+
+$(o)%.sgml: $(s)%.sgml $(objdir)/.dir-stamp
+       cp $< $@
 
-%.html: %.sgml
-       ./sgml2html $<
+$(o)%.html: $(o)%.sgml
+       cd $(dir $@) && $(sgml2)html $(notdir $<)
 
-%.dvi: %.tex
-       latex $<
-       latex $<
+$(o)%.dvi: $(o)%.tex
+       cd $(dir $@) && TEXINPUTS=$(TEXINPUTS):$(doc-srcdir)/tex latex $(notdir $<)
+       cd $(dir $@) && TEXINPUTS=$(TEXINPUTS):$(doc-srcdir)/tex latex $(notdir $<)
 
-%.ps: %.dvi
+$(o)%.ps: $(o)%.dvi
        dvips -D600 -ta4 -o $@ $<
 
-%.tex: %.sgml
-       ./sgml2latex --output=tex $<
+$(o)%.pdf: $(o)%.ps
+       ps2pdf $< $@
 
-%.txt: %.sgml
-       ./sgml2txt $<
+$(o)%.tex: $(o)%.sgml
+       cd $(dir $@) && $(sgml2)latex --output=tex $(notdir $<)
 
-progspell: prog.sgml
-       sed -f prog-spell.sed <prog.sgml >prog.spell
-       ispell prog.spell
+$(o)%.txt: $(o)%.sgml
+       cd $(dir $@) && $(sgml2)txt $(notdir $<)
 
-clean:
-       rm -f *.tex *.dvi *.log *.txt *.aux *.toc *.spell
-       rm -f prog.sgml
+$(o)prog.spell: $(o)prog.sgml $(s)prog-spell.sed
+       sed -f $(lastword $^) <$< >$@
+       ispell $@
 
-distclean: clean
-       rm -f *.html *.ps
+$(call clean,prog.spell $(addprefix *.,html dvi ps pdf sgml tex txt aux log toc))
index 774a03d54ec21c77c21ef8972ca36c148e3c63f6..a5bbee9eb8abd0c8747808a13f8207665765d33d 100755 (executable)
@@ -17,8 +17,10 @@ use strict;
 
 use vars qw($prefix $DataDir $BinDir $progs);
 
+use FindBin;
+
 $prefix = "/usr";
-$DataDir = "sbase";
+$DataDir = "$FindBin::Bin/sbase";
 $BinDir = "/usr/bin";
 
 use lib "/usr/share/linuxdoc-tools";
@@ -32,9 +34,9 @@ $progs = {
   "GROFFMACRO" => "-ms",
   "AWK" => "/usr/share/linuxdoc-tools/awkwhich"
 };
-$ENV{"SGML_CATALOG_FILES"} = "sbase/dtd/catalog";
+$ENV{"SGML_CATALOG_FILES"} = "$DataDir/dtd/catalog";
 
-require "./LinuxDocTools.pm";
+require "$FindBin::Bin/LinuxDocTools.pm";
 &LinuxDocTools::init;
 
 my @FileList = LinuxDocTools::process_options ("html", @ARGV);
index 27aae4c8dcf4ccafc99d94aec90425e3047a0ea4..02b60d9439d898ab4e949e617238ca20cfc9df31 100755 (executable)
@@ -17,8 +17,10 @@ use strict;
 
 use vars qw($prefix $DataDir $BinDir $progs);
 
+use FindBin;
+
 $prefix = "/usr";
-$DataDir = "sbase";
+$DataDir = "$FindBin::Bin/sbase";
 $BinDir = "/usr/bin";
 
 use lib "/usr/share/linuxdoc-tools";
@@ -32,9 +34,9 @@ $progs = {
   "GROFFMACRO" => "-ms",
   "AWK" => "/usr/share/linuxdoc-tools/awkwhich"
 };
-$ENV{"SGML_CATALOG_FILES"} = "sbase/dtd/catalog";
+$ENV{"SGML_CATALOG_FILES"} = "$DataDir/dtd/catalog";
 
-require "./LinuxDocTools.pm";
+require "$FindBin::Bin/LinuxDocTools.pm";
 &LinuxDocTools::init;
 
 my @FileList = LinuxDocTools::process_options ("latex", @ARGV);
index 90dc4855686909ab7e2946ba7f94800cde584a1f..dfc017ded1d39ac6681a75da1c1603352ee62279 100755 (executable)
@@ -17,8 +17,10 @@ use strict;
 
 use vars qw($prefix $DataDir $BinDir $progs);
 
+use FindBin;
+
 $prefix = "/usr";
-$DataDir = "sbase";
+$DataDir = "$FindBin::Bin/sbase";
 $BinDir = "/usr/bin";
 
 use lib "/usr/share/linuxdoc-tools";
@@ -32,9 +34,9 @@ $progs = {
   "GROFFMACRO" => "-ms",
   "AWK" => "/usr/share/linuxdoc-tools/awkwhich"
 };
-$ENV{"SGML_CATALOG_FILES"} = "sbase/dtd/catalog";
+$ENV{"SGML_CATALOG_FILES"} = "$DataDir/dtd/catalog";
 
-require "./LinuxDocTools.pm";
+require "$FindBin::Bin/LinuxDocTools.pm";
 &LinuxDocTools::init;
 
 my @FileList = LinuxDocTools::process_options ("txt", @ARGV);
index 2de598dae232a43f654a43ea5726e702b1aa63b7..f27befdf85528ac3da064c57992f7371864954bf 100644 (file)
@@ -1,5 +1,4 @@
-source=f-util.c filter.c tree.c trie.c
-root-rel=../
-dir-name=filter
-
-include ../Rules
+src := filter.c f-util.c tree.c trie.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/lib/Doc b/lib/Doc
index 8f5138215cd2b221bdec16f3d90a4b4cf892ebbb..8af1c6699363f2ac033a3795aeb3f6a63f0a798b 100644 (file)
--- a/lib/Doc
+++ b/lib/Doc
@@ -1,5 +1,5 @@
 H Library functions
-S ip.c ipv4.c ipv6.c
+S ip.c
 S lists.c
 S checksum.c bitops.c patmatch.c printf.c xmalloc.c tbf.c
 D resource.sgml
diff --git a/lib/Makefile b/lib/Makefile
new file mode 100644 (file)
index 0000000..a9aae66
--- /dev/null
@@ -0,0 +1,7 @@
+src := bitops.c checksum.c ip.c lists.c md5.c net.c patmatch.c printf.c sha1.c sha256.c sha512.c slists.c xmalloc.c
+obj := $(src-o-files)
+$(all-client)
+
+src := bitops.c checksum.c event.c idm.c ip.c lists.c md5.c mempool.c net.c patmatch.c printf.c resource.c sha1.c sha256.c sha512.c slab.c slists.c tbf.c xmalloc.c
+obj := $(src-o-files)
+$(all-daemon)
diff --git a/lib/Modules b/lib/Modules
deleted file mode 100644 (file)
index 6b9b4b0..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-sha256.c
-sha256.h
-sha512.c
-sha512.h
-sha1.c
-sha1.h
-birdlib.h
-bitops.c
-bitops.h
-idm.c
-idm.h
-ip.c
-ip.h
-lists.c
-lists.h
-md5.c
-md5.h
-mempool.c
-resource.c
-resource.h
-slab.c
-socket.h
-tbf.c
-unaligned.h
-xmalloc.c
-printf.c
-string.h
-patmatch.c
-slists.c
-slists.h
-event.c
-event.h
-checksum.c
-checksum.h
-alloca.h
-net.c
index ece50dc253051100d525894f841e4b2bf73cfb8b..78df81d68b1a98efdb3063be38793e5f4033e73b 100644 (file)
@@ -9,8 +9,8 @@
 #ifndef _BIRD_BIRDLIB_H_
 #define _BIRD_BIRDLIB_H_
 
-#include "timer.h"
-#include "alloca.h"
+#include "sysdep/unix/timer.h"
+#include "lib/alloca.h"
 
 /* Ugly structure offset handling macros */
 
index 3191e307344bf070296d4db35b7f4e5018dada25..ffc1b23276449f5354bee7a804edacbae64308d6 100644 (file)
--- a/lib/ip.h
+++ b/lib/ip.h
@@ -9,7 +9,7 @@
 #ifndef _BIRD_IP_H_
 #define _BIRD_IP_H_
 
-#include "lib/endian.h"
+#include "sysdep/unix/endian.h"
 #include "lib/string.h"
 #include "lib/bitops.h"
 #include "lib/unaligned.h"
index 130b247914b93db0800d2fc0e93951b9632526df..ad5811ab565a994092bff7aab9e4027b9b9890d0 100644 (file)
@@ -17,7 +17,7 @@
  *  if possible.
  */
 
-#include "lib/endian.h"
+#include "sysdep/unix/endian.h"
 #include "lib/string.h"
 
 static inline u16
index 478a82b78bd7f1982ed263b698fa9f07c34a817c..6f0f9a08f88554242f64baa8453732a8da0b5576 100644 (file)
@@ -1,6 +1,4 @@
-source=rt-table.c rt-fib.c rt-attr.c proto.c iface.c rt-dev.c password.c cli.c locks.c cmds.c neighbor.c \
-       a-path.c a-set.c
-root-rel=../
-dir-name=nest
-
-include ../Rules
+src := a-path.c a-set.c cli.c cmds.c iface.c locks.c neighbor.c password.c proto.c rt-attr.c rt-dev.c rt-fib.c rt-table.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
index 1d9de53cb9a55e41a7936e52457792ff32893175..cbf80b99ae8d4db1c527fdcd059158f9cc7f76f8 100644 (file)
@@ -9,7 +9,7 @@
 
 #ifndef PASSWORD_H
 #define PASSWORD_H
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 
 struct password_item {
   node n;
index 19f5d0701edd96641e3a5add6880276acb6c36d0..61919a54fbcaf50ee962dbc741ef97c7b73751df 100644 (file)
@@ -12,7 +12,7 @@
 #include "lib/lists.h"
 #include "lib/resource.h"
 #include "lib/event.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 #include "nest/route.h"
 #include "conf/conf.h"
 
index 22fca331754f5e889a3d47ac337a0eb9d69a34d8..a893841fb12509c027d3f8da1fdf1aee356c5508 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "lib/lists.h"
 #include "lib/resource.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 //#include "nest/protocol.h"
 
 struct ea_list;
index c28cedec772388cd8e965f002250f97a943509af..489216d8ef3b6d0fa54940e775f5ee13e010c32a 100644 (file)
@@ -1,5 +1,4 @@
-source=bfd.c packets.c io.c
-root-rel=../../
-dir-name=proto/bfd
-
-include ../../Rules
+src := bfd.c io.c packets.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
index 641ee054227d3906443cf52bccf4c82778598007..45836f84adc024aa294435343f93900b3df1f403 100644 (file)
@@ -12,7 +12,7 @@
 #include "lib/resource.h"
 #include "lib/event.h"
 #include "lib/socket.h"
-// #include "lib/timer.h"
+// #include "sysdep/unix/timer.h"
 
 
 typedef struct timer2
index a634cf0de166a080243475fe828a7dc7098c38ef..f49588679aaf44ed44cd6bd9687cb1f8f7170f9f 100644 (file)
@@ -1,5 +1,4 @@
-source=bgp.c attrs.c packets.c
-root-rel=../../
-dir-name=proto/bgp
-
-include ../../Rules
+src := attrs.c bgp.c packets.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
index f90222cfddc5bcb3590b4f606e5d1c65b270cd0d..fe52ed301200bf07525cfbdfbcd25109b5adff3c 100644 (file)
@@ -1,5 +1,4 @@
-source=ospf.c topology.c packet.c hello.c neighbor.c iface.c dbdes.c lsreq.c lsupd.c lsack.c lsalib.c rt.c
-root-rel=../../
-dir-name=proto/ospf
-
-include ../../Rules
+src := dbdes.c hello.c iface.c lsack.c lsalib.c lsreq.c lsupd.c neighbor.c ospf.c packet.c rt.c topology.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
index 3d70df7b63cf34b6a343b107b86d1b21833a6ca7..4f445f07618c307eb59b9f385e1ab2d1c3f95ab5 100644 (file)
@@ -18,7 +18,7 @@
 #include "lib/lists.h"
 #include "lib/slists.h"
 #include "lib/socket.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 #include "lib/resource.h"
 #include "nest/protocol.h"
 #include "nest/iface.h"
index 77de5b88b9bbf2ce429d66af4da4fc32b59b4efa..c258a3e5baadcc9882393eef8494b1bd8b03c87a 100644 (file)
@@ -1,6 +1,4 @@
-source=pipe.c
-root-rel=../../
-dir-name=proto/pipe
-
-include ../../Rules
-
+src := pipe.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
index efc4d4af79d5ab169621c8dcf905996dc9172c69..3584a5f30dd81440ffacf946caac3a1a422a366f 100644 (file)
@@ -1,5 +1,4 @@
-source=radv.c packets.c
-root-rel=../../
-dir-name=proto/radv
-
-include ../../Rules
+src := packets.c radv.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
index f8aa421d788a07ac6411fb3e2b1889a3e525b878..735aa218c9cf9c39cb1850b9544eb090fdb53d4a 100644 (file)
@@ -13,7 +13,7 @@
 #include "lib/ip.h"
 #include "lib/lists.h"
 #include "lib/socket.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 #include "lib/resource.h"
 #include "nest/protocol.h"
 #include "nest/iface.h"
index d2d3c987252ea0ae46a22675bd2028bb8a8bf69c..6e645cc2fe8424f88c028b7ec3dabf10e3c1e3d7 100644 (file)
@@ -1,5 +1,4 @@
-source=rip.c packets.c
-root-rel=../../
-dir-name=proto/rip
-
-include ../../Rules
+src := packets.c rip.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
index d1c9933c1b00657f23a8b7ebd8f17ebc389e94ac..7ec7e24d746b1f059513d5dbb3724e50ed28c406 100644 (file)
@@ -24,7 +24,7 @@
 #include "lib/resource.h"
 #include "lib/socket.h"
 #include "lib/string.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 
 
 #define RIP_V1                 1
index 61fadbea33d4bdab464788785b4071126f2118a9..3ace39cf3c03a882c76e267102b2ff2547a8c02b 100644 (file)
@@ -1,6 +1,4 @@
-source=static.c
-root-rel=../../
-dir-name=proto/static
-
-include ../../Rules
-
+src := static.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
diff --git a/sysdep/bsd/Makefile b/sysdep/bsd/Makefile
new file mode 100644 (file)
index 0000000..ddc8723
--- /dev/null
@@ -0,0 +1,5 @@
+src := krt-sock.c
+obj := $(src-o-files)
+$(all-daemon)
+$(conf-y-targets): $(s)krt-sock.Y
+
diff --git a/sysdep/bsd/Modules b/sysdep/bsd/Modules
deleted file mode 100644 (file)
index 96455db..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-krt-sock.c
-krt-sock.Y
-krt-sys.h
-sysio.h
index 5f2f130913fc905490d01117bafa6d82d5a8ad11..c64568387631a0ae64070d70fffb66f69e281901 100644 (file)
@@ -28,9 +28,9 @@
 #include "nest/route.h"
 #include "nest/protocol.h"
 #include "nest/iface.h"
-#include "lib/timer.h"
-#include "lib/unix.h"
-#include "lib/krt.h"
+#include "sysdep/unix/timer.h"
+#include "sysdep/unix/unix.h"
+#include "sysdep/unix/krt.h"
 #include "lib/string.h"
 #include "lib/socket.h"
 
index 51beb42bd22b576746632851ddfae51497ccaac8..22c54277283be1fd113d3564622b7703e55a0bbf 100644 (file)
@@ -15,6 +15,9 @@
 #define CONFIG_NO_IFACE_BIND
 #define CONFIG_USE_HDRINCL
 
+#define CONFIG_INCLUDE_SYSIO_H "sysdep/bsd/sysio.h"
+#define CONFIG_INCLUDE_KRTSYS_H "sysdep/bsd/krt-sys.h"
+
 /*
 Link: sysdep/unix
 Link: sysdep/bsd
index 9e34f869f339f8bb2da4f3e6ba21340bb77382a2..cec9499c49513b2bbd7c22d2c46c64a9e01526af 100644 (file)
 #define CONFIG_MC_PROPER_SRC
 #define CONFIG_UNIX_DONTROUTE
 
+#define CONFIG_INCLUDE_SYSIO_H "sysdep/linux/sysio.h"
+#define CONFIG_INCLUDE_KRTSYS_H "sysdep/linux/krt-sys.h"
+
 #define CONFIG_RESTRICTED_PRIVILEGES
+#define CONFIG_INCLUDE_SYSPRIV_H "sysdep/linux/syspriv.h"
+
 
 /*
 Link: sysdep/linux
diff --git a/sysdep/linux/Makefile b/sysdep/linux/Makefile
new file mode 100644 (file)
index 0000000..23cf1d9
--- /dev/null
@@ -0,0 +1,4 @@
+src := netlink.c
+obj := $(src-o-files)
+$(all-daemon)
+$(conf-y-targets): $(s)netlink.Y
diff --git a/sysdep/linux/Modules b/sysdep/linux/Modules
deleted file mode 100644 (file)
index 940660b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-krt-sys.h
-netlink.c
-netlink.Y
-sysio.h
-syspriv.h
index 6240c177c4fb5e7b2e73df2a423126117d5694de..6cf404847162a5f0b003c854be4be8ba94b12cff 100644 (file)
@@ -20,9 +20,9 @@
 #include "nest/protocol.h"
 #include "nest/iface.h"
 #include "lib/alloca.h"
-#include "lib/timer.h"
-#include "lib/unix.h"
-#include "lib/krt.h"
+#include "sysdep/unix/timer.h"
+#include "sysdep/unix/unix.h"
+#include "sysdep/unix/krt.h"
 #include "lib/socket.h"
 #include "lib/string.h"
 #include "lib/hash.h"
diff --git a/sysdep/unix/Makefile b/sysdep/unix/Makefile
new file mode 100644 (file)
index 0000000..c5d5543
--- /dev/null
@@ -0,0 +1,5 @@
+src := io.c krt.c log.c main.c random.c
+obj := $(src-o-files)
+$(all-daemon)
+$(cf-local)
+$(conf-y-targets): $(s)krt.Y
diff --git a/sysdep/unix/Modules b/sysdep/unix/Modules
deleted file mode 100644 (file)
index 2c6514d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-log.c
-main.c
-timer.h
-io.c
-unix.h
-endian.h
-config.Y
-random.c
-
-krt.c
-krt.h
-krt.Y
index f9a92900ae81479d2c4c3d81b0cea31e3a779ef8..ebadd4546585b4798997bb0e1e076c920490a515 100644 (file)
@@ -8,7 +8,7 @@
 
 CF_HDR
 
-#include "lib/unix.h"
+#include "sysdep/unix/unix.h"
 #include <stdio.h>
 
 CF_DECLS
index cbfb47d5ddeda324be103812212ee81a1ad9234a..afa51be7d63409187652d0bb18ac836c97e6f07a 100644 (file)
 #include "nest/bird.h"
 #include "lib/lists.h"
 #include "lib/resource.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 #include "lib/socket.h"
 #include "lib/event.h"
 #include "lib/string.h"
 #include "nest/iface.h"
 
-#include "lib/unix.h"
-#include "lib/sysio.h"
+#include "sysdep/unix/unix.h"
+#include CONFIG_INCLUDE_SYSIO_H
 
 /* Maximum number of calls of tx handler for one socket in one
  * select iteration. Should be small enough to not monopolize CPU by
index 1cd73502eee99cade5e414476ccb199b517c5057..91317d97fffbb832d1d17ebfe632494944d454c8 100644 (file)
@@ -8,7 +8,7 @@
 
 CF_HDR
 
-#include "lib/krt.h"
+#include "sysdep/unix/krt.h"
 
 CF_DEFINES
 
index 6b3b4eee004b735c2fbff4ba3f309d15ccc73ac2..38f312352ec692012e5a6a7c317e30191ee8b2c3 100644 (file)
@@ -56,7 +56,7 @@
 #include "nest/route.h"
 #include "nest/protocol.h"
 #include "filter/filter.h"
-#include "lib/timer.h"
+#include "sysdep/unix/timer.h"
 #include "conf/conf.h"
 #include "lib/string.h"
 
index e968ad570314942d0d889475bde038b64ed7d040..cb404de370ce09f664d0b83c024fbd8c140331b4 100644 (file)
@@ -15,7 +15,8 @@ struct krt_proto;
 struct kif_config;
 struct kif_proto;
 
-#include "lib/krt-sys.h"
+#include "sysdep/config.h"
+#include CONFIG_INCLUDE_KRTSYS_H
 
 /* Flags stored in net->n.flags, rest are in nest/route.h */
 
@@ -111,7 +112,7 @@ struct kif_proto {
   struct kif_state sys;                /* Sysdep state */
 };
 
-struct kif_proto *kif_proto;
+extern struct kif_proto *kif_proto;
 
 #define KIF_CF ((struct kif_config *)p->p.cf)
 
index 7cb26360a520e0a587e123526112bbfe059329d1..8daff0341eed4d5296839a03c75bdaca4bfb9980 100644 (file)
@@ -26,7 +26,7 @@
 #include "nest/mrtdump.h"
 #include "lib/string.h"
 #include "lib/lists.h"
-#include "lib/unix.h"
+#include "sysdep/unix/unix.h"
 
 static FILE *dbgf;
 static list *current_log_list;
index 8796ab9c380bae170405d06373dcbeb454f68a16..14b3b2f66128ab79f236c8c07a730a860d7c3732 100644 (file)
@@ -69,7 +69,7 @@ async_dump(void)
  */
 
 #ifdef CONFIG_RESTRICTED_PRIVILEGES
-#include "lib/syspriv.h"
+#include CONFIG_INCLUDE_SYSPRIV_H
 #else
 
 static inline void
@@ -567,6 +567,10 @@ sysdep_shutdown_done(void)
  *     Signals
  */
 
+volatile int async_config_flag;
+volatile int async_dump_flag;
+volatile int async_shutdown_flag;
+
 static void
 handle_sighup(int sig UNUSED)
 {
index 414b6ca4f24dafee49150283af829c430fbee320..80c993504fed8ab55c3d97988248cb56665d27d8 100644 (file)
@@ -91,9 +91,9 @@ int sockaddr_read(sockaddr *sa, int af, ip_addr *a, struct iface **ifa, uint *po
 #define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) + strlen ((ptr)->sun_path))
 #endif
 
-volatile int async_config_flag;
-volatile int async_dump_flag;
-volatile int async_shutdown_flag;
+extern volatile int async_config_flag;
+extern volatile int async_dump_flag;
+extern volatile int async_shutdown_flag;
 
 void io_init(void);
 void io_loop(void);
diff --git a/tools/Makefile-top.in b/tools/Makefile-top.in
deleted file mode 100644 (file)
index cf59f7a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# Makefile for in place build of BIRD
-# (c) 1999--2000 Martin Mares <mj@ucw.cz>
-
-objdir=@objdir@
-
-all depend tags install install-docs:
-       $(MAKE) -C $(objdir) $@
-
-docs userdocs progdocs:
-       $(MAKE) -C doc $@
-
-clean:
-       $(MAKE) -C $(objdir) clean
-       find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name depend -or -name ".#*" | xargs rm -f
-
-distclean: clean
-       $(MAKE) -C doc distclean
-       rm -rf $(objdir) autom4te.cache
-       rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile
-
diff --git a/tools/Makefile.in b/tools/Makefile.in
deleted file mode 100644 (file)
index 5de323a..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-# Makefile for the BIRD Internet Routing Daemon
-# (c) 1999--2000 Martin Mares <mj@ucw.cz>
-
-include Rules
-
-.PHONY: all daemon birdc birdcl subdir depend clean distclean tags docs userdocs progdocs
-
-all: sysdep/paths.h .dep-stamp subdir daemon birdcl @CLIENT@
-
-daemon: $(exedir)/bird
-
-birdc: $(exedir)/birdc
-
-birdcl: $(exedir)/birdcl
-
-bird-dep := $(addsuffix /all.o, $(static-dirs)) conf/all.o lib/birdlib.a
-
-$(bird-dep): sysdep/paths.h .dep-stamp subdir
-
-birdc-dep := client/birdc.o client/all.o lib/birdlib.a
-
-$(birdc-dep): sysdep/paths.h .dep-stamp subdir
-
-birdcl-dep := client/birdcl.o client/all.o lib/birdlib.a
-
-$(birdcl-dep): sysdep/paths.h .dep-stamp subdir
-
-
-export client := @CLIENT@
-
-depend: sysdep/paths.h .dir-stamp
-       set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
-       set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
-
-subdir: sysdep/paths.h .dir-stamp .dep-stamp
-       set -e ; for a in $(dynamic-dirs) ; do $(MAKE) -C $$a $@ ; done
-       set -e ; for a in $(static-dirs) $(client-dirs) ; do $(MAKE) -C $$a -f $(srcdir_abs)/$$a/Makefile $@ ; done
-
-$(exedir)/bird: $(bird-dep)
-       @echo LD $(LDFLAGS) -o $@ $^ $(LIBS)
-       @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-
-$(exedir)/birdc: $(birdc-dep)
-       @echo LD $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
-       @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(CLIENT_LIBS)
-
-$(exedir)/birdcl: $(birdcl-dep)
-       @echo LD $(LDFLAGS) -o $@ $^ $(LIBS)
-       @$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-
-.dir-stamp: sysdep/paths.h
-       mkdir -p $(static-dirs) $(client-dirs) $(doc-dirs)
-       touch .dir-stamp
-
-.dep-stamp:
-       $(MAKE) depend
-       touch .dep-stamp
-
-docs: userdocs progdocs
-
-userdocs progdocs: .dir-stamp
-       $(MAKE) -C doc -f $(srcdir_abs)/doc/Makefile $@
-
-sysdep/paths.h:
-       echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
-       echo >>sysdep/paths.h "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""
-       echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
-       if test -n "@iproutedir@" ; then echo >>sysdep/paths.h "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
-
-tags:
-       cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
-
-install: all
-       $(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
-       $(INSTALL_PROGRAM) $(exedir)/bird $(DESTDIR)/$(sbindir)/bird
-       $(INSTALL_PROGRAM) $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl
-       if test -n "@CLIENT@" ; then                                                            \
-               $(INSTALL_PROGRAM) $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc ;                \
-       fi
-       if ! test -f $(DESTDIR)/@CONFIG_FILE@ ; then                                            \
-               $(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/@CONFIG_FILE@ ;      \
-       else                                                                                    \
-               echo "Not overwriting old bird.conf" ;                                          \
-       fi
-
-install-docs:
-       $(INSTALL) -d $(DESTDIR)/$(docdir)
-       $(INSTALL_DATA) $(srcdir)/doc/{bird,prog}{,-*}.html $(DESTDIR)/$(docdir)/
-
-clean:
-       find . -name "*.[oa]" -o -name core -o -name depend -o -name "*.html" | xargs rm -f
-       rm -f conf/cf-lex.c conf/cf-parse.* conf/commands.h conf/keywords.h
-       rm -f $(exedir)/bird $(exedir)/birdcl $(exedir)/birdc $(exedir)/bird.ctl $(exedir)/bird6.ctl .dep-stamp
-
-distclean: clean
-       rm -f config.* configure sysdep/autoconf.h sysdep/paths.h Makefile Rules
-       rm -rf .dir-stamp $(clean-dirs)
diff --git a/tools/Rules.in b/tools/Rules.in
deleted file mode 100644 (file)
index f00c85d..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-# Makefile fragments for the BIRD Internet Routing Daemon
-# (c) 1999--2000 Martin Mares <mj@ucw.cz>
-
-srcdir=@srcdir_rel_mf@
-srcdir_abs := $(shell cd $(srcdir) ; pwd)
-objdir=@objdir@
-exedir=@exedir@
-
-protocols=@protocols@
-static-dirs := nest filter $(addprefix proto/,$(protocols))
-static-dir-paths := $(addprefix $(srcdir)/,$(static-dirs))
-dynamic-dirs := lib conf
-dynamic-dir-paths := $(dynamic-dirs)
-client-dirs := client
-client-dir-paths := $(client-dirs)
-doc-dirs := doc
-doc-dir-paths := $(doc-dirs)
-
-all-dirs:=$(static-dirs) $(dynamic-dirs) $(client-dirs) $(doc-dirs)
-clean-dirs:=$(all-dirs) proto sysdep
-
-CPPFLAGS=-I$(root-rel) -I$(srcdir) @CPPFLAGS@
-CFLAGS=$(CPPFLAGS) @CFLAGS@
-LDFLAGS=@LDFLAGS@
-LIBS=@LIBS@
-CLIENT_LIBS=@CLIENT_LIBS@
-CC=@CC@
-M4=@M4@
-BISON=@BISON@
-FLEX=@FLEX@
-RANLIB=@RANLIB@
-INSTALL=@INSTALL@
-INSTALL_PROGRAM=@INSTALL_PROGRAM@
-INSTALL_DATA=@INSTALL_DATA@
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-bindir=@bindir@
-sbindir=@sbindir@
-sysconfdir=@sysconfdir@
-localstatedir=@localstatedir@
-docdir=@prefix@/doc
-
-ifdef source
-
-objs := $(subst .c,.o,$(source))
-
-ifdef dir-name
-src-path := $(srcdir)/$(dir-name)/
-endif
-
-all:
-       cd $(root-rel) && make
-
-ifdef lib-dest
-
-subdir: $(lib-dest)
-
-$(lib-dest): $(objs)
-       rm -f $@
-       ar rcs $@ $^
-       $(RANLIB) $@
-
-else
-
-subdir: all.o
-
-all.o: $(objs)
-#       $(LD) -r -o $@ $^
-#      Changed to $(CC) because $(LD) has problems with crosscompiling
-       @echo LD -r -o $@ $^
-       @$(CC) -nostdlib -r -o $@ $^
-
-endif
-
-%.o: $(src-path)%.c
-       @echo CC -o $@ -c $<
-       @$(CC) $(CFLAGS) -o $@ -c $<
-
-ifndef source-dep
-source-dep := $(source)
-endif
-
-depend:
-       $(CC) $(CPPFLAGS) -MM $(addprefix $(src-path),$(source-dep)) >depend
-
-ifneq ($(wildcard depend),)
-include depend
-endif
-
-endif
diff --git a/tools/mergedirs b/tools/mergedirs
deleted file mode 100755 (executable)
index fb48c6c..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-if [ -z "$4" ] ; then
-       echo "Usage: mergedirs <src-dir> <src-dir-rel> <obj-dir> <list-of-dirs>"
-       exit 1
-       fi
-cpp=${CPP:-cc -E}
-SRCDIR=$1
-shift
-SRCREL=$1
-case $SRCDIR in
-       /*) ;;
-       *) SRCREL="../$SRCREL" ;;
-       esac
-shift
-OBJDIR=$1
-LIBDIR=$OBJDIR/lib
-CONFDIR=$OBJDIR/conf
-shift
-
-echo "Merging system-dependent modules ($@)"
-MODULES=`for a in $@ ; do
-               cat $SRCDIR/sysdep/config.h $SRCDIR/$a/Modules |
-               $cpp -U unix -D MACROS_ONLY -I $OBJDIR - |
-               sed "/^[ ]*\$/d;/^#/d;s@\\(.*\\)@\\1 $a/\\1@"
-               done |
-       sort -k1,1 -u |
-       cut -d ' ' -f 2`
-rm -rf $LIBDIR $CONFDIR
-mkdir -p $LIBDIR $CONFDIR
-for a in $MODULES ; do
-       b=`basename $a`
-       case $b in
-               *.h)    ln -s $SRCREL/$a $LIBDIR/$b
-                       ;;
-               *.c)    OBJ=`echo $b | sed 's/\.c$/\.o/'`
-                       OBJS="$OBJS $OBJ"
-                       SRCS="$SRCS \\
-       $b"
-                       ln -s $SRCREL/$a $LIBDIR/$b
-                       ;;
-               *.Y)    CONFS="$CONFS\$(srcdir)/$a "
-                       ln -s $SRCREL/$a $CONFDIR/$b
-                       ;;
-               *)      echo "$b: Unknown file type"
-                       exit 1
-                       ;;
-               esac
-       done
-
-cat >$LIBDIR/Makefile <<EOF
-source=$SRCS
-lib-dest=birdlib.a
-root-rel=../
-
-include ../Rules
-EOF
-
-sed <$SRCDIR/conf/Makefile >$CONFDIR/Makefile "s|@CONFS@|$CONFS|"
-CONFS=`cd $SRCDIR ; ls conf/*.[chl]`
-for a in $CONFS ; do
-       ln -s $SRCREL/$a $CONFDIR/
-done
index ef44d3aa24fb120bacab620acf6b5cfb5a8846a0..fc4024bfcac98ec9ddfdf61f90e2de9b2bd7e583 100755 (executable)
@@ -1,17 +1,18 @@
 #!/usr/bin/perl
 
 $srcdir = $ARGV[0];
+$out = $ARGV[1];
 
-open(OUT, ">prog.sgml") || die "Cannot create output file";
-include("doc/prog-head.sgml");
-process("");
-include("doc/prog-foot.sgml");
+open(OUT, ">", $out) || die "Cannot create output file";
+process($srcdir);
 close OUT;
+gen_deps();
 exit 0;
 
 sub include {
   my $f = shift @_;
-  open(IN, "$srcdir/$f") || die "Unable to find $f";
+  open(IN, "$f") || die "Unable to find $f";
+  push(@deps, "$f");
   while (<IN>) {
     print OUT;
   }
@@ -21,7 +22,8 @@ sub include {
 sub process {
   my $dir = shift @_;
   print "$dir/Doc\n";
-  open(IN, "$srcdir/$dir/Doc") || die "Unable to read $dir/Doc";
+  open(IN, "$dir/Doc") || die "Unable to read $dir/Doc";
+  push(@deps, "$dir/Doc");
   my @docfile = <IN>;
   close IN;
   foreach $_ (@docfile) {
@@ -36,7 +38,10 @@ sub process {
       print OUT "<chapt>$arg\n";
     } elsif ($cmd eq "S") {
       print "    $arg\n";
-      open(DOC, "cd $srcdir/$dir ; $srcdir/doc/kernel-doc -bird $arg |") || die "Unable to start kernel-doc";
+      my @files = map("$dir/$_", split(' ', $arg));
+      my $fargs = join(' ', @files);
+      open(DOC, "$srcdir/doc/kernel-doc -bird $fargs |") || die "Unable to start kernel-doc";
+      push(@deps, @files);
       while (<DOC>) { print OUT; }
       close DOC;
     } elsif ($cmd eq "D") {
@@ -45,3 +50,17 @@ sub process {
     } else { die "Unknown command: $cmd"; }
   }
 }
+
+sub gen_deps {
+  open(DEP, ">", "$out.d");
+  print DEP "$out:";
+  foreach $f (@deps) {
+    print DEP " \\\n  $f";
+  }
+  print DEP "\n\n";
+
+  foreach $f (@deps) {
+    print DEP "$f:\n\n";
+  }
+  close DEP;
+}