$(HS_PROG) :: $(HS_OBJS)
$(CC) -o $@ $(HC_BOOT_CC_OPTS) $(HC_BOOT_LD_OPTS) $(HS_OBJS) $(HC_BOOT_LIBS)
endif
-endif
-
-# Object and interface files have suffixes tagged with their ways
-ifneq "$(way)" ""
-SRC_HC_OPTS += -hisuf $(way_)hi -hcsuf $(way_)hc -osuf $(way_)o
-endif
-# add syslib dependencies and current package name
-SRC_HC_OPTS += $(patsubst %, -package %, $(PACKAGE_DEPS))
-ifneq "$(PACKAGE)" ""
-SRC_HC_OPTS += -package-name $(PACKAGE)
-else
-# No library, we are actually building the tools
+# for building a Haskell program, we add FptoolsHcOpts
SRC_HC_OPTS += $(FptoolsHcOpts)
endif
ifneq "$(PACKAGE)" ""
+# add syslib dependencies and current package name
+SRC_HC_OPTS += -package-name $(PACKAGE)
+SRC_HC_OPTS += $(patsubst %, -package %, $(PACKAGE_DEPS))
+
ifeq "$(IS_CBITS_LIB)" "YES"
_cbits := _cbits
STUBOBJS += $(HSC_C_OBJS)
# Add _hsc.c files to the cbits library
-SRCS += $(wildcard ../*_hsc.c)
+C_SRCS += $(wildcard ../*_hsc.c)
# Make .hsc.h include files from the directory above visible
-SRC_CC_OPTS += -I..
+# (and the cbits/ library too).
+SRC_CC_OPTS += -I.. -I.
endif
+ifneq "$(way)" "i"
LIBRARY = libHS$(PACKAGE)$(_cbits)$(_way).a
GHCI_LIBRARY = HS$(PACKAGE)$(_cbits)$(_way).o
+else
+LIBRARY = $(PACKAGE).dll
+endif
ifneq "$(IS_CBITS_LIB)" "YES"
WAYS=$(GhcLibWays)
endif
endif
-SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_RUNTIME_DIR)
-
ifeq "$(IS_CBITS_LIB)" "YES"
override datadir:=$(libdir)/include
INSTALL_DATAS += Hs$(shell perl -e 'print ucfirst "$(PACKAGE)"').h
#----------------------------------------
# Libraries/archives
#
-# Build $(LIBRARY) from $(LIBOJBS)+$(STUBOBJS)
+# Build $(LIBRARY) from $(LIBOBJS)+$(STUBOBJS)
#
# Inputs:
# $(LIBOBJS)
ifneq "$(LIBRARY)" ""
all :: $(LIBRARY)
+ifneq "$(way)" "i"
define BUILD_LIB
$(RM) $@
$(AR) $(AR_OPTS) $@ $(STUBOBJS) $(LIBOBJS)
$(RANLIB) $@
endef
+else
+define BUILD_LIB
+$(RM) $@
+al -out:$@ $(STUBOBJS) $(LIBOBJS)
+endef
+endif
#
# For Haskell object files, we might have chosen to split
@$(MAKE) EXTRA_INSTALL_OPTS='-s' install
endif
-###########################################
+##############################################################################
#
# Targets: check tags show
#
-###########################################
+##############################################################################
#------------------------------------------------------------
# Check
#
show:
- @echo '$(VALUE)=$($(VALUE))'
+ @echo '$(VALUE)="$($(VALUE))"'
-#--------------------------------------------------------------------------
-# SGML Documentation
+################################################################################
+#
+# SGML Documentation
#
+################################################################################
+
.PHONY: dvi ps html pdf rtf
ifneq "$(SGML_DOC)" ""
$(RM) -rf $(SGML_DOC)
endif
-###########################################
+##############################################################################
#
# Targets: clean
#
-###########################################
+##############################################################################
# we have to be careful about recursion here; since all the clean
# targets are recursive, we don't want to make eg. distclean depend on
@echo 'deletes files that may need special tools to rebuild.'
rm -f $(MOSTLY_CLEAN_FILES) $(CLEAN_FILES) $(DIST_CLEAN_FILES) $(MAINTAINER_CLEAN_FILES)
-#################################################################################
+################################################################################
#
# Way management
#
-#################################################################################
+################################################################################
# Here is the ingenious jiggery pokery that allows you to build multiple versions
# of a program in a single build tree.
endif # if way
+# -------------------------------------------------------------------------
+# Object and interface files have suffixes tagged with their ways
+
+ifneq "$(way)" ""
+SRC_HC_OPTS += -hisuf $(way_)hi -hcsuf $(way_)hc -osuf $(way_)o
+endif
+
+# -------------------------------------------------------------------------
+# Rules to invoke the current target recursively for each way
+
ifneq "$(WAYS)" ""
ifeq "$(way)" ""