-HSC_SRCS = $(filter %.hsc, $(PRE_SRCS))
-HSC_HS_SRCS = $(patsubst %.hsc,%.hs,$(HSC_SRCS))
-HSC_C_SRCS = $(patsubst %.hsc,%_hsc.c,$(HSC_SRCS))
-HSC_C_OBJS = $(patsubst %.hsc,%_hsc.o,$(HSC_SRCS))
+HSC_SRCS = $(filter %.hsc, $(PRE_SRCS))
+DERIVED_SRCS = $(patsubst %.hsc, %.hs, $(HSC_SRCS)) \
+ $(patsubst %.hsc, %_hsc.c, $(HSC_SRCS)) \
+ $(patsubst %.hsc, %_hsc.h, $(HSC_SRCS))
+
+# EXCLUDED_SRCS can be set in the Makefile, otherwise it defaults to empty.
+EXCLUDED_HSC_SRCS = $(filter %.hsc, $(EXCLUDED_SRCS))
+EXCLUDED_DERIVED_SRCS = $(patsubst %.hsc, %.hs, $(EXCLUDED_HSC_SRCS)) \
+ $(patsubst %.hsc, %_hsc.h, $(EXCLUDED_HSC_SRCS)) \
+ $(patsubst %.hsc, %_hsc.c, $(HSC_SRCS))
+# Exclude _hsc.c files; they get built as part of the cbits library,
+# not part of the main library