summaryrefslogtreecommitdiffstats
path: root/Rules
diff options
context:
space:
mode:
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