diff --git a/ghc/compiler/Makefile b/ghc/compiler/Makefile
index dea140beb95b9580de604189d8ca44b92a78474f..25460e31143ebfd7f0dc38bc462f6d22c476788f 100644
--- a/ghc/compiler/Makefile
+++ b/ghc/compiler/Makefile
@@ -361,10 +361,11 @@ MAINTAINER_CLEAN_FILES += $(wildcard */*.hc)
 
 
 #-----------------------------------------------------------------------------
-# 		TAGS
+# 		TAGS setup
 
 SRC_HSTAGS_OPTS += -fglasgow-exts -cpp
-
+TAGS_HS_SRCS=$(foreach dir,$(DIRS),$(wildcard $(dir)/*.lhs))
+TAGS_C_SRCS=$(strip $(foreach f,$(foreach dir,$(DIRS),$(wildcard $(dir)/*.c)),$(shell if [ -w $(f) ]; then echo $(f); else echo ''; fi)))
 
 #-----------------------------------------------------------------------------
 # 		Include target-rule boilerplate