]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Changed #include <x/y> to #include "x/y" for our local includes, so that
authorMartin Mares <mj@ucw.cz>
Tue, 28 Apr 1998 14:39:34 +0000 (14:39 +0000)
committerMartin Mares <mj@ucw.cz>
Tue, 28 Apr 1998 14:39:34 +0000 (14:39 +0000)
gcc -MM can be used to separate them from the system ones.

Added automatic generation of dependencies.

14 files changed:
Makefile
Rules
lib/ip.h
lib/ipv4.h
lib/lists.c
lib/resource.h
lib/socket.h
lib/timer.h
nest/bird.h
nest/iface.h
nest/main.c
nest/protocol.h
nest/route.h
sysdep/config.h

index 0c62fe54f9a6f44a1a0bbc6788c6fbd23d2201c4..77f9ee12a052d487ceaffc40c1f051d97607710b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,15 +2,16 @@
 # (c) 1998 Martin Mares <mj@ucw.cz>
 
 TOPDIR=$(shell pwd)
-CFLAGS=-O2 -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses -I$(TOPDIR)
+CPPFLAGS=-I$(TOPDIR)
+CFLAGS=-O2 -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses $(CPPFLAGS)
 
 PROTOCOLS=
-DIRS=sysdep/linux nest $(protocols) lib
+DIRS=sysdep/linux nest $(PROTOCOLS) lib
 ARCHS=$(join $(addsuffix /,$(DIRS)),$(subst /,_,$(addsuffix .a,$(DIRS))))
 
 export
 
-all: all-dirs bird
+all: .dep all-dirs bird
 
 all-dirs:
        set -e ; for a in $(DIRS) ; do $(MAKE) -C $$a ; done
@@ -18,6 +19,13 @@ all-dirs:
 bird: $(ARCHS)
        $(CC) $(LDFLAGS) -o $@ $^
 
+.dep:
+       $(MAKE) dep
+       touch .dep
+
+dep:
+       set -e ; for a in $(DIRS) ; do $(MAKE) -C $$a dep ; done
+
 clean:
