1 # $Id: Makefile,v 1.19 1999/10/05 10:30:28 simonmar Exp $
3 # Makefile for miscellaneous libraries.
7 include $(TOP)/mk/boilerplate.mk
19 #-----------------------------------------------------------------------------
20 # Setting the standard variables
23 LIBRARY = libHSmisc$(_way).a
25 ifeq "$(EnableWin32DLLs)" "YES"
26 HS_SRCS := $(filter-out Select.lhs,$(HS_SRCS))
29 # Remove Readline.lhs if readline.h isn't available.
30 ifneq "$(GhcLibsWithReadline)" "YES"
31 HS_SRCS := $(filter-out Readline.lhs,$(HS_SRCS))
33 ifneq "$(ReadlineIncludePath)" ""
34 SRC_HC_OPTS += -I$(ReadlineIncludePath)
38 HS_OBJS = $(HS_SRCS:.lhs=.$(way_)o)
40 HS_IFACES= $(HS_SRCS:.lhs=.$(way_)hi)
41 SRC_MKDEPENDHS_OPTS += -optdep--include-prelude
43 #-----------------------------------------------------------------------------
44 # Setting the GHC compile options
46 SRC_HC_OPTS += -i../concurrent:../posix -recomp -cpp -fglasgow-exts -fvia-C -Rghc-timing $(GhcLibHcOpts)
50 # (what's this stuff doing here?)
51 WAY_p_HC_OPTS += -GPrelude
52 WAY_mr_HC_OPTS += -GPrelude
55 # Object and interface files have suffixes tagged with their ways
58 SRC_HC_OPTS += -hisuf $(way_)hi
62 SRC_HC_OPTS += -static
69 BSD_HC_OPTS += -I../std/cbits -H8m -optc-DNON_POSIX_SOURCE
70 Socket_HC_OPTS += -I../std/cbits -optc-DNON_POSIX_SOURCE
71 SocketPrim_HC_OPTS += -I../std/cbits -H12m -optc-DNON_POSIX_SOURCE
72 PackedString_HC_OPTS += -H12m
73 Native_HC_OPTS += -H8m
74 Pretty_HC_OPTS += -H8m
76 #-----------------------------------------------------------------------------
77 # Dependency generation
79 SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR)
81 #-----------------------------------------------------------------------------
85 DLL_IMPLIB_NAME = libHSmisc_imp.a
86 SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc.def
87 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
90 #-----------------------------------------------------------------------------
91 # Installation; need to install .hi files as well as libraries
93 # The interface files are put inside the $(libdir), since they
94 # might (potentially) be platform specific..
96 # override is used here because for binary distributions, datadir is
97 # set on the command line. sigh.
99 override datadir:=$(libdir)/imports/misc
102 # Files to install from here
104 INSTALL_LIBS += $(LIBRARY)
105 INSTALL_DATAS += $(HS_IFACES)
107 ifeq "$(EnableWin32DLLs)" "YES"
108 INSTALL_PROGS += $(DLL_NAME)
109 INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY))
110 INSTALL_DATAS += dLL_ifs.hi
113 include $(TOP)/mk/target.mk