diff --git a/Makefile.am.in b/Makefile.am.in
index 1b0601cf0d19ee0c2176738be7f2406c53c11957..9430d295d1aa0bc7f6e037a25b5214a793e4b5dd 100644
--- a/Makefile.am.in
+++ b/Makefile.am.in
@@ -54,3 +54,37 @@ desQuickCore.c:
 			     LOADCORE,KEYMAPQUICK,SAVECORE)' 
 
 EXTRA_DIST = $(cvs_headers) Makefile.am.in descore.README
+
+.PHONY: depend
+depend:
+	rm -f $(DEP_FILES)
+	make $(DEP_FILES)
+
+.deps/%.P : %.c
+	$(CC) $(CPPFLAGS) $(DEFS) -M -MG $< > $@
+
+MAINTAINERCLEANFILES += $(DEP_FILES)
+
+.PHONY: ctags-recursive ctags
+
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  (cd $$subdir && $(MAKE) ctags); \
+	done
+
+ctags: ctags-recursive $(HEADERS) $(SOURCES) $(CONFIG_HEADER) $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test -f $$subdir/tags && tags="$$tags $$here/$$subdir/tags"; \
+	done; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$(CONFIG_HEADER)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && ctags -o $$here/tags $(CTAGS_ARGS) $$tags $(CONFIG_HEADER) $$unique $(LISP))
+
+# Override the standard distclean-tags target, as this doesn't support `tags'
+distclean-tags:
+	-rm -f TAGS ID tags
diff --git a/include/Makefile.am.in b/include/Makefile.am.in
index ac708a014abb56eac31533164430eb8d554ab934..1f8c13602a17d86950e9fd9c1034f60c3f1df298 100644
--- a/include/Makefile.am.in
+++ b/include/Makefile.am.in
@@ -3,3 +3,27 @@ CVS_HEADERS: cvs_headers
 BODY:
 
 EXTRA_DIST = $(cvs_headers) Makefile.am.in
+
+.PHONY: ctags-recursive ctags
+
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  (cd $$subdir && $(MAKE) ctags); \
+	done
+
+ctags: ctags-recursive $(HEADERS) $(SOURCES) $(CONFIG_HEADER) $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test -f $$subdir/tags && tags="$$tags $$here/$$subdir/tags"; \
+	done; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$(CONFIG_HEADER)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && ctags -o $$here/tags $(CTAGS_ARGS) $$tags $(CONFIG_HEADER) $$unique $(LISP))
+
+# Override the standard distclean-tags target, as this doesn't support `tags'
+distclean-tags:
+	-rm -f TAGS ID tags