-       rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core`
-       rm -f bird
+       rm -f `find . -name "*~" -or -name "*.[oa]" -or -name "\#*\#" -or -name TAGS -or -name core -or -name .depend`
+       rm -f bird .dep
diff --git a/Rules b/Rules
index f6baacdbdd15cfcc57954d57e5e3837fb2b59a8d..a0a1418a6b8526959be7fa9eb328ab2bf19f07cb 100644 (file)
--- a/Rules
+++ b/Rules
@@ -4,9 +4,26 @@
 THISDIR=$(shell pwd)
 RELDIR=$(subst $(TOPDIR)/,,$(THISDIR))
 ANAME=$(subst /,_,$(RELDIR)).a
+SRCS=$(subst .o,.c,$(OBJS))
 
 all: $(ANAME)
 
 $(ANAME): $(OBJS)
        rm -f $(ANAME)
        ar rcs $(ANAME) $(OBJS)
+
+ifdef OBJS
+
+dep: $(SRCS)
+       rm -f .depend
+       for a in $(SRCS) ; do gcc $(CPPFLAGS) -MM $$a >>.depend ; done
+
+else
+
+dep:
+
+endif
+
+ifneq ($(wildcard .depend),)
+include .depend
+endif
index cd12dedbe1f0ccbc91b949b63c75bcf48d6ea83b..dc4f8b8365ae57c737e5a61760c13083497c4719 100644 (file)
--- a/lib/ip.h
+++ b/lib/ip.h
@@ -10,9 +10,9 @@
 #define _BIRD_IP_H_
 
 #ifndef IPV6
-#include <lib/ipv4.h>
+#include "ipv4.h"
 #else
-#include <lib/ipv6.h>
+#include "ipv6.h"
 #endif
 
 #endif
index e5c1e8cace9bb73ecb488d92b992f17cf76fe6cb..4b8c44cdd882b06457b5b9d9feb093d68867fb1d 100644 (file)
@@ -18,7 +18,7 @@ typedef struct ipv4_addr {
 #define _I(x) (x).addr
 #define _MI(x) ((struct ip_addr) { x })
 
-#define IPA_NONE(_MI(0))
+#define IPA_NONE (_MI(0))
 
 #define ipa_equal(x,y) (_I(x) == _I(y))
 #define ipa_and(x,y) _MI(_I(x) & _I(y))
index 321a5f0506a3be252274bcb3f76676a417f5eb5e..55c2b0fd9ec7334a3fe2b1e5855d6b617dc4558c 100644 (file)
@@ -8,8 +8,8 @@
 
 #define _BIRD_LISTS_C_
 
-#include <nest/bird.h>
-#include <lib/lists.h>
+#include "nest/bird.h"
+#include "lib/lists.h"
 
 LIST_INLINE void
 add_tail(list *l, node *n)
index a1d229ecd66cb0fdb8522f8f48c3d28eb2a7fa18..eabc963df3289fb6511f773ebcd3aa5c31281d97 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _BIRD_RESOURCE_H_
 #define _BIRD_RESOURCE_H_
 
-#include <lib/lists.h>
+#include "lib/lists.h"
 
 /* Resource */
 
index 4f68a161a8777bfebdbb2a96d272d33cac3919cc..f1c9a64fc554af921e98ab059d182f1f655ea40b 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _BIRD_SOCKET_H_
 #define _BIRD_SOCKET_H_
 
-#include <lib/resource.h>
+#include "lib/resource.h"
 
 typedef struct birdsock socket;
 
index 29f20c4b486186d802c8f5705f7e69d8e000ba95..506e3c9450e347bb1f4122ff7444b2c3192ada00 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _BIRD_TIMER_H_
 #define _BIRD_TIMER_H_
 
-#include <lib/resource.h>
+#include "lib/resource.h"
 
 typedef struct timer {
        resource r;
index 062e5fd14e83c670f5364c54f4a41115953d3975..b9c9192beb8da338f3a4fb200392a562ddbd8e28 100644 (file)
@@ -9,9 +9,9 @@
 #ifndef _BIRD_BIRD_H_
 #define _BIRD_BIRD_H_
 
-#include <sysdep/config.h>
-#include <lib/birdlib.h>
-#include <lib/ip.h>
+#include "sysdep/config.h"
+#include "lib/birdlib.h"
+#include "lib/ip.h"
 
 extern u32 router_id;                  /* Our Router ID */
 extern u16 this_as;                    /* Our Autonomous System Number */
index 7b85ece046c6398abd32e102fbdfe69c81984887..aa8a135d8235de05c26f0dad7443bb1557b9ad7c 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _BIRD_IFACE_H_
 #define _BIRD_IFACE_H_
 
-#include <lib/lists.h>
+#include "lib/lists.h"
 
 struct iface {
   node n;
index 8f60f27241fe7d4731eba06068b7018201219196..8c269386e016bfe8c0ee7df5ef1e056ae4065b03 100644 (file)
@@ -6,10 +6,9 @@
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
 
-#include <nest/bird.h>
-#include <lib/lists.h>
-
-#include <nest/resource.h>
+#include "nest/bird.h"
+#include "lib/lists.h"
+#include "lib/resource.h"
 
 int
 main(void)
index adca11491584e0f354cd89c00299c543877603a9..848fecaccf7a2105a3ccdf0b79e3783988c55de4 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _BIRD_PROTOCOL_H_
 #define _BIRD_PROTOCOL_H_
 
-#include <lib/resource.h>
+#include "lib/resource.h"
 
 /*
  *     Routing Protocol
index 9e9ef7a69de383a7d75fa66a1219cc47e6dc0699..b3f00637ec1d302cae2592f697de465b989f5cc4 100644 (file)
@@ -9,7 +9,7 @@
 #ifndef _BIRD_ROUTE_H_
 #define _BIRD_ROUTE_H_
 
-#include <lib/resource.h>
+#include "lib/resource.h"
 
 /*
  *     Generic data structure for storing network prefixes. Also used
index e83a50884623c3241568421d225b1f958068d48c..a17f4d141e6d207ed91512aacde141e96cfcc1c4 100644 (file)
@@ -9,7 +9,7 @@
 
 /* System-dependent configuration */
 
-#include <sysdep/cf/linux-20.h>
+#include "sysdep/cf/linux-20.h"
 
 /* Include debugging code */