[project @ 2002-02-05 17:32:24 by simonmar]
[haskell-directory.git] / Makefile
index 5e0d134..96e1c73 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,12 @@
 # -----------------------------------------------------------------------------
-# $Id: Makefile,v 1.2 2001/07/03 11:37:49 simonmar Exp $
+# $Id: Makefile,v 1.9 2002/02/05 17:32:24 simonmar Exp $
 
-TOP=../..
+TOP=..
 include $(TOP)/mk/boilerplate.mk
 
-ifeq "$(way)" ""
-SUBDIRS = cbits
-else
-SUBDIRS=
-endif
+# -----------------------------------------------------------------------------
+
+SUBDIRS = cbits include
 
 ALL_DIRS = \
        Control \
@@ -19,6 +17,7 @@ ALL_DIRS = \
        Data/Array \
        Database \
        Debug \
+       Debug/QuickCheck \
        FileFormat \
        Foreign \
        Foreign/C \
@@ -29,46 +28,44 @@ ALL_DIRS = \
        Network \
        NHC \
        System \
+       System/Mem \
        System/IO \
        Text \
+       Text/Html \
+       Text/PrettyPrint \
+       Text/Regex \
        Text/Show
 
-PRE_SRCS += $(wildcard $(patsubst %, %/*.hsc, $(ALL_DIRS)))
-SRC_HSC2HS_OPTS += -Iinclude -I.
+PKG=core
 
-ALL_HS_SRCS = $(wildcard $(patsubst %, %/*.hs, . $(ALL_DIRS)))
-ALL_LHS_SRCS += $(wildcard GHC/*.lhs)
-ALL_HS_OBJS = $(patsubst %.hs, %.o, $(ALL_HS_SRCS)) \
-       $(patsubst %.lhs, %.o, $(ALL_LHS_SRCS))
-ALL_HS_HIS = $(patsubst %.o, %.hi, $(ALL_HS_OBJS))
+# -----------------------------------------------------------------------------
+# PrimOpWrappers
 
-srcs : $(HS_SRCS) GHC/Prim.$(way_)hi
+GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
+       rm -f $@
+       $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
 
-# dependencies between .hsc files
-GHC/IO.hs : GHC/Handle.hs
+boot :: GHC/PrimOpWrappers.hs
 
-GHC/Prim.$(way_)hi : GHC/Prim.hi-boot
-       cp $< $@
+CLEAN_FILES += GHC/PrimopWrappers.hs
 
-SRC_HC_OPTS += -cpp -fglasgow-exts -fvia-C -I$(FPTOOLS_TOP)/ghc/includes -Iinclude -package-name core -H128m $(GhcLibHcOpts)
+# -----------------------------------------------------------------------------
+# GHC/Prim.hi-boot
 
-LIBNAME = libHScore$(_way).a
+GHC/Prim.$(way_)hi     : GHC/Prim.hi-boot
+       cp $< $@
+
+ALL_PRIMS = GHC/Prim.hi $(foreach way, $(WAYS), GHC/Prim.$(way)_hi)
 
-CLEAN_FILES += $(ALL_HS_OBJS) $(ALL_HS_HIS)
+lib  : $(ALL_PRIMS)
 
-all :: $(LIBNAME)
+boot :: $(ALL_PRIMS)
 
-$(ALL_HS_OBJS) : srcs
-       $(GHC_INPLACE) $(HC_OPTS) --make $(ALL_HS_SRCS) $(ALL_LHS_SRCS)
+CLEAN_FILES += $(ALL_PRIMS)
 
-$(LIBNAME) : $(ALL_HS_OBJS)
-       $(RM) $@
-       $(AR) $(AR_OPTS) $@ $(ALL_HS_OBJS)
-       $(RANLIB) $@
+SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR) -traditional
 
-%.o : %.hs
-       $(GHC_INPLACE) $(HC_OPTS) --make $<
-%.o : %.lhs
-       $(GHC_INPLACE) $(HC_OPTS) --make $<
+# -----------------------------------------------------------------------------
 
 include $(TOP)/mk/target.mk
+