# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.25 2001/08/16 22:54:25 sof Exp $
#
# Makefile for miscellaneous libraries.
#

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

PACKAGE = util
PACKAGE_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
  PACKAGE_DEPS := $(filter-out posix, $(PACKAGE_DEPS))
endif

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

SRC_HC_OPTS += -recomp -cpp -fglasgow-exts -fvia-C

include $(TOP)/mk/target.mk
