[project @ 2002-10-27 10:38:32 by mthomas]
[ghc-hetmet.git] / mk / paths.mk
index fafb49b..b6c1007 100644 (file)
@@ -22,6 +22,7 @@
 #  INSTALL_LIBS     (installed in $(libdir))
 #  INSTALL_LIBEXECS (installed in $(libexecdir))
 #  INSTALL_DATAS    (installed in $(datadir))
+#  INSTALL_IFACES   (installed in $(ifacedir))
 #
 # see target.mk for more information.
 #
@@ -61,9 +62,6 @@ INSTALL_DIR     = $(FPTOOLS_TOP)/glafp-utils/mkdirhier/mkdirhier
 # The install variables does not have any defaults,
 # what files to install have to be specified in the Makefiles.
 #
-#INSTALL_PROGS += $(HS_PROG) $(C_PROG)
-#INSTALL_LIBS  += $(LIBRARY)
-#INSTALL_DATAS += $(HS_IFACES)
 
 #################################################################################
 #
@@ -184,6 +182,7 @@ HS_IFACES   = $(addsuffix .$(way_)hi,$(basename $(HS_SRCS)))
 
 HSC_C_OBJS  = $(addsuffix _hsc.$(way_)o,$(basename $(filter %.hsc,$(SRCS))))
 
+EXTRA_OBJS  = $(addsuffix .$(way_)o,$(basename $(EXTRA_SRCS)))
 
 # Always remove $(EXCLUDED_C_SRCS) from C_SRCS
 EXCLUDED_C_SRCS = $(patsubst %.lhs, %_stub.c, $(HS_SRCS)) \
@@ -230,7 +229,7 @@ MKDEPENDC_SRCS=$(C_SRCS)
 #
 # make TAGS defaults
 #
-# The default set of files for the dependency generators to work on
+# The default set of files for the TAGS file generators to work on
 # is just their source equivalents.
 #
 TAGS_HS_SRCS=$(HS_SRCS)
@@ -253,8 +252,13 @@ TAGS_C_SRCS=$(C_SRCS)
 #
 MOSTLY_CLEAN_FILES += $(HS_OBJS) $(C_OBJS) $(HSC_C_OBJS)
 CLEAN_FILES        += $(HS_PROG) $(C_PROG) $(SCRIPT_PROG) $(SCRIPT_LINK) \
-                     $(PROG) $(LIBRARY) $(HS_IFACES) a.out \
-                     $(DERIVED_HSC_SRCS)
+                     $(PROG) $(LIBRARY) a.out \
+                     $(DERIVED_HSC_SRCS) \
+                     $(patsubst %,%/*.$(way_)hi, . $(ALL_DIRS))
+
+# we delete *all* the .hi files we can find, rather than just
+# $(HS_IFACES), because stale interfaces left around by modules which
+# don't exist any more can screw up the build.
 
 # Don't clean the .hc files if we're bootstrapping
 ifneq "$(BootingFromHc)" "YES"