Remove redundant imports
[ghc.git] / ghc.mk
diff --git a/ghc.mk b/ghc.mk
index 611d817..4aea480 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -138,12 +138,14 @@ endif
 endif
 
 include mk/ways.mk
-include mk/warnings.mk
 
 # (Optional) build-specific configuration
 include mk/custom-settings.mk
-SRC_CC_OPTS     += $(WERROR)
-SRC_HC_OPTS     += $(WERROR)
+
+# The user can reset SRC_HC_OPTS from mk/build.mk. Since we try to append
+# '-Wall' to it in mk/warnings.mk, we have to include mk/warnings.mk after
+# mk/custom-settings.mk.
+include mk/warnings.mk
 
 # -----------------------------------------------------------------------------
 # Check for inconsistent settings, after reading mk/build.mk.
@@ -515,7 +517,6 @@ $(foreach pkg,$(PACKAGES_STAGE1),$(eval $(call fixed_pkg_dep,$(pkg),dist-install
 # eachother, so we can configure them in parallel.
 utils/ghc-pwd/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/ghc-cabal/dist-install/package-data.mk: $(fixed_pkg_prev)
-utils/dll-split/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/hpc/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/ghc-pkg/dist-install/package-data.mk: $(fixed_pkg_prev)
 utils/hsc2hs/dist-install/package-data.mk: $(fixed_pkg_prev)
@@ -538,6 +539,7 @@ ghc/stage2/package-data.mk: compiler/stage2/package-data.mk
 # all the other libraries' package-data.mk files.
 utils/haddock/dist/package-data.mk: compiler/stage2/package-data.mk
 utils/ghctags/dist-install/package-data.mk: compiler/stage2/package-data.mk
+utils/check-api-annotations/dist-install/package-data.mk: compiler/stage2/package-data.mk
 utils/mkUserGuidePart/dist/package-data.mk: compiler/stage2/package-data.mk
 
 # add the final package.conf dependency: ghc-prim depends on RTS
@@ -652,6 +654,7 @@ BUILD_DIRS += utils/hsc2hs
 BUILD_DIRS += utils/ghc-pkg
 BUILD_DIRS += utils/testremove
 BUILD_DIRS += utils/ghctags
+BUILD_DIRS += utils/check-api-annotations
 BUILD_DIRS += utils/dll-split
 BUILD_DIRS += utils/ghc-pwd
 BUILD_DIRS += utils/ghc-cabal
@@ -705,6 +708,7 @@ ifneq "$(CrossCompiling) $(Stage1Only)" "NO NO"
 BUILD_DIRS := $(filter-out utils/haddock,$(BUILD_DIRS))
 BUILD_DIRS := $(filter-out utils/haddock/doc,$(BUILD_DIRS))
 BUILD_DIRS := $(filter-out utils/ghctags,$(BUILD_DIRS))
+BUILD_DIRS := $(filter-out utils/check-api-annotations,$(BUILD_DIRS))
 BUILD_DIRS := $(filter-out utils/mkUserGuidePart,$(BUILD_DIRS))
 endif
 endif # CLEANING
@@ -871,17 +875,17 @@ install_bins: $(INSTALL_BINS) $(INSTALL_SCRIPTS)
        for i in $(INSTALL_BINS); do \
                $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(bindir)" ;  \
        done
+ifneq "$(INSTALL_SCRIPTS)" ""
        for i in $(INSTALL_SCRIPTS); do \
                $(INSTALL_SCRIPT) $(INSTALL_OPTS) $$i "$(DESTDIR)$(bindir)" ;  \
        done
+endif
 
 install_libs: $(INSTALL_LIBS)
        $(call installLibsTo, $(INSTALL_LIBS), "$(DESTDIR)$(ghclibdir)")
 
 install_libexecs:  $(INSTALL_LIBEXECS)
-ifeq "$(INSTALL_LIBEXECS)" ""
-       @:
-else
+ifneq "$(INSTALL_LIBEXECS)" ""
        $(INSTALL_DIR) "$(DESTDIR)$(ghclibexecdir)/bin"
        for i in $(INSTALL_LIBEXECS); do \
                $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(ghclibexecdir)/bin"; \
@@ -896,9 +900,11 @@ install_topdirs: $(INSTALL_TOPDIR_BINS) $(INSTALL_TOPDIR_SCRIPTS)
        for i in $(INSTALL_TOPDIR_BINS); do \
                $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(topdir)"; \
        done
+ifneq "$(INSTALL_TOPDIR_SCRIPTS)" ""
        for i in $(INSTALL_TOPDIR_SCRIPTS); do \
                $(INSTALL_SCRIPT) $(INSTALL_OPTS) $$i "$(DESTDIR)$(topdir)"; \
        done
+endif
 
 install_docs: $(INSTALL_DOCS)
        $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
@@ -918,14 +924,14 @@ ifneq "$(INSTALL_LIBRARY_DOCS)" ""
        $(INSTALL_SCRIPT) $(INSTALL_OPTS) libraries/gen_contents_index "$(DESTDIR)$(docdir)/html/libraries/"
 endif
 ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
+# We need to filter out the directories so install doesn't choke on them
        for i in $(INSTALL_HTML_DOC_DIRS); do \
                $(INSTALL_DIR) "$(DESTDIR)$(docdir)/html/`basename $$i`"; \
-    for f in $$i/*; do \
-# We filter out the directories so install doesn't choke on them \
-      if test -f $$f; then \
-                   $(INSTALL_DOC) $(INSTALL_OPTS) "$$f" "$(DESTDIR)$(docdir)/html/`basename $$i`"; \
-      fi \
-    done \
+               for f in $$i/*; do \
+                       if test -f $$f; then \
+                               $(INSTALL_DOC) $(INSTALL_OPTS) "$$f" "$(DESTDIR)$(docdir)/html/`basename $$i`"; \
+                       fi \
+               done \
        done
 endif
 
@@ -1324,6 +1330,9 @@ clean_bindistprep:
        $(call removeTrees,bindistprep/)
 
 distclean : clean
+# Clean the files that ./validate creates.
+       $(call removeFiles,mk/are-validating.mk)
+
 # Clean the files that we ask ./configure to create.
        $(call removeFiles,mk/config.mk)
        $(call removeFiles,mk/install.mk)
@@ -1374,8 +1383,10 @@ distclean : clean
 # Not sure why this is being cleaned here.
        $(call removeTrees,includes/dist-derivedconstants)
 
-# Finally, clean the inplace tree.
-       $(call removeTrees,inplace)
+# Also clean Windows-only inplace directories.
+# Don't delete 'inplace' itself, it contains source files.
+       $(call removeTrees,inplace/mingw)
+       $(call removeTrees,inplace/perl)
 
 maintainer-clean : distclean
        $(call removeFiles,configure mk/config.h.in)