X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Fpackage.mk;h=7e2cd0af09b4894b575ffd1c50ea92cfd36ec003;hb=3321ef43e1f5792ff97f69c665a2703450c6081d;hp=e9951cff7d31a015e8643243f4fffa4cd688e73f;hpb=fa8246c79fa10ff6785888b95acdf1b3cfb59d9b;p=ghc-hetmet.git diff --git a/mk/package.mk b/mk/package.mk index e9951cf..7e2cd0a 100644 --- a/mk/package.mk +++ b/mk/package.mk @@ -1,5 +1,5 @@ # ----------------------------------------------------------------------------- -# $Id: package.mk,v 1.45 2005/01/23 17:05:31 panne Exp $ +# $Id: package.mk,v 1.53 2005/04/15 18:13:34 sof Exp $ ifneq "$(PACKAGE)" "" @@ -154,19 +154,39 @@ endif # $(way) == "" # ----------------------------------------------------------------------------- # Building the static library libHS.a +SRC_HSC2HS_OPTS += -I. + ifeq "$(STANDALONE_PACKAGE)" "NO" HC = $(GHC_INPLACE) -endif - -SRC_HSC2HS_OPTS += -I. +IGNORE_PACKAGE_FLAG = -ignore-package +else +# Only use -ignore-package if supported by HC; i.e., ghc-6.3 and later. +# (Don't like the use of slow $(shell ..) in Makefiles, but can't see a way around it here.) +ifeq "$(strip $(GHC))" "" +IGNORE_PACKAGE_FLAG = -ignore-package +else +# Making the assumption here that standalone packages will be using mk/config.mk:GHC +IGNORE_PACKAGE_FLAG = $(shell if (test $(GhcCanonVersion) -ge 603); then echo "-ignore-package"; else echo "-package-name"; fi) +endif +endif # STANDALONE_PACKAGE ifeq "$(NON_HS_PACKAGE)" "" -SRC_HC_OPTS += -ignore-package $(PACKAGE) +SRC_HC_OPTS += $(IGNORE_PACKAGE_FLAG) $(PACKAGE) 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 + +ifndef LIBRARY LIBRARY = libHS$(PACKAGE)$(_way).a +endif ifeq "$(WAYS)" "" WAYS = $(GhcLibWays) @@ -233,10 +253,14 @@ ifeq "$(STANDALONE_PACKAGE)" "NO" SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR) endif -endif # $(PACKAGE) /= "" +endif # $(PACKAGE) != "" -# install library (could be implicitly specified or explicitly, like libHS*_cbits.a) -INSTALL_LIBS += $(LIBRARY) +#-------------------------------------------------------------- +# Installation + +ifneq "$(NO_INSTALL_LIBRARY)" "YES" +INSTALL_LIBS += $(LIBRARY) $(GHCI_LIBRARY) +endif #-------------------------------------------------------------- # Building dynamically-linkable libraries for GHCi @@ -254,9 +278,14 @@ ifneq "$(LIBRARY)" "" ifeq "$(way)" "" ifeq "$(GhcWithInterpreter)" "YES" +ifndef GHCI_LIBRARY GHCI_LIBRARY = $(patsubst lib%.a,%.o,$(LIBRARY)) +endif +ifneq "$(NO_INSTALL_LIBRARY)" "YES" INSTALL_LIBS += $(GHCI_LIBRARY) +endif + CLEAN_FILES += $(GHCI_LIBRARY) all :: $(GHCI_LIBRARY) @@ -302,7 +331,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 +341,22 @@ $(DYLD_LIBRARY) : $(LIBOBJS) $(STUBOBJS) $(CC) -shared -o $@ $(STUBOBJS) $(LIBOBJS) endif +ifneq "$(NO_INSTALL_LIBRARY)" "YES" 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 +410,7 @@ install-docs :: $(HTML_DOC) endif # HS_PPS endif # NO_HADDOCK_DOCS +endif # $(PACKAGE) /= "" # ----------------------------------------------------------------------------- -endif # $(LIBRARY) /= ""