summaryrefslogtreecommitdiffstats
path: root/Rules
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1998-04-28 16:39:34 +0200
committerMartin Mares <mj@ucw.cz>1998-04-28 16:39:34 +0200
commit1feea03e7463d8eaeb00d5df6c2cd3e8e20f2bcd (patch)
tree70ba86e2c60b759f7740c0d28e6abdaaf60241ea /Rules
parentc40e05a0dffa33a8724e56121a2b6dcdfa9183e0 (diff)
downloadbird-1feea03e7463d8eaeb00d5df6c2cd3e8e20f2bcd.tar
bird-1feea03e7463d8eaeb00d5df6c2cd3e8e20f2bcd.zip
Changed #include <x/y> to #include "x/y" for our local includes, so that
gcc -MM can be used to separate them from the system ones. Added automatic generation of dependencies.
Diffstat (limited to 'Rules')
-rw-r--r--Rules17
1 files changed, 17 insertions, 0 deletions
diff --git a/Rules b/Rules
index f6baacd..a0a1418 100644
--- 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