Stale interface files left by modules which no longer exist can cause
build problems, so in make clean we now delete all the interface files
we can find, rather than just the ones we know were generated from
existing source files.
#
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"