Remove redundant imports
[ghc.git] / ghc.mk
diff --git a/ghc.mk b/ghc.mk
index caa903d..4aea480 100644 (file)
--- a/ghc.mk
+++ b/ghc.mk
@@ -138,21 +138,14 @@ endif
 endif
 
 include mk/ways.mk
-include mk/warnings.mk
 
 # (Optional) build-specific configuration
 include mk/custom-settings.mk
-SRC_CC_OPTS     += -Wall
-SRC_HC_OPTS     += -Wall
-# Don't add -Werror to GhcStage1HcOpts, because otherwise validate may
-# unnecessarily fail during the stage1 build when booting with an older
-# compiler.
-# It would be better to only exclude certain warnings from becoming errors
-# (e.g. '-Werror -Wno-error=unused-imports -Wno-error=...'), but -Wno-error
-# isn't supported yet (https://ghc.haskell.org/trac/ghc/wiki/Design/Warnings).
-SRC_CC_OPTS     += $(WERROR)
-GhcStage2HcOpts += $(WERROR)
-GhcLibHcOpts    += $(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.
@@ -882,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"; \
@@ -907,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)"
@@ -929,7 +924,7 @@ 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
+# 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 \