#  The Haskell Ports Library: Main library makefile
#
#  Author : Manuel M. T. Chakravarty
#  Derived: 24 May 2000
#
#  Version $Revision: 1.7 $ from $Date: 2004/05/14 07:20:52 $
#
#  Copyright (c) 2000 Manuel M. T. Chakravarty
#
#  This library is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Library General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  This library is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Library General Public License for more details.
#
#  = DOCU =====================================================================
#
#  * Derived from the corresponding Gtk+HS file.
#

#  ***************************************
#  !!! This makefile requires GNU make !!!
#  ***************************************

include ../mk/config.mk ../mk/common.mk

-include .depend


# Extra flags for the Haskell compiler
#
EXTRAHCFLAGS = -package-name ports

# The files making up this library
#
SRCS    = HPL.hs Ports.hs PortsConfig.hs PortsVersion.hs Processes.hs SVars.hs\
	  ThreadUtils.hs PortThreads.hs
OBJS    = $(patsubst %.hs,%.o,$(filter %.hs,$(SRCS)))

# Dependencies that should be omitted in the dependency file
#
MKDEPEXCL =

# File-specific flags of the form <filename>-HCFLAGS=<flags>
#

# The default target is building the library
#
default: libportsHS.a


# Targets for building stuff
# --------------------------

libportsHS.a: $(OBJS)
	-$(RM) $@
	$(AR) -crs $@ $(OBJS)

.PHONY: ghci
ghci: 
	$(HC) --interactive $(HCFLAGS) HPL.hs


# Auxilliary targets
# ------------------

.PHONY: prep depend clean spotless

prep: $(GENSRCS) depend

depend: $(GENSRCS) gendepend

clean: genclean

spotless: genspotless
	-$(RM) libportsHS.a
