Commit 8c56903f authored by Simon Marlow's avatar Simon Marlow
Browse files

Add a skeleton libraries directory

Adding files from libraries that aren't in the other
packages sub-repos.  I haven't bothered to try to keep
history for these files, for history go back to the CVS
repo.
parent 44713ec1
......@@ -14,7 +14,6 @@
^hslibs/
^hws/
^hx/
^libraries/
^literate/
^mhms/
^mkworld/
......
# -----------------------------------------------------------------------------
TOP=.
include $(TOP)/mk/boilerplate.mk
# -----------------------------------------------------------------------------
SUBDIRS = base haskell98 template-haskell
ifeq "$(GhcLibsWithUnix)" "YES"
SUBDIRS += unix
endif
SUBDIRS += Cabal
SUBDIRS += $(wildcard parsec)
# Set GhcBootLibs=YES from the command line to work with just the libraries
# needed to bootstrap GHC.
ifneq "$(GhcBootLibs)" "YES"
SUBDIRS += $(wildcard haskell-src)
SUBDIRS += $(wildcard network)
SUBDIRS += $(wildcard QuickCheck)
SUBDIRS += $(wildcard HUnit)
SUBDIRS += $(wildcard mtl)
SUBDIRS += $(wildcard fgl)
SUBDIRS += $(wildcard X11)
ifeq "$(Windows)" "YES"
SUBDIRS += $(wildcard Win32)
endif
SUBDIRS += $(wildcard HGL)
SUBDIRS += $(wildcard OpenGL)
SUBDIRS += $(wildcard GLUT)
SUBDIRS += $(wildcard OpenAL)
SUBDIRS += $(wildcard ALUT)
SUBDIRS += $(wildcard stm)
ifeq "$(GhcLibsWithObjectIO)" "YES"
SUBDIRS += $(wildcard ObjectIO)
endif
endif
ifeq "$(GhcLibsWithReadline)" "YES"
SUBDIRS += $(wildcard readline)
endif
# -----------------------------------------------------------------------------
DIST_CLEAN_FILES += config.cache config.status
include $(TOP)/mk/target.mk
# -----------------------------------------------------------------------------
# Generating the combined contents/index pages for the library docs
ifneq "$(NO_HADDOCK_DOCS)" "YES"
HTML_DIR = html
# ATTENTION, incomprehensible shell stuff ahead: Automagically create the
# prologue for the combined index via a header, the package prologues (in
# alphabetical order of the packages) and a footer. Not very nice, but much
# better than redundancy or a strong coupling with the packages.
libraries.txt: libraries-header.txt libraries-footer.txt $(foreach f,package.conf.in prologue.txt,$(addsuffix /$(f),$(SUBDIRS)))
$(RM) $@
( cat libraries-header.txt ; echo ; \
for i in `for j in $(SUBDIRS) ; do echo $$j ; done | $(SORT) -f` ; do \
if test -f $$i/$$i.haddock; then \
echo "[@$$i@]"; \
grep -v '^ *$$' $$i/prologue.txt; \
echo; \
fi; \
done ; \
cat libraries-footer.txt ; echo ) > $@
CLEAN_FILES += libraries.txt
$(HTML_DIR)/index.html : libraries.txt
@$(INSTALL_DIR) $(HTML_DIR)
$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
$(HADDOCK_OPTS) \
-t "Haskell Hierarchical Libraries" \
-p libraries.txt \
$(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
$(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
--read-interface=$(pkg),$(pkg)/$(pkg).haddock))
html :: $(HTML_DIR)/index.html
libraries.HxS : libraries.txt
@$(INSTALL_DIR) $(HTML_DIR)
$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
$(HADDOCK_OPTS) \
-t "Haskell Hierarchical Libraries" \
-p libraries.txt \
-k libraries \
--html-help=mshelp2 \
$(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
$(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
--read-interface=$(pkg),$(pkg)/$(pkg).haddock))
( cd $(HTML_DIR) && if Hxcomp -p libraries.HxC -o ../$@ ; then false ; else true ; fi ) || true
libraries.chm : libraries.txt
@$(INSTALL_DIR) $(HTML_DIR)
$(HADDOCK) --gen-index --gen-contents -o $(HTML_DIR) \
$(HADDOCK_OPTS) \
-t "Haskell Hierarchical Libraries" \
-p libraries.txt \
-k libraries \
--html-help=mshelp \
$(foreach pkg, $(filter-out haskell98,$(SUBDIRS)), \
$(foreach p, $(wildcard $(pkg)/$(pkg).haddock), \
--read-interface=$(pkg),$(pkg)/$(pkg).haddock))
( cd $(HTML_DIR) && if hhc libraries.hhp ; then false ; else true ; fi && mv libraries.chm .. ) || true
HxS :: libraries.HxS
chm :: libraries.chm
install-docs :: $(HTML_DIR)/index.html
$(INSTALL_DIR) $(datadir)/html/libraries; \
for i in $(HTML_DIR)/*; do \
if test -f $$i; then \
echo $(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
$(INSTALL_DATA) $(INSTALL_OPTS) $$i $(datadir)/html/libraries; \
fi; \
done
@for i in $(filter html chm HxS,$(XMLDocWays)); do \
if [ $$i != "html" ]; then \
$(INSTALL_DIR) $(datadir)/doc; \
echo $(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
$(INSTALL_DATA) $(INSTALL_OPTS) libraries`echo .$$i | sed s/\.html-no-chunks/.html/` $(datadir)/doc; \
fi; \
if [ $$i = "html-no-chunks" ]; then \
echo $(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
$(CP) $(FPTOOLS_CSS_ABS) $(datadir); \
fi \
done
endif # NO_HADDOCK_DOCS
# This Makefile.common is used only in an nhc98 build of the libraries.
# It is included from each package's individual Makefile.nhc98.
# We assume the following definitions have already been made in
# the importing Makefile.
#
# THISPKG = e.g. mypkg
# SEARCH = e.g. -P../IO -P../PreludeIO -package base
# SRCS = all .hs .gc and .c files
#
# EXTRA_H_FLAGS = e.g. -prelude
# EXTRA_C_FLAGS = e.g. -I../Binary
include ../Makefile.inc
# nasty hack - replace flags for ghc, nhc98, with hbc specific ones
ifeq "hbc" "${BUILDCOMP}"
EXTRA_H_FLAGS := ${EXTRA_HBC_FLAGS}
endif
DIRS = $(shell ${LOCAL}pkgdirlist ${THISPKG})
OBJDIR = ${BUILDDIR}/${OBJ}/libraries/${THISPKG}
OBJDIRS = $(patsubst %, ${OBJDIR}/%, ${DIRS})
FINALLIB = ${DST}/libHS${THISPKG}.$A
INCDIRS = ${INCDIR}/packages/${THISPKG} \
$(patsubst %, ${INCDIR}/packages/${THISPKG}/%, ${DIRS})
.SUFFIXES: .hi .hs .lhs .o .gc .c .hc .p.o .p.c .z.o .z.c .hsc
SRCS_HS = $(filter %.hs, ${SRCS})
SRCS_LHS = $(filter %.lhs,${SRCS})
SRCS_GC = $(filter %.gc, ${SRCS})
SRCS_HSC = $(filter %.hsc,${SRCS})
SRCS_C = $(filter %.c, ${SRCS})
SRCS_HASK= $(SRCS_HS) $(SRCS_LHS) $(SRCS_GC) $(SRCS_HSC)
OBJS_HS = $(patsubst %.hs, ${OBJDIR}/%.$O, ${SRCS_HS})
OBJS_LHS = $(patsubst %.lhs,${OBJDIR}/%.$O, ${SRCS_LHS})
OBJS_GC = $(patsubst %.gc, ${OBJDIR}/%.$O, ${SRCS_GC})
OBJS_HSC = $(patsubst %.hsc,${OBJDIR}/%.$O, ${SRCS_HSC})
OBJS_C = $(patsubst %.c, ${OBJDIR}/%.$O, ${SRCS_C})
OBJS_HASK= ${OBJS_HS} ${OBJS_LHS} ${OBJS_GC} ${OBJS_HSC}
OBJS = $(OBJS_HASK) $(OBJS_C)
CFILES_HS = $(patsubst %.hs, %.$C, ${SRCS_HS})
CFILES_LHS = $(patsubst %.lhs,%.$C, ${SRCS_LHS})
CFILES_GC = $(patsubst %.gc, %.$C, ${SRCS_GC})
CFILES_XS = $(patsubst %.gc, %_.$C, ${SRCS_GC}) \
$(patsubst %.gc, %_.hs, ${SRCS_GC})
CFILES_HSC = $(patsubst %.hsc,%.$C, ${SRCS_HSC})
CFILES_GEN = ${CFILES_HS} ${CFILES_LHS} ${CFILES_GC} ${CFILES_HSC}
ifeq "p" "${PROFILING}"
HC += -p
endif
ifeq "z" "${TPROF}"
HC += -z
endif
all: ${OBJDIR} ${OBJDIRS} ${INCDIRS} extra ${OBJS} ${FINALLIB}
extra:
cfiles: extracfiles ${CFILES_GEN}
extracfiles:
fromC: ${OBJDIR} ${OBJS_C} ${OBJDIRS}
$(HC) -c -d $(OBJDIR) $(EXTRA_C_FLAGS) ${SEARCH} ${CFILES_GEN}
echo $(OBJS) | xargs ar cr ${FINALLIB}
objdir: ${OBJDIR} ${OBJDIRS} ${INCDIRS}
${OBJDIR} ${OBJDIRS} ${INCDIRS}:
mkdir -p $@
${FINALLIB}: ${OBJS}
echo $(OBJS) | xargs ar cr $@
cleanhi:
-rm -f $(patsubst %, %/*.hi, ${DIRS})
cleanC: cleanExtraC
-rm -f ${CFILES_GEN} ${CFILES_XS}
clean: cleanhi
-rm -f $(patsubst %, ${OBJDIR}/%/*.$O, ${DIRS})
-rm -f $(patsubst %.gc, %_.hs, $(filter %.gc, $(SRCS)))
-rm -f $(patsubst %.gc, %_.$C, $(filter %.gc, $(SRCS)))
cleanExtraC:
# general build rules for making objects from Haskell files
$(OBJS_HASK): #$(OBJDIR) $(OBJDIRS) $(SRCS_HASK)
$(LOCAL)hmake -hc=$(HC) -hidir $(INCDIR)/packages/$(THISPKG) \
$(SEARCH) $(EXTRA_H_FLAGS) -d$(OBJDIR) \
$(SRCS_HASK)
${OBJS_HS}: ${OBJDIR}/%.$O : %.hs
${OBJS_LHS}: ${OBJDIR}/%.$O : %.lhs
${OBJS_GC}: ${OBJDIR}/%.$O : %.gc
${OBJS_HSC}: ${OBJDIR}/%.$O : %.hsc
# general build rule for making objects from C files
${OBJS_C}: ${OBJDIR}/%.$O : cbits/%.c
$(CC) -c -I$(INCDIR) $(ENDIAN) $(filter -I%, ${SEARCH}) \
$(EXTRA_C_FLAGS) -o $@ $<
# general build rules for making bootstrap C files from Haskell files
$(CFILES_GEN):
$(LOCAL)hmake -hc=$(HC) -C -hidir $(INCDIR)/packages/$(THISPKG) \
$(SEARCH) $(EXTRA_H_FLAGS) \
$(SRCS_HASK)
${CFILES_HS}: %.$C : %.hs
${CFILES_LHS}: %.$C : %.lhs
${CFILES_GC}: %.$C : %.gc
${CFILES_HSC}: %.$C : %.hsc
# hack to get round mutual recursion between libraries
HIFILES = $(patsubst %.hs,../${THISLIB}/%.${HISUFFIX},$(filter %.hs, ${SRCS}))
${HIFILES}: ../${THISLIB}/%.${HISUFFIX} : %.hs
$(HC) -c $(PART_FLAGS) -o /dev/null $<
# The importing Makefile may now define extra individual dependencies
# e.g.
# ${OBJDIR}/Function.$O: Function.hs ${OBJDIR}/Other.$O
#
# and C-files dependencies likewise
# e.g.
# AlignBin.c: BinHandle.c
ifeq "" "${MKDIR}"
MKDIR:=$(shell pwd)
#MKDIR:=$(PWD)
else
MKDIR:=$(patsubst %/$(notdir ${MKDIR}),%, ${MKDIR})
endif
include ${MKDIR}/Makefile.inc
# Empty file to avoid a dependency on automake: autoreconf calls aclocal to
# generate a temporary aclocal.m4t when no aclocal.m4 is present.
# Initialise and check sanity.
AC_INIT([Haskell hierarchical libraries], [1.0], [libraries@haskell.org], [libraries])
AC_CONFIG_SRCDIR([libraries-footer.txt])
AC_CONFIG_SUBDIRS([base network unix X11 HGL OpenGL GLUT OpenAL ALUT])
AC_OUTPUT
TOP=..
include $(TOP)/mk/boilerplate.mk
XML_DOC=libraries
include $(TOP)/mk/target.mk
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>Haskell Library Hierarchy</title>
</head>
<body>
<h1>The Haskell Library Hierarchy</h1>
<pre>
Algebra
DomainConstructor -- formerly DoCon
Geometric -- formerly BasGeomAlg
Control
Exception -- (opt, inc. error & undefined)
Concurrent -- as hslibs/concurrent
Chan -- these could all be moved under Data
MVar
Merge
QSem
QSemN
SampleVar
Semaphore
Parallel -- as hslibs/concurrent/Parallel
Strategies
Monad -- Haskell 98 Monad library
ST -- ST defaults to Strict variant?
Strict -- renaming for ST
Lazy -- renaming for LazyST
State
Error
Identity
Monoid
Reader
Writer
Cont
Fix -- to be renamed to Rec?
List
RWS
Data
Binary -- Binary I/O
Bits
Bool -- &&, ||, not, otherwise
Tuple -- fst, snd
Char -- H98
Complex -- H98
Dynamic
Either
Int
Maybe -- H98
List -- H98
PackedString
Ratio -- H98
Word
LargeWord -- Word128 etc., from crypto
IORef
STRef -- Same as Data.STRef.Strict
Strict
Lazy -- The lazy version (for Control.Monad.ST.Lazy)
Binary -- Haskell binary I/O
Digest
MD5
... -- others (CRC ?)
Array -- Haskell 98 Array library
Unboxed
IArray
MArray
IO -- mutable arrays in the IO/ST monads
ST
Tree
AVL
RedBlack
BTree
Queue
Bankers
FIFO
Collection
Graph -- start with GHC's DiGraph?
FiniteMap
Set
Memo -- (opt)
Unique
Database
MySQL
PostgreSQL
ODBC
Dotnet
... -- Mirrors the MS .NET class hierarchy
Debug
Trace
Observe -- choose a default amongst the variants
Textual -- Andy Gill's release 1
ToXmlFile -- Andy Gill's XML browser variant
GHood -- Claus Reinke's animated variant
Edison -- (opt, uses multi-param type classes)
Prelude -- large self-contained packages should have
Collection -- their own hierarchy? Like a vendor branch.
Queue -- Or should the whole Edison tree be placed
... -- under [Data.]Structures?
Codec -- Coders/Decoders for various data formats
ASN.1
BER
TLV
Audio
Wav
MP3
...
Compression
Gzip
Bzip2
...
Encryption
DES
RSA
BlowFish
...
Image
GIF
PNG
JPEG
TIFF
...
Text
UTF8
UTF16
ISO8859
...
Video
Mpeg
QuickTime
Avi
...
Binary -- these are for encoding binary data into text
Base64
Yenc
DSP -- Digital Signal Processing libraries
Foreign
Ptr
StablePtr
ForeignPtr -- rename to FinalisedPtr? to void confusion with Foreign.Ptr
Storable
Marshal
Alloc
Array
Errors
Utils
C
Types
Errors
Strings
GHC
Exts -- hslibs/lang/GlaExts
...
Graphics
HGL
Rendering
Direct3D
FRAN
Metapost
Inventor
Haven
OpenGL
GL
GLU
Pan
UI
FranTk
Fudgets
GLUT
Gtk
Motif
ObjectIO
TkHaskell
X11
Xt
Xlib
Xmu
Xaw
Hugs
...
Language
Haskell -- hslibs/hssource
Syntax
Lexer
Parser
Pretty
HaskellCore
Python
C
...
Nhc
...
Numeric -- exports std. H98 numeric type classes
Statistics
Network -- (== hslibs/net/Socket), depends on FFI only
Socket -- or rename to Posix?
URI -- general URI parsing
CGI -- one in hslibs is ok?
Protocol
HTTP
FTP
SMTP
Prelude -- Haskell98 Prelude (mostly just re-exports
other parts of the tree).
System -- Interaction with the "system"
Cmd -- ( system )
CPUTime -- H98
Directory -- H98
Exit -- ( ExitCode(..), exitWith, exitFailure )
Environment -- ( getArgs, getProgName, getEnv ... )
Info -- info about the host system
IO -- H98 + IOExts - IOArray - IORef
Select
Unsafe -- unsafePerformIO, unsafeInterleaveIO
Console
GetOpt
Readline
Locale -- H98
Posix
Console
Directory
DynamicLinker
Prim
Module
IO
Process
Time
Mem -- rename from cryptic 'GC'
Weak -- (opt)
StableName -- (opt)
Time -- H98 + extensions
Win32 -- the full win32 operating system API
Test
HUnit
QuickCheck
Text
Encoding
QuotedPrintable
Rot13
Read
Lex -- cut down lexer for "read"
Show
Functions -- optional instance of Show for functions.
Regex -- previously RegexString
Posix -- Posix regular expression interface
PrettyPrint -- default (HughesPJ?)
HughesPJ
Wadler
Chitil
...
HTML -- HTML combinator lib
XML
Combinators
Parse
Pretty
Types
ParserCombinators -- no default
ReadP -- a more efficient "ReadS"
Parsec
Hutton_Meijer
...
</pre>
</html>
This diff is collapsed.
This diff is collapsed.
Implementation-specific notes:
[GHC\/GHCi] Most of the time, all the packages are available without the need to
use any additional command-line options. The only time when this is not the
case is when linking a program on the command line, without using the @--make@
option: in this case you must list all the packages to link to by adding the
@-package@ /P/ flag (where /P/ is the package name) to the command line for each
package. See the User's Guide (<../users_guide/index.html>) for more
details.
[Hugs] Hugs provides almost all of the modules in the above packages,
with exceptions listed on the Hugs 98 libraries status page
(<http://cvs.haskell.org/Hugs/pages/libstatus.html>).
All those modules are always available.
[Nhc98] Nhc98 provides many of the modules in the above packages (see the
Nhc98 libraries page (<http://www.haskell.org/nhc98/libraries.html>) for a more
details). The modules of the @haskell98@ package are available without the need
to use any additional compile-time options. To use modules from some other
package /P/ with Nhc98, add the compile-time option @-package@ /P/.
The libraries are divided into several /packages/. The available packages are:
# -----------------------------------------------------------------------------
# $Id: boilerplate.mk,v 1.1 2001/07/31 16:40:34 simonmar Exp $
# Begin by slurping in the boilerplate from one level up.
# Remember, TOP is the top level of the innermost level
# (FPTOOLS_TOP is the fptools top)
# We need to set TOP to be the TOP that the next level up expects!
# The TOP variable is reset after the inclusion of the fptools
# boilerplate, so we stash TOP away first:
LIBRARIES_TOP := $(TOP)
TOP:=$(TOP)/..
# Also set GHC_TOP here, because we need to get at bits of GHC's config
GHC_TOP := $(TOP)/ghc
# Pull in GHC's version & project info
-include $(GHC_TOP)/mk/version.mk
# Pull in the fptools boilerplate
include $(TOP)/mk/boilerplate.mk
# Reset TOP
TOP:=$(LIBRARIES_TOP)
# -----------------------------------------------------------------
# Everything after this point
# augments or overrides previously set variables.
-include $(GHC_TOP)/mk/paths.mk