# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.27 2002/04/23 09:31:39 simonmar Exp $
#
# (c) The University of Glasgow 2002
#

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

SUBDIRS  = cbits
ALL_DIRS = check
PACKAGE      = util
PACKAGE_DEPS = lang posix concurrent

SRC_HC_OPTS += -cpp

SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR)

Memo_HC_OPTS += -funbox-strict-fields

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

# yeuch, have to get LibsReadline in through CPP to util.conf.in
comma = ,
PACKAGE_CPP_OPTS += -DLibsReadline='$(patsubst %,$(comma)"%",$(LibsReadline))'

# 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
  EXCLUDED_SRCS += Readline.hsc Readline_stub.c
endif

include $(TOP)/mk/target.mk
