[project @ 2005-02-09 10:11:36 by simonmar]
[ghc-hetmet.git] / mk / package.mk
index e9951cf..098e189 100644 (file)
@@ -1,5 +1,5 @@
 # -----------------------------------------------------------------------------
-# $Id: package.mk,v 1.45 2005/01/23 17:05:31 panne Exp $
+# $Id: package.mk,v 1.47 2005/02/09 10:11:36 simonmar Exp $
 
 ifneq "$(PACKAGE)" ""
 
@@ -166,6 +166,14 @@ SRC_HC_OPTS        += $(GhcLibHcOpts)
 SRC_HC_OPTS     += $(patsubst %, -package %, $(PACKAGE_DEPS))
 endif
 
+#      -fgenerics switches on generation of support code for 
+#              derivable type classes.  This is now off by default,
+#              but we switch it on for the libraries so that we generate
+#              the code in case someone importing wants it.
+ifeq "$(NON_HS_PACKAGE)" ""
+SRC_HC_OPTS    += -fgenerics
+endif
+
 LIBRARY        = libHS$(PACKAGE)$(_way).a
 
 ifeq "$(WAYS)" ""
@@ -220,6 +228,9 @@ else
 INSTALL_IFACES += $(HS_IFACES)
 endif
 
+# install library (could be implicitly specified or explicitly, like libHS*_cbits.a)
+INSTALL_LIBS  += $(LIBRARY)
+
 # -----------------------------------------------------------------------------
 # Dependencies
 
@@ -233,10 +244,7 @@ ifeq "$(STANDALONE_PACKAGE)" "NO"
 SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
 endif
 
-endif # $(PACKAGE) /= ""
-
-# install library (could be implicitly specified or explicitly, like libHS*_cbits.a)
-INSTALL_LIBS  += $(LIBRARY)
+endif # $(PACKAGE) != ""
 
 #--------------------------------------------------------------
 # Building dynamically-linkable libraries for GHCi
@@ -256,7 +264,10 @@ ifeq "$(GhcWithInterpreter)" "YES"
 
 GHCI_LIBRARY = $(patsubst lib%.a,%.o,$(LIBRARY))
 
+ifneq "$(PACKAGE)" ""
 INSTALL_LIBS += $(GHCI_LIBRARY)
+endif
+
 CLEAN_FILES  += $(GHCI_LIBRARY)
 
 all :: $(GHCI_LIBRARY)
@@ -302,7 +313,7 @@ DYLD_LIBRARY = $(patsubst %.a,%_dyn.dylib,$(LIBRARY))
     #   Note: I'm not yet sure about this, but I think it will be convenient for
     #         users not to have to set up DYLD_LIBRARY_PATH to point to the GHC
     #         library dir. -- Wolfgang
-    
+
 $(DYLD_LIBRARY) : $(LIBOBJS) $(STUBOBJS)
        $(CC) -dynamiclib -o $@ $(STUBOBJS) $(LIBOBJS) -flat_namespace -undefined suppress -install_name `pwd`/$@
 else
@@ -312,17 +323,22 @@ $(DYLD_LIBRARY) : $(LIBOBJS) $(STUBOBJS)
        $(CC) -shared -o $@ $(STUBOBJS) $(LIBOBJS)
 endif
 
+ifneq "$(PACKAGE)" ""
 INSTALL_LIBS += $(DYLD_LIBRARY)
+endif
+
 CLEAN_FILES += $(DYLD_LIBRARY)
 
 all :: $(DYLD_LIBRARY)
 
+endif # $(GhcBuildDylibs) == "YES"
 
-endif
+endif # $(LIBRARY) /= ""
 
 # -----------------------------------------------------------------------------
 # Doc building with Haddock
 
+ifneq "$(PACKAGE)" ""
 ifneq "$(NO_HADDOCK_DOCS)" "YES"
 
 HS_PPS = $(addsuffix .raw-hs, $(basename $(filter-out $(EXCLUDED_HADDOCK_SRCS), $(HS_SRCS))))
@@ -376,7 +392,7 @@ install-docs :: $(HTML_DOC)
 
 endif # HS_PPS
 endif # NO_HADDOCK_DOCS
+endif # $(PACKAGE) /= ""
 
 # -----------------------------------------------------------------------------
 
-endif # $(LIBRARY) /= ""