Rewire so that hsc.c files get built as part of cbits library.
EXCLUDED_HSC_SRCS = $(filter %.hsc, $(EXCLUDED_SRCS))
EXCLUDED_DERIVED_SRCS = $(patsubst %.hsc, %.hs, $(EXCLUDED_HSC_SRCS)) \
$(patsubst %.hsc, %_hsc.h, $(EXCLUDED_HSC_SRCS)) \
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, $(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
CLOSED_EXCLUDED_SRCS = $(sort $(EXCLUDED_SRCS) $(EXCLUDED_DERIVED_SRCS))
CLOSED_EXCLUDED_SRCS = $(sort $(EXCLUDED_SRCS) $(EXCLUDED_DERIVED_SRCS))
#
# Outputs:
# $(LIBRARY) the name of the library.a
#
# Outputs:
# $(LIBRARY) the name of the library.a
-# $(GHIC_LIBRARY) the name of the library.o (for GHCi0
+# $(GHIC_LIBRARY) the name of the library.o (for GHCi)
# $(LIBOBJS) objects to put in library
# $(STUBOBJS) more objects to put in library
#
# $(LIBOBJS) objects to put in library
# $(STUBOBJS) more objects to put in library
#
ifeq "$(IS_CBITS_LIB)" "YES"
_cbits := _cbits
ifeq "$(IS_CBITS_LIB)" "YES"
_cbits := _cbits
+STUBOBJS += $(HSC_C_OBJS)
+# Add _hsc.c files to the cbits library
+SRCS += $(wildcard ../*_hsc.c)
endif
LIBRARY = libHS$(PACKAGE)$(_cbits)$(_way).a
endif
LIBRARY = libHS$(PACKAGE)$(_cbits)$(_way).a
-STUBOBJS += $(HSC_C_OBJS)
SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR)
ifeq "$(IS_CBITS_LIB)" "YES"
SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR)
ifeq "$(IS_CBITS_LIB)" "YES"