-# $Id: Makefile,v 1.6 1999/05/05 10:48:06 sof Exp $
+# $Id: Makefile,v 1.7 1999/09/17 10:43:51 sof Exp $
#
# Makefile for concurrent libraries.
#
DLL_NAME = HSconc.dll
DLL_IMPLIB_NAME = libHSconcurrent_imp.a
SRC_BLD_DLL_OPTS += --export-all --output-def=HSconc.def
-SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits
+SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHScbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits
#-----------------------------------------------------------------------------
# Installation; need to install .hi files as well as libraries
#
INSTALL_LIBS += $(LIBRARY)
INSTALL_DATAS += $(HS_IFACES)
+ifeq "$(EnableWin32DLLs)" "YES"
+INSTALL_PROGS += $(DLL_NAME)
+INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
+INSTALL_DATAS += dLL_ifs.hi
+endif
include $(TOP)/mk/target.mk
DLL_NAME = HSexts.dll
DLL_IMPLIB_NAME = libHSexts_imp.a
SRC_BLD_DLL_OPTS += --export-all --output-def=HSexts.def
-SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits
+SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHScbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits
#-----------------------------------------------------------------------------
# Installation; need to install .hi files as well as libraries
INSTALL_LIBS += $(LIBRARY)
INSTALL_DATAS += $(HS_IFACES)
+ifeq "$(EnableWin32DLLs)" "YES"
+INSTALL_PROGS += $(DLL_NAME)
+INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
+INSTALL_DATAS += dLL_ifs.hi
+endif
+
include $(TOP)/mk/target.mk
-# $Id: Makefile,v 1.17 1999/08/06 10:55:26 simonmar Exp $
+# $Id: Makefile,v 1.18 1999/09/17 10:43:52 sof Exp $
#
# Makefile for miscellaneous libraries.
#
#
LIBRARY = libHSmisc$(_way).a
-HS_SRCS = $(wildcard *.lhs)
+
+ifeq "$(EnableWin32DLLs)" "YES"
+ HS_SRCS := $(filter-out Select.lhs,$(HS_SRCS))
+endif
# Remove Readline.lhs if readline.h isn't available.
ifneq "$(GhcLibsWithReadline)" "YES"
DLL_NAME = HSmisc.dll
DLL_IMPLIB_NAME = libHSmisc_imp.a
SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc.def
-SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHS_cbits_imp -lHSmisc_cbits_imp -lHS_imp -lHSexts_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits -L../exts -Lcbits
+SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHScbits_imp -lHSmisc_cbits_imp -lHS_imp -lHSexts_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits -L../exts -Lcbits
#-----------------------------------------------------------------------------
INSTALL_LIBS += $(LIBRARY)
INSTALL_DATAS += $(HS_IFACES)
+ifeq "$(EnableWin32DLLs)" "YES"
+INSTALL_PROGS += $(DLL_NAME)
+INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
+INSTALL_DATAS += dLL_ifs.hi
+endif
+
include $(TOP)/mk/target.mk
C_SRCS := $(filter-out ghcReadline.c,$(C_SRCS))
endif
+ifeq "$(EnableWin32DLLs)" "YES"
+ C_SRCS := $(filter-out selectFrom.c,$(C_SRCS))
+endif
+
+ifneq "$(way)" "dll"
+SRC_CC_OPTS += -static
+endif
+
SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_LIB_DIR)/std/cbits
DLL_NAME = HSmisc_cbits.dll
SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc_cbits.def
-SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHS_cbits_imp -lgmp -L. -L../../../rts/gmp -L../../../rts -L../../std/cbits
+SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHScbits_imp -lgmp -L. -L../../../rts/gmp -L../../../rts -L../../std/cbits
+
+ifeq "$(EnableWin32DLLs)" "YES"
+INSTALL_PROGS += $(DLL_NAME)
+INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
+endif
include $(TOP)/mk/target.mk
DLL_NAME = HSprel.dll
DLL_IMPLIB_NAME = libHS_imp.a
SRC_BLD_DLL_OPTS += --export-all --output-def=HSprel.def
-SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits
+SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHScbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits
ifeq "$(way)" "dll"
HS_SRCS := $(filter-out PrelMain.lhs, $(HS_SRCS))
endif
+# PrelMain.dll_o isn't to be included in the final .a
+ifeq "$(way)" "dll"
+all :: PrelMain.dll_o
+endif
+
+#
+# Building PrelMain.dll_o is, unfortunately, somewhat tricky
+# with the current DLL setup. PrelMain.dll_o should refer to
+# all its imports bar Main.main_closure as residing in DLLs.
+# But, since the .hi's of PrelBase et al. is in the same
+# directory as PrelMain, the compiler will assume that they
+# reside in the same DLL as PrelMain & generate code accordingly.
+#
+# So, we copy out PrelMain.lhs to ".." and build it there &
+# copy the gen'ed object file back in again.
+#
+ifeq "$(way)" "dll"
+PrelMain.dll_o : PrelMain.lhs
+ $(RM) ../PrelMain.lhs
+ $(CP) PrelMain.lhs ../
+ $(MAKE) -C .. PrelMain.dll_o way=dll HC_OPTS="$(filter-out -fcompiling-prelude, $(HC_OPTS))"
+ $(MV) ../PrelMain.dll_o .
+ $(RM) ../PrelMain.lhs ../PrelMain.dll_hi
+endif
#-----------------------------------------------------------------------------
# Installation; need to install .hi files as well as libraries
INSTALL_LIBS += $(LIBRARY)
ifeq "$(EnableWin32DLLs)" "YES"
INSTALL_PROGS += $(DLL_NAME)
-INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) PrelMain.o
+INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) PrelMain.dll_o
INSTALL_DATAS += dLL_ifs.hi
endif
INSTALL_DATAS += $(HS_IFACES)