# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.17 2001/03/30 05:02:32 qrczak Exp $
#
# Makefile for miscellaneous libraries.
#

TOP = ..
include $(TOP)/mk/boilerplate.mk

HSLIB = util
HSLIB_DEPS = lang concurrent posix
HAS_CBITS = YES
SRCS_FROM_SUBDIRS = check

NOT_FOR_HUGS = Readline.hs Memo.lhs Select.lhs

ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
  NOT_FOR_GHC += Select.lhs
  HSLIB_DEPS := $(filter-out posix, $(HSLIB_DEPS))
endif

# Remove Readline.hs if it is not wanted or headers are not available or on mingwin.
ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
  ifeq "$(GhcLibsWithReadline)" "YES"
    ifneq "$(ReadlineIncludePath)" ""
      SRC_HC_OPTS += -I$(ReadlineIncludePath)
    endif
    STUBOBJS += Readline_stub.$(way_)o Readline_hsc.o
    CLEAN_FILES += Readline_stub.[ch] $(STUBOBJS)
  else
    NOT_FOR_GHC += Readline.hs
  endif
else
  NOT_FOR_GHC += Readline.hs
endif

SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_IO_INCLUDE_DIR)
SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C

include $(TOP)/mk/target.mk
