1 # -----------------------------------------------------------------------------
3 # (c) 2009 The University of Glasgow
5 # This file is part of the GHC build system.
7 # To understand how the build system works and how to modify it, see
8 # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
11 # -----------------------------------------------------------------------------
15 # * finish installation
16 # * Windows: should we have ghc-pkg-<version>?
17 # * should we be stripping things?
18 # * install libgmp.a, gmp.h
19 # * need to fix Cabal for new Windows layout, see
20 # Distribution/Simple/GHC.configureToolchain.
21 # * remove old Makefiles, add new stubs for building in subdirs
23 # * docs/docbook-cheat-sheet/Makefile
24 # * docs/ext-core/Makefile
26 # * docs/storage-mgmt/Makefile
28 # * rts/dotnet/Makefile
30 # * optionally install stage3?
31 # * add Makefiles for the rest of the utils/ programs that aren't built
32 # by default (need to exclude them from 'make all' too)
34 # Tickets we can now close, or fix and close:
36 # * 1693 make distclean
40 # * per-source-file dependencies instead of one .depend file?
41 # * eliminate undefined variables, and use --warn-undefined-variables?
42 # * put outputs from different ways in different subdirs of distdir/build,
43 # then we don't have to use -osuf/-hisuf. We would have to install
44 # them in different places too, so we'd need ghc-pkg support for packages
46 # * make PACKAGES generated by './configure' or 'perl boot'?
47 # * we should use a directory of package.conf files rather than a single
48 # file for the inplace package database, so that we can express
49 # dependencies more accurately. Otherwise it's possible to get into
50 # a state where the package database is out of date, and the build
51 # system doesn't know.
53 # Approximate build order.
55 # The actual build order is defined by dependencies, and the phase
56 # ordering used to ensure correct ordering of makefile-generation; see
57 # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture/Idiom/PhaseOrdering
59 # * With bootstrapping compiler:
60 # o Build utils/ghc-cabal
61 # o Build utils/ghc-pkg
62 # o Build utils/hsc2hs
64 # o configure, generate package-data.mk and inplace-pkg-info
65 # o register each package into inplace/lib/package.conf
67 # * With bootstrapping compiler:
68 # o Build libraries/{filepath,hpc,extensible-exceptions,Cabal}
69 # o Build compiler (stage 1)
73 # o Build utils/* (except haddock)
74 # o Build compiler (stage 2)
76 # o Build utils/haddock
77 # o Build compiler (stage 3) (optional)
82 .PHONY: default all haddock
84 # We need second expansion for the way we handle directories, so that
86 # expands to the directory of a rule that uses a % pattern.
91 # Catch make if it runs away into an infinite loop
92 ifeq "$(MAKE_RESTARTS)" ""
93 else ifeq "$(MAKE_RESTARTS)" "1"
94 else ifeq "$(MAKE_RESTARTS)" "2"
96 $(error Make has restarted itself $(MAKE_RESTARTS) times; is there a makefile bug?)
99 # Just bring makefiles up to date:
100 .PHONY: just-makefiles
104 ifneq "$(CLEANING)" "YES"
108 # -----------------------------------------------------------------------------
109 # Misc GNU make utils
112 space=$(nothing) $(nothing)
115 # Cancel all suffix rules. Ideally we'd like to have 'make -r' turned on
116 # by default, because that disables all the implicit rules, but there doesn't
117 # seem to be a good way to do that. This turns off all the old-style suffix
118 # rules, which does half the job and speeds up make quite a bit:
121 # -----------------------------------------------------------------------------
123 # to see the effective value used for a Makefile variable, do
124 # make show VALUE=MY_VALUE
128 @echo '$(VALUE)="$($(VALUE))"'
130 # -----------------------------------------------------------------------------
131 # Include subsidiary build-system bits
135 ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
137 ifeq "$(ProjectVersion)" ""
138 $(error Please run ./configure first)
144 # (Optional) build-specific configuration
145 include mk/custom-settings.mk
147 ifeq "$(findstring clean,$(MAKECMDGOALS))" ""
148 ifeq "$(GhcLibWays)" ""
149 $(error $$(GhcLibWays) is empty, it must contain at least one way)
153 # -----------------------------------------------------------------------------
154 # Utility definitions
156 include rules/make-command.mk
158 # -----------------------------------------------------------------------------
159 # Macros for standard targets
161 include rules/all-target.mk
162 include rules/clean-target.mk
164 # -----------------------------------------------------------------------------
167 $(eval $(call clean-target,inplace,,inplace))
169 # -----------------------------------------------------------------------------
170 # Whether to build dependencies or not
172 # When we're just doing 'make clean' or 'make show', then we don't need
173 # to build dependencies.
175 ifneq "$(findstring clean,$(MAKECMDGOALS))" ""
176 NO_INCLUDE_DEPS = YES
177 NO_INCLUDE_PKGDATA = YES
179 ifneq "$(findstring bootstrapping-files,$(MAKECMDGOALS))" ""
180 NO_INCLUDE_DEPS = YES
181 NO_INCLUDE_PKGDATA = YES
183 ifeq "$(findstring show,$(MAKECMDGOALS))" "show"
184 NO_INCLUDE_DEPS = YES
185 # We want package-data.mk for show
188 # We don't haddock the bootstrapping libraries
189 libraries/hpc_dist-boot_DO_HADDOCK = NO
190 libraries/Cabal_dist-boot_DO_HADDOCK = NO
191 libraries/extensible-exceptions_dist-boot_DO_HADDOCK = NO
192 libraries/filepath_dist-boot_DO_HADDOCK = NO
193 libraries/binary_dist-boot_DO_HADDOCK = NO
194 libraries/bin-package-db_dist-boot_DO_HADDOCK = NO
196 # -----------------------------------------------------------------------------
199 include rules/way-prelims.mk
201 $(foreach way,$(ALL_WAYS),\
202 $(eval $(call way-prelims,$(way))))
204 # -----------------------------------------------------------------------------
207 include rules/distdir-way-opts.mk
209 # -----------------------------------------------------------------------------
210 # Finding source files and object files
212 include rules/hs-sources.mk
213 include rules/c-sources.mk
214 include rules/includes-sources.mk
215 include rules/hs-objs.mk
216 include rules/c-objs.mk
217 include rules/cmm-objs.mk
219 # -----------------------------------------------------------------------------
222 # Suffix rules cause "make clean" to fail on Windows (trac #3233)
223 # so we don't make any when cleaning.
224 ifneq "$(CLEANING)" "YES"
226 include rules/hs-suffix-rules-srcdir.mk
227 include rules/hs-suffix-rules.mk
229 # -----------------------------------------------------------------------------
230 # Suffix rules for .hi files
232 include rules/hi-rule.mk
234 $(foreach way,$(ALL_WAYS),\
235 $(eval $(call hi-rule,$(way))))
237 #-----------------------------------------------------------------------------
238 # C-related suffix rules
240 include rules/c-suffix-rules.mk
242 #-----------------------------------------------------------------------------
243 # CMM-related suffix rules
245 include rules/cmm-suffix-rules.mk
249 # -----------------------------------------------------------------------------
250 # Building package-data.mk files from .cabal files
252 include rules/package-config.mk
254 # -----------------------------------------------------------------------------
255 # Building dependencies
257 include rules/build-dependencies.mk
259 # -----------------------------------------------------------------------------
260 # Build package-data.mk files
262 include rules/build-package-data.mk
264 # -----------------------------------------------------------------------------
265 # Build and install a program
267 include rules/build-prog.mk
268 include rules/shell-wrapper.mk
270 # -----------------------------------------------------------------------------
271 # Build a perl script
273 include rules/build-perl.mk
275 # -----------------------------------------------------------------------------
278 include rules/build-package.mk
279 include rules/build-package-way.mk
280 include rules/haddock.mk
281 include rules/tags-package.mk
283 # -----------------------------------------------------------------------------
284 # Registering hand-written package descriptions (used in libffi and rts)
286 include rules/manual-package-config.mk
288 # -----------------------------------------------------------------------------
291 include rules/docbook.mk
293 # -----------------------------------------------------------------------------
296 include rules/bindist.mk
298 # -----------------------------------------------------------------------------
301 define addPackage # args: $1 = package, $2 = condition
303 ifeq "$$(CLEANING)" "YES"
315 INTREE_ONLY_PACKAGES := haskeline mtl terminfo utf8-string xhtml
317 $(foreach p,$(INTREE_ONLY_PACKAGES),$(eval libraries/$p_dist-install_HADDOCK_ME = NO))
319 $(eval $(call addPackage,ghc-prim))
320 ifeq "$(CLEANING)" "YES"
321 $(eval $(call addPackage,integer-gmp))
322 $(eval $(call addPackage,integer-simple))
324 $(eval $(call addPackage,$(INTEGER_LIBRARY)))
326 $(eval $(call addPackage,base))
327 $(eval $(call addPackage,filepath))
328 $(eval $(call addPackage,array))
329 $(eval $(call addPackage,bytestring))
330 $(eval $(call addPackage,containers))
332 $(eval $(call addPackage,Win32,($$(Windows),YES)))
333 $(eval $(call addPackage,unix,($$(Windows),NO)))
335 $(eval $(call addPackage,old-locale))
336 $(eval $(call addPackage,old-time))
337 $(eval $(call addPackage,time))
338 $(eval $(call addPackage,directory))
339 $(eval $(call addPackage,process))
340 $(eval $(call addPackage,random))
341 $(eval $(call addPackage,extensible-exceptions))
342 $(eval $(call addPackage,haskell98))
343 $(eval $(call addPackage,haskell2010))
344 $(eval $(call addPackage,hpc))
345 $(eval $(call addPackage,pretty))
346 $(eval $(call addPackage,template-haskell))
347 $(eval $(call addPackage,Cabal))
348 $(eval $(call addPackage,binary))
349 $(eval $(call addPackage,bin-package-db))
350 $(eval $(call addPackage,mtl))
351 $(eval $(call addPackage,utf8-string))
352 $(eval $(call addPackage,xhtml))
354 $(eval $(call addPackage,terminfo,($$(Windows),NO)))
356 $(eval $(call addPackage,haskeline))
358 $(foreach pkg,$(EXTRA_PACKAGES),$(eval $(call addPackage,$(pkg))))
361 # ------------------- Adding DPH packaes ---------------
363 # The DPH packages are added when:
364 # * not BootingFromHc (they aren't necessary for bootstrapping), and
365 # * not GhcProfiled (they need TH, so can't be compiled by a -prof GHC), or
366 # * CLEANING: when cleaning we always enable everything
368 # if !BootingFromHc && (!GhcProfiled || CLEANING)
370 ifneq "$(BootingFromHc)" "YES"
371 ifneq "$(GhcProfiled) $(CLEANING)" "NO YES"
372 PACKAGES_STAGE2 += dph/dph-base \
373 dph/dph-prim-interface \
379 endif # BootingFromHc
380 # -------------------------------------------------------
383 # We assume that the stage0 compiler has a suitable bytestring package,
384 # so we don't have to include it below.
385 BOOT_PKGS = Cabal hpc extensible-exceptions binary bin-package-db
387 BOOT_PKG_CONSTRAINTS := $(foreach p,$(BOOT_PKGS),--constraint "$p == $(shell grep -i "^Version:" libraries/$p/$p.cabal | sed "s/[^0-9.]//g")")
389 # The actual .a and .so/.dll files: needed for dependencies.
390 ALL_STAGE1_LIBS = $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_v_LIB))
391 ifeq "$(BuildSharedLibs)" "YES"
392 ALL_STAGE1_LIBS += $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_dyn_LIB))
394 BOOT_LIBS = $(foreach lib,$(BOOT_PKGS),$(libraries/$(lib)_dist-boot_v_LIB))
396 OTHER_LIBS = libffi/dist-install/build/libHSffi$(v_libsuf) libffi/dist-install/build/HSffi.o
397 ifeq "$(BuildSharedLibs)" "YES"
398 OTHER_LIBS += libffi/dist-install/build/libHSffi$(dyn_libsuf)
401 # We cannot run ghc-cabal to configure a package until we have
402 # configured and registered all of its dependencies. So the following
403 # hack forces all the configure steps to happen in exactly the following order:
405 # $(PACKAGES) ghc(stage2) $(PACKAGES_STAGE2)
407 # Ideally we should use the correct dependencies here to allow more
408 # parallelism, but we don't know the dependencies until we've
409 # generated the pacakge-data.mk files.
411 libraries/$1/$2/package-data.mk : $$(GHC_PKG_INPLACE) $$(fixed_pkg_prev)
412 fixed_pkg_prev:=libraries/$1/$2/package-data.mk
415 ifneq "$(BINDIST)" "YES"
417 $(foreach pkg,$(PACKAGES),$(eval $(call fixed_pkg_dep,$(pkg),dist-install)))
419 # the GHC package doesn't live in libraries/, so we add its dependency manually:
420 compiler/stage2/package-data.mk: $(fixed_pkg_prev)
421 fixed_pkg_prev:=compiler/stage2/package-data.mk
423 # and continue with PACKAGES_STAGE2, which depend on GHC:
424 $(foreach pkg,$(PACKAGES_STAGE2),$(eval $(call fixed_pkg_dep,$(pkg),dist-install)))
426 ghc/stage1/package-data.mk: compiler/stage1/package-data.mk
427 ghc/stage2/package-data.mk: compiler/stage2/package-data.mk
428 # haddock depends on ghc and some libraries, but depending on GHC's
429 # package-data.mk is sufficient, as that in turn depends on all the
431 utils/haddock/dist/package-data.mk: compiler/stage2/package-data.mk
433 utils/ghc-pkg/dist-install/package-data.mk: compiler/stage2/package-data.mk
434 utils/hsc2hs/dist-install/package-data.mk: compiler/stage2/package-data.mk
435 utils/compare_sizes/dist/package-data.mk: compiler/stage2/package-data.mk
437 # add the final two package.conf dependencies: ghc-prim depends on RTS,
438 # and RTS depends on libffi.
439 libraries/ghc-prim/dist-install/package-data.mk : rts/package.conf.inplace
440 rts/package.conf.inplace : libffi/package.conf.inplace
443 # -----------------------------------------------------------------------------
446 # Don't try to delete directories:
449 # Create build directories on demand. NB. the | below: this indicates
450 # that $(MKDIRHIER) is an order-only dependency, which means that this
451 # rule fires after building mkdirhier, but we won't try to recreate
452 # directories if mkdirhier changes.
456 # -----------------------------------------------------------------------------
457 # Special magic for the ghc-prim package
459 # We want the ghc-prim package to include the GHC.Prim module when it
460 # is registered, but not when it is built, because GHC.Prim is not a
461 # real source module, it is built-in to GHC. The old build system did
462 # this using Setup.hs, but we can't do that here, so we have a flag to
463 # enable GHC.Prim in the .cabal file (so that the ghc-prim package
464 # remains compatible with the old build system for the time being).
465 # GHC.Prim module in the ghc-prim package with a flag:
467 libraries/ghc-prim_CONFIGURE_OPTS += --flag=include-ghc-prim
469 # And then we strip it out again before building the package:
470 define libraries/ghc-prim_PACKAGE_MAGIC
471 libraries/ghc-prim_dist-install_MODULES := $$(filter-out GHC.Prim,$$(libraries/ghc-prim_dist-install_MODULES))
474 PRIMOPS_TXT = $(GHC_COMPILER_DIR)/prelude/primops.txt
476 libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs : $(GENPRIMOP_INPLACE) $(PRIMOPS_TXT) | $$(dir $$@)/.
477 "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers <$(PRIMOPS_TXT) >$@
479 # Required so that Haddock documents the primops.
480 libraries/ghc-prim_dist-install_EXTRA_HADDOCK_SRCS = libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs
482 # -----------------------------------------------------------------------------
483 # Include build instructions from all subdirs
485 # For the rationale behind the build phases, see
486 # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture/Idiom/PhaseOrdering
488 # Setting foo_dist_DISABLE=YES means "in directory foo, for build
489 # "dist", just read the package-data.mk file, do not build anything".
491 # We carefully engineer things so that we can build the
492 # package-data.mk files early on: they depend only on a few tools also
493 # built early. Having got the package-data.mk files built, we can
494 # restart make with up-to-date information about all the packages
495 # (this is phase 0). The remaining problem is the .depend files:
497 # - .depend files in libraries need the stage 1 compiler to build
498 # - ghc/stage1/.depend needs compiler/stage1 built
499 # - compiler/stage1/.depend needs the bootstrap libs built
501 # GHC 6.11+ can build a .depend file without having built the
502 # dependencies of the package, but we can't rely on the bootstrapping
503 # compiler being able to do this, which is why we have to separate the
504 # three phases above.
506 # So this is the final ordering:
508 # Phase 0 : all package-data.mk files
509 # (requires ghc-cabal, ghc-pkg, mkdirhier, dummy-ghc etc.)
510 # Phase 1 : .depend files for bootstrap libs
512 # Phase 2 : compiler/stage1/.depend
513 # (requires bootstrap libs and genprimopcode)
514 # Phase 3 : ghc/stage1/.depend
515 # (requires compiler/stage1)
517 # The rest : libraries/*/dist-install, compiler/stage2, ghc/stage2
521 ifneq "$(BINDIST)" "YES"
530 libraries/Cabal/doc \
534 ifneq "$(GhcUnregisterised)" "YES"
540 ifneq "$(BINDIST)" "YES"
554 ifneq "$(BINDIST)" "YES"
565 ifneq "$(CLEANING)" "YES"
567 $(patsubst %, libraries/%, $(PACKAGES))
570 ifneq "$(BootingFromHc)" "YES"
575 ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
576 BUILD_DIRS += libraries/integer-gmp/gmp
588 ifeq "$(Windows)" "YES"
593 ifneq "$(BINDIST)" "YES"
595 utils/mkUserGuidePart
598 BUILD_DIRS += utils/count_lines
599 BUILD_DIRS += utils/compare_sizes
601 ifneq "$(CLEANING)" "YES"
602 # After compiler/, because these packages depend on it
604 $(patsubst %, libraries/%, $(PACKAGES_STAGE2))
607 # XXX libraries/% must come before any programs built with stage1, see
608 # Note [lib-depends].
611 $(foreach lib,$(BOOT_PKGS),$(eval \
612 libraries/$(lib)_dist-boot_DISABLE = YES))
615 ifneq "$(findstring $(phase),0 1)" ""
616 # We can build deps for compiler/stage1 in phase 2
617 compiler_stage1_DISABLE = YES
620 ifneq "$(findstring $(phase),0 1 2)" ""
621 ghc_stage1_DISABLE = YES
624 ifneq "$(findstring $(phase),0 1 2 3)" ""
625 # In phases 0-3, we disable stage2-3, the full libraries and haddock
626 utils/haddock_dist_DISABLE = YES
627 utils/runghc_dist_DISABLE = YES
628 utils/ghctags_dist_DISABLE = YES
629 utils/hpc_dist_DISABLE = YES
630 utils/hsc2hs_dist-install_DISABLE = YES
631 utils/ghc-pkg_dist-install_DISABLE = YES
632 utils/mkUserGuidePart_dist_DISABLE = YES
633 utils/compare_sizes_dist_DISABLE = YES
634 compiler_stage2_DISABLE = YES
635 compiler_stage3_DISABLE = YES
636 ghc_stage2_DISABLE = YES
637 ghc_stage3_DISABLE = YES
638 $(foreach lib,$(PACKAGES) $(PACKAGES_STAGE2),$(eval \
639 libraries/$(lib)_dist-install_DISABLE = YES))
642 ifneq "$(CLEANING)" "YES"
643 ifeq "$(INTEGER_LIBRARY)" "integer-gmp"
644 libraries/base_dist-install_CONFIGURE_OPTS += --flags=-integer-simple
646 ifeq "$(INTEGER_LIBRARY)" "integer-simple"
647 libraries/base_dist-install_CONFIGURE_OPTS += --flags=integer-simple
649 $(error Unknown integer library: $(INTEGER_LIBRARY))
654 # These packages don't pass the Cabal checks because hs-source-dirs
655 # points outside the source directory. This isn't a real problem in
656 # these cases, so we just skip checking them.
657 CHECKED_libraries/dph/dph-seq = YES
658 CHECKED_libraries/dph/dph-par = YES
659 # In compiler's case, include-dirs points outside of the source tree
660 CHECKED_compiler = YES
662 include $(patsubst %, %/ghc.mk, $(BUILD_DIRS))
664 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
665 GhcLibHcOpts += -fno-warn-deprecated-flags
666 GhcBootLibHcOpts += -fno-warn-deprecated-flags
668 # ----------------------------------------------
669 # Per-package compiler flags
671 # If you want to add per-package compiler flags, this
672 # is the place to do it. Do it like this for package <pkg>
674 # libraries/<pkg>_dist-boot_HC_OPTS += -Wwarn
675 # libraries/<pkg>_dist-install_HC_OPTS += -Wwarn
678 # Add $(GhcLibHcOpts) to all library builds
679 $(foreach pkg,$(PACKAGES) $(PACKAGES_STAGE2),$(eval libraries/$(pkg)_dist-install_HC_OPTS += $$(GhcLibHcOpts)))
681 # ----------------------------------------------
682 # A useful pseudo-target
684 stage1_libs : $(ALL_STAGE1_LIBS)
686 ifeq "$(HADDOCK_DOCS)" "YES"
687 libraries/index.html: $(ALL_HADDOCK_FILES)
688 cd libraries && sh gen_contents_index --inplace
689 $(eval $(call all-target,library_doc_index,libraries/index.html))
690 INSTALL_LIBRARY_DOCS += libraries/*.html libraries/*.gif libraries/*.css libraries/*.js
691 CLEAN_FILES += libraries/doc-index* libraries/haddock*.css \
692 libraries/haddock*.js libraries/index*.html libraries/*.gif
695 ifeq "$(CHECK_PACKAGES)" "YES"
699 # -----------------------------------------------------------------------------
700 # Bootstrapping libraries
702 # We need to build a few libraries with the installed GHC, since GHC itself
703 # and some of the tools depend on them:
705 ifneq "$(BINDIST)" "YES"
707 ifneq "$(BOOTSTRAPPING_CONF)" ""
708 ifeq "$(wildcard $(BOOTSTRAPPING_CONF))" ""
709 $(shell echo "[]" >$(BOOTSTRAPPING_CONF))
713 $(eval $(call clean-target,$(BOOTSTRAPPING_CONF),,$(BOOTSTRAPPING_CONF)))
715 # These three libraries do not depend on each other, so we can build
718 $(eval $(call build-package,libraries/hpc,dist-boot,0))
719 $(eval $(call build-package,libraries/extensible-exceptions,dist-boot,0))
720 $(eval $(call build-package,libraries/Cabal,dist-boot,0))
721 $(eval $(call build-package,libraries/binary,dist-boot,0))
722 $(eval $(call build-package,libraries/bin-package-db,dist-boot,0))
724 # register the boot packages in strict sequence, because running
725 # multiple ghc-pkgs in parallel doesn't work (registrations may get
728 $(foreach pkg,$(BOOT_PKGS),$(eval $(call fixed_pkg_dep,$(pkg),dist-boot)))
730 compiler/stage1/package-data.mk : \
731 libraries/Cabal/dist-boot/package-data.mk \
732 libraries/hpc/dist-boot/package-data.mk \
733 libraries/extensible-exceptions/dist-boot/package-data.mk \
734 libraries/bin-package-db/dist-boot/package-data.mk
736 # These are necessary because the bootstrapping compiler may not know
737 # about cross-package dependencies:
738 $(compiler_stage1_depfile_haskell) : $(BOOT_LIBS)
739 $(ghc_stage1_depfile_haskell) : $(compiler_stage1_v_LIB)
741 # A few careful dependencies between bootstrapping packages. When we
742 # can rely on the stage 0 compiler being able to generate
743 # cross-package dependencies with -M (fixed in GHC 6.12.1) we can drop
744 # these, and also some of the phases.
746 # If you miss any out here, then 'make -j8' will probably tell you.
748 libraries/bin-package-db/dist-boot/build/Distribution/InstalledPackageInfo/Binary.$(v_osuf) : libraries/binary/dist-boot/build/Data/Binary.$(v_hisuf) libraries/Cabal/dist-boot/build/Distribution/InstalledPackageInfo.$(v_hisuf)
750 $(foreach pkg,$(BOOT_PKGS),$(eval libraries/$(pkg)_dist-boot_HC_OPTS += $$(GhcBootLibHcOpts)))
752 # Make sure we have all the GHCi libs by the time we've built
753 # ghc-stage2. DPH includes a bit of Template Haskell which needs the
754 # GHCI libs, and we don't have a better way to express that dependency.
756 GHCI_LIBS = $(foreach lib,$(PACKAGES),$(libraries/$(lib)_dist-install_GHCI_LIB)) \
757 $(compiler_stage2_GHCI_LIB)
759 ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(GHCI_LIBS)
763 # -----------------------------------------------------------------------------
764 # Creating a local mingw copy on Windows
766 ifeq "$(Windows)" "YES"
768 install : install_mingw
769 .PHONY: install_mingw
770 install_mingw : $(INPLACE_MINGW)
771 "$(CP)" -Rp $(INPLACE_MINGW) $(prefix)
773 install : install_perl
775 install_perl : $(INPLACE_PERL)
776 "$(CP)" -Rp $(INPLACE_PERL) $(prefix)
780 ifneq "$(BINDIST)" "YES"
781 $(ghc-prim-$(libraries/ghc-prim_dist-install_VERSION)_HADDOCK_FILE): \
782 libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs \
783 libraries/ghc-prim/dist-install/build/autogen/GHC/PrimopWrappers.hs
786 libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs: \
787 $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) \
789 "$(GENPRIMOP_INPLACE)" --make-haskell-source < $< > $@
791 libraries/ghc-prim/dist-install/build/autogen/GHC/PrimopWrappers.hs: \
792 $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) \
794 "$(GENPRIMOP_INPLACE)" --make-haskell-wrappers < $< > $@
802 # -----------------------------------------------------------------------------
805 install: install_packages install_libs install_libexecs install_headers \
806 install_libexec_scripts install_bins install_docs \
809 install_bins: $(INSTALL_BINS)
810 $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
811 for i in $(INSTALL_BINS); do \
812 $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(bindir)" ; \
815 install_libs: $(INSTALL_LIBS)
816 $(INSTALL_DIR) "$(DESTDIR)$(ghclibdir)"
817 for i in $(INSTALL_LIBS); do \
820 $(INSTALL_DATA) $(INSTALL_OPTS) $$i "$(DESTDIR)$(ghclibdir)"; \
821 $(RANLIB) $(DESTDIR)$(ghclibdir)/`basename $$i` ;; \
823 $(INSTALL_DATA) -s $(INSTALL_OPTS) $$i "$(DESTDIR)$(ghclibdir)" ;; \
825 $(INSTALL_SHLIB) $(INSTALL_OPTS) $$i "$(DESTDIR)$(ghclibdir)" ;; \
827 $(INSTALL_SHLIB) $(INSTALL_OPTS) $$i "$(DESTDIR)$(ghclibdir)";; \
829 $(INSTALL_DATA) $(INSTALL_OPTS) $$i "$(DESTDIR)$(ghclibdir)"; \
833 install_libexec_scripts: $(INSTALL_LIBEXEC_SCRIPTS)
834 ifeq "$(INSTALL_LIBEXEC_SCRIPTS)" ""
837 $(INSTALL_DIR) "$(DESTDIR)$(ghclibexecdir)"
838 for i in $(INSTALL_LIBEXEC_SCRIPTS); do \
839 $(INSTALL_SCRIPT) $(INSTALL_OPTS) $$i "$(DESTDIR)$(ghclibexecdir)"; \
843 install_libexecs: $(INSTALL_LIBEXECS)
844 ifeq "$(INSTALL_LIBEXECS)" ""
847 $(INSTALL_DIR) "$(DESTDIR)$(ghclibexecdir)"
848 for i in $(INSTALL_LIBEXECS); do \
849 $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(ghclibexecdir)"; \
851 # We rename ghc-stage2, so that the right program name is used in error
853 "$(MV)" "$(DESTDIR)$(ghclibexecdir)/ghc-stage2" "$(DESTDIR)$(ghclibexecdir)/ghc"
856 install_topdirs: $(INSTALL_TOPDIRS)
857 $(INSTALL_DIR) "$(DESTDIR)$(topdir)"
858 for i in $(INSTALL_TOPDIRS); do \
859 $(INSTALL_PROGRAM) $(INSTALL_BIN_OPTS) $$i "$(DESTDIR)$(topdir)"; \
862 install_headers: $(INSTALL_HEADERS)
863 $(INSTALL_DIR) "$(DESTDIR)$(ghcheaderdir)"
864 for i in $(INSTALL_HEADERS); do \
865 $(INSTALL_HEADER) $(INSTALL_OPTS) $$i "$(DESTDIR)$(ghcheaderdir)"; \
868 install_docs: $(INSTALL_DOCS)
869 $(INSTALL_DIR) "$(DESTDIR)$(docdir)"
870 ifneq "$(INSTALL_DOCS)" ""
871 for i in $(INSTALL_DOCS); do \
872 $(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)"; \
875 $(INSTALL_DIR) $(INSTALL_OPTS) "$(DESTDIR)$(docdir)/html"
876 $(INSTALL_DOC) $(INSTALL_OPTS) docs/index.html "$(DESTDIR)$(docdir)/html"
877 ifneq "$(INSTALL_LIBRARY_DOCS)" ""
878 $(INSTALL_DIR) $(INSTALL_OPTS) "$(DESTDIR)$(docdir)/html/libraries"
879 for i in $(INSTALL_LIBRARY_DOCS); do \
880 $(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)/html/libraries/"; \
882 $(INSTALL_DATA) $(INSTALL_OPTS) libraries/prologue.txt "$(DESTDIR)$(docdir)/html/libraries/"
883 $(INSTALL_SCRIPT) $(INSTALL_OPTS) libraries/gen_contents_index "$(DESTDIR)$(docdir)/html/libraries/"
885 ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
886 for i in $(INSTALL_HTML_DOC_DIRS); do \
887 $(INSTALL_DIR) $(INSTALL_OPTS) "$(DESTDIR)$(docdir)/html/`basename $$i`"; \
888 $(INSTALL_DOC) $(INSTALL_OPTS) $$i/* "$(DESTDIR)$(docdir)/html/`basename $$i`"; \
892 INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
894 # Install packages in the right order, so that ghc-pkg doesn't complain.
895 # Also, install ghc-pkg first.
896 ifeq "$(Windows)" "NO"
897 INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/ghc
898 INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/ghc-pkg
900 INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
901 INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
904 INSTALLED_PACKAGES := $(filter-out $(INTREE_ONLY_PACKAGES),$(PACKAGES))
905 ifeq "$(InstallExtraPackages)" "NO"
906 INSTALLED_PACKAGES := $(filter-out $(EXTRA_PACKAGES), $(INSTALLED_PACKAGES))
909 HIDDEN_PACKAGES = binary
911 define set_INSTALL_DISTDIR
912 # $1 = libraries/base, $2 = dist-install
914 # INSTALL_DISTDIR_libraries/base = dist-install
915 INSTALL_DISTDIR_$1 = $2
918 $(eval $(foreach p,$(INSTALLED_PACKAGES) $(PACKAGES_STAGE2),\
919 $(call set_INSTALL_DISTDIR,libraries/$p,dist-install)))
920 INSTALL_DISTDIR_compiler = stage2
922 ALL_INSTALLED_PACKAGES = $(addprefix libraries/,$(INSTALLED_PACKAGES)) \
924 $(addprefix libraries/,$(PACKAGES_STAGE2))
926 install_packages: install_libexecs
927 install_packages: libffi/package.conf.install rts/package.conf.install
928 $(INSTALL_DIR) "$(DESTDIR)$(topdir)"
929 "$(RM)" $(RM_OPTS_REC) "$(INSTALLED_PACKAGE_CONF)"
930 $(INSTALL_DIR) "$(INSTALLED_PACKAGE_CONF)"
931 "$(INSTALLED_GHC_PKG_REAL)" --force --global-conf "$(INSTALLED_PACKAGE_CONF)" update libffi/package.conf.install
932 "$(INSTALLED_GHC_PKG_REAL)" --force --global-conf "$(INSTALLED_PACKAGE_CONF)" update rts/package.conf.install
933 $(foreach p, $(ALL_INSTALLED_PACKAGES), \
934 $(call make-command, \
935 "$(GHC_CABAL_INPLACE)" install \
936 "$(INSTALLED_GHC_REAL)" \
937 "$(INSTALLED_GHC_PKG_REAL)" \
939 "$(DESTDIR)$(topdir)" \
940 $p $(INSTALL_DISTDIR_$p) \
944 '$(docdir)/html/libraries' \
945 $(RelocatableBuild)))
946 $(foreach p, $(HIDDEN_PACKAGES), \
947 $(call make-command, \
948 "$(INSTALLED_GHC_PKG_REAL)" \
949 --global-conf "$(INSTALLED_PACKAGE_CONF)" hide $p))
951 # -----------------------------------------------------------------------------
952 # Binary distributions
954 ifneq "$(CLEANING)" "YES"
955 # This rule seems to hold some files open on Windows which prevents
956 # cleaning, perhaps due to the $(wildcard).
958 $(eval $(call bindist,.,\
962 configure config.sub config.guess install-sh \
966 $(INPLACE_BIN)/mkdirhier \
967 $(INPLACE_BIN)/ghc-cabal \
968 utils/ghc-pwd/ghc-pwd \
969 $(BINDIST_WRAPPERS) \
970 $(BINDIST_PERL_SOURCES) \
974 $(includes_H_CONFIG) \
975 $(includes_H_PLATFORM) \
976 $(includes_H_FILES) \
977 includes/ghcconfig.h \
978 includes/rts/Config.h \
980 $(INSTALL_LIBEXECS) \
981 $(INSTALL_LIBEXEC_SCRIPTS) \
984 $(INSTALL_MANPAGES) \
986 $(INSTALL_LIBRARY_DOCS) \
987 $(addsuffix /*,$(INSTALL_HTML_DOC_DIRS)) \
989 compiler/stage2/doc \
990 $(wildcard libraries/*/dist-install/doc/) \
991 $(wildcard libraries/*/*/dist-install/doc/) \
992 $(filter-out extra-gcc-opts,$(INSTALL_LIBS)) \
993 $(filter-out %/project.mk mk/config.mk %/mk/install.mk,$(MAKEFILE_LIST)) \
997 libraries/gen_contents_index \
998 libraries/prologue.txt \
999 libraries/dph/LICENSE \
1002 # mk/project.mk gets an absolute path, so we manually include it in
1003 # the bindist with a relative path
1005 BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
1007 unix-binary-dist-prep:
1008 "$(RM)" $(RM_OPTS_REC) bindistprep/
1009 "$(MKDIRHIER)" $(BIN_DIST_PREP_DIR)
1010 set -e; for i in LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
1011 echo "HADDOCK_DOCS = $(HADDOCK_DOCS)" >> $(BIN_DIST_MK)
1012 echo "LATEX_DOCS = $(LATEX_DOCS)" >> $(BIN_DIST_MK)
1013 echo "BUILD_DOCBOOK_HTML = $(BUILD_DOCBOOK_HTML)" >> $(BIN_DIST_MK)
1014 echo "BUILD_DOCBOOK_PS = $(BUILD_DOCBOOK_PS)" >> $(BIN_DIST_MK)
1015 echo "BUILD_DOCBOOK_PDF = $(BUILD_DOCBOOK_PDF)" >> $(BIN_DIST_MK)
1016 echo "BUILD_MAN = $(BUILD_MAN)" >> $(BIN_DIST_MK)
1017 cd $(BIN_DIST_PREP_DIR) && autoreconf
1018 "$(RM)" $(RM_OPTS) $(BIN_DIST_PREP_TAR)
1019 # h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source
1020 # tree then we want to include the real file, not a symlink to it
1021 cd bindistprep && "$(TAR_CMD)" hcf - -T ../$(BIN_DIST_LIST) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
1023 windows-binary-dist-prep:
1024 "$(RM)" $(RM_OPTS_REC) bindistprep/
1025 $(MAKE) prefix=$(TOP)/$(BIN_DIST_PREP_DIR) install
1026 cd bindistprep && "$(TAR_CMD)" cf - $(BIN_DIST_NAME) | bzip2 -c > ../$(BIN_DIST_PREP_TAR_BZ2)
1029 ifeq "$(ISCC_CMD)" ""
1030 @echo No ISCC_CMD, so not making installer
1032 "$(ISCC_CMD)" /O. /Fbindistprep/$(WINDOWS_INSTALLER_BASE) - < distrib/ghc.iss
1035 # tryTimes tries to run its third argument multiple times, until it
1036 # succeeds. Don't call it directly; call try10Times instead.
1037 # The first and second argument to tryTimes are lists of values.
1038 # The length of the first argument is the number of times we have
1039 # already tried. The length of the second argument is the number more
1040 # times we will try.
1041 tryTimes = $(if $2, \
1042 { echo 'Try $(words x $1): $3' ; $3 ; } || \
1043 $(call tryTimes,x $1,$(wordlist 2,$(words $2),$2),$3), \
1046 # Try to run the argument 10 times. If all 10 fail, fail.
1047 try10Times = $(call tryTimes,,x x x x x x x x x x,$1) { echo Failed; false; }
1049 .PHONY: publish-binary-dist
1050 publish-binary-dist:
1051 $(call try10Times,$(PublishCp) $(BIN_DIST_TAR_BZ2) $(PublishLocation)/dist)
1052 ifeq "$(mingw32_TARGET_OS)" "1"
1053 $(call try10Times,$(PublishCp) $(WINDOWS_INSTALLER) $(PublishLocation)/dist)
1056 .PHONY: publish-docs
1058 $(call try10Times,$(PublishCp) -r bindisttest/installed/share/doc/ghc/* $(PublishLocation)/docs)
1060 # -----------------------------------------------------------------------------
1061 # Source distributions
1069 # A source dist is built from a complete build tree, because we
1070 # require some extra files not contained in a darcs checkout: the
1071 # output from Happy and Alex, for example.
1073 # The steps performed by 'make dist' are as follows:
1074 # - create a complete link-tree of the current build tree in /tmp
1075 # - run 'make distclean' on that tree
1076 # - remove a bunch of other files that we know shouldn't be in the dist
1077 # - tar up first the extralibs package, then the main source package
1080 # Directory in which we're going to build the src dist
1082 SRC_DIST_NAME=ghc-$(ProjectVersion)
1083 SRC_DIST_DIR=$(shell pwd)/$(SRC_DIST_NAME)
1086 # Files to include in source distributions
1088 SRC_DIST_DIRS = mk rules docs distrib bindisttest libffi includes utils docs rts compiler ghc driver libraries ghc-tarballs
1090 configure.ac config.guess config.sub configure \
1091 aclocal.m4 README ANNOUNCE HACKING LICENSE Makefile install-sh \
1092 ghc.spec.in ghc.spec extra-gcc-opts.in VERSION \
1093 boot boot-pkgs packages ghc.mk
1095 SRC_DIST_TARBALL = $(SRC_DIST_NAME)-src.tar.bz2
1098 echo $(ProjectVersion) >VERSION
1103 # $(call sdist_file,compiler,stage2,cmm,Foo/Bar,CmmLex,x)
1104 # to copy the generated file that replaces compiler/cmm/Foo/Bar/CmmLex.x, where
1105 # "stage2" is the dist dir.
1107 "$(CP)" $1/$2/build/$4/$5.hs $(SRC_DIST_DIR)/$1/$3/$4
1108 mv $(SRC_DIST_DIR)/$1/$3/$4/$5.$6 $(SRC_DIST_DIR)/$1/$3/$4/$5.$6.source
1113 "$(RM)" $(RM_OPTS_REC) $(SRC_DIST_DIR)
1114 "$(RM)" $(RM_OPTS) $(SRC_DIST_TARBALL)
1115 mkdir $(SRC_DIST_DIR)
1116 cd $(SRC_DIST_DIR) && for i in $(SRC_DIST_DIRS); do mkdir $$i; ( cd $$i && lndir $(TOP)/$$i ); done
1117 cd $(SRC_DIST_DIR) && for i in $(SRC_DIST_FILES); do $(LN_S) $(TOP)/$$i .; done
1118 cd $(SRC_DIST_DIR) && $(MAKE) distclean
1119 rm -rf $(SRC_DIST_DIR)/libraries/tarballs/
1120 rm -rf $(SRC_DIST_DIR)/libraries/stamp/
1121 $(call sdist_file,compiler,stage2,cmm,,CmmLex,x)
1122 $(call sdist_file,compiler,stage2,cmm,,CmmParse,y)
1123 $(call sdist_file,compiler,stage2,parser,,Lexer,x)
1124 $(call sdist_file,compiler,stage2,parser,,Parser,y.pp)
1125 $(call sdist_file,compiler,stage2,parser,,ParserCore,y)
1126 $(call sdist_file,utils/hpc,dist,,,HpcParser,y)
1127 $(call sdist_file,utils/genprimopcode,dist,,,Lexer,x)
1128 $(call sdist_file,utils/genprimopcode,dist,,,Parser,y)
1129 $(call sdist_file,utils/haddock,dist,src,Haddock,Lex,x)
1130 $(call sdist_file,utils/haddock,dist,src,Haddock,Parse,y)
1131 cd $(SRC_DIST_DIR) && "$(RM)" $(RM_OPTS_REC) compiler/stage[123] mk/build.mk
1132 cd $(SRC_DIST_DIR) && "$(FIND)" $(SRC_DIST_DIRS) \( -name _darcs -o -name SRC -o -name "autom4te*" -o -name "*~" -o -name ".cvsignore" -o -name "\#*" -o -name ".\#*" -o -name "log" -o -name "*-SAVE" -o -name "*.orig" -o -name "*.rej" -o -name "*-darcs-backup*" \) -print | "$(XARGS)" $(XARGS_OPTS) "$(RM)" $(RM_OPTS_REC)
1136 "$(TAR_CMD)" chf - $(SRC_DIST_NAME) 2>$src_log | bzip2 >$(TOP)/$(SRC_DIST_TARBALL)
1138 sdist-manifest : $(SRC_DIST_TARBALL)
1139 tar tjf $(SRC_DIST_TARBALL) | sed "s|^ghc-$(ProjectVersion)/||" | sort >sdist-manifest
1141 # Upload the distribution(s)
1142 # Retrying is to work around buggy firewalls that corrupt large file transfers
1144 ifneq "$(PublishLocation)" ""
1146 $(call try10Times,$(PublishCp) $(SRC_DIST_TARBALL) $(PublishLocation)/dist)
1149 ifeq "$(BootingFromHc)" "YES"
1150 # In a normal build we use GHC to compile C files (see
1151 # rules/c-suffix-rules.mk), which passes a number of its own options
1152 # to the C compiler. So when bootstrapping we have to provide these
1153 # flags explicitly to C compilations.
1154 SRC_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER
1155 SRC_CC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
1156 SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR)
1159 # -----------------------------------------------------------------------------
1160 # sdisting libraries
1162 # Use manually, with e.g.:
1163 # make sdist_directory
1166 inplace/bin/ghc-cabal sdist libraries/$* dist-install
1168 # -----------------------------------------------------------------------------
1173 CLEAN_FILES += utils/ghc-pwd/ghc-pwd
1174 CLEAN_FILES += utils/ghc-pwd/ghc-pwd.exe
1175 CLEAN_FILES += utils/ghc-pwd/ghc-pwd.hi
1176 CLEAN_FILES += utils/ghc-pwd/ghc-pwd.o
1177 CLEAN_FILES += libraries/bootstrapping.conf
1178 CLEAN_FILES += libraries/integer-gmp/cbits/GmpDerivedConstants.h
1179 CLEAN_FILES += libraries/integer-gmp/cbits/mkGmpDerivedConstants
1181 clean : clean_files clean_libraries
1185 "$(RM)" $(RM_OPTS) $(CLEAN_FILES)
1187 ifneq "$(NO_CLEAN_GMP)" "YES"
1188 CLEAN_FILES += libraries/integer-gmp/gmp/gmp.h
1189 CLEAN_FILES += libraries/integer-gmp/gmp/libgmp.a
1194 "$(RM)" $(RM_OPTS_REC) libraries/integer-gmp/gmp/objs
1195 "$(RM)" $(RM_OPTS_REC) libraries/integer-gmp/gmp/gmpbuild
1198 .PHONY: clean_libraries
1199 clean_libraries: $(patsubst %,clean_libraries/%_dist-install,$(PACKAGES) $(PACKAGES_STAGE2))
1200 clean_libraries: $(patsubst %,clean_libraries/%_dist-boot,$(BOOT_PKGS))
1203 "$(RM)" $(RM_OPTS_REC) $(patsubst %, libraries/%/dist, $(PACKAGES) $(PACKAGES_STAGE2))
1204 "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/*.buildinfo, $(PACKAGES) $(PACKAGES_STAGE2))
1206 # We have to define a clean target for each library manually, because the
1207 # libraries/*/ghc.mk files are not included when we're cleaning.
1208 ifeq "$(CLEANING)" "YES"
1209 $(foreach lib,$(PACKAGES) $(PACKAGES_STAGE2),\
1210 $(eval $(call clean-target,libraries/$(lib),dist-install,libraries/$(lib)/dist-install)))
1213 clean : clean_bindistprep
1214 .PHONY: clean_bindistprep
1216 "$(RM)" $(RM_OPTS_REC) bindistprep/
1219 "$(RM)" $(RM_OPTS) config.cache config.status config.log mk/config.h mk/stamp-h
1220 "$(RM)" $(RM_OPTS) mk/config.mk mk/are-validating.mk mk/project.mk
1221 "$(RM)" $(RM_OPTS) mk/config.mk.old mk/project.mk.old
1222 "$(RM)" $(RM_OPTS) extra-gcc-opts docs/users_guide/ug-book.xml
1223 "$(RM)" $(RM_OPTS) compiler/ghc.cabal compiler/ghc.cabal.old
1224 "$(RM)" $(RM_OPTS) ghc/ghc-bin.cabal
1225 "$(RM)" $(RM_OPTS) libraries/base/include/HsBaseConfig.h
1226 "$(RM)" $(RM_OPTS) libraries/directory/include/HsDirectoryConfig.h
1227 "$(RM)" $(RM_OPTS) libraries/process/include/HsProcessConfig.h
1228 "$(RM)" $(RM_OPTS) libraries/unix/include/HsUnixConfig.h
1229 "$(RM)" $(RM_OPTS) libraries/old-time/include/HsTimeConfig.h
1231 "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/config.log, $(PACKAGES) $(PACKAGES_STAGE2))
1232 "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/config.status, $(PACKAGES) $(PACKAGES_STAGE2))
1233 "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/include/Hs*Config.h, $(PACKAGES) $(PACKAGES_STAGE2))
1234 "$(RM)" $(RM_OPTS_REC) $(patsubst %, libraries/%/autom4te.cache, $(PACKAGES) $(PACKAGES_STAGE2))
1236 maintainer-clean : distclean
1237 "$(RM)" $(RM_OPTS) configure mk/config.h.in
1238 "$(RM)" $(RM_OPTS_REC) autom4te.cache libraries/*/autom4te.cache
1239 "$(RM)" $(RM_OPTS) ghc.spec
1240 "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/GNUmakefile, \
1241 $(PACKAGES) $(PACKAGES_STAGE2))
1242 "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/ghc.mk, $(PACKAGES) $(PACKAGES_STAGE2))
1243 "$(RM)" $(RM_OPTS) $(patsubst %, libraries/%/configure, \
1244 $(PACKAGES) $(PACKAGES_STAGE2))
1245 "$(RM)" $(RM_OPTS) libraries/base/include/HsBaseConfig.h.in
1246 "$(RM)" $(RM_OPTS) libraries/directory/include/HsDirectoryConfig.h.in
1247 "$(RM)" $(RM_OPTS) libraries/process/include/HsProcessConfig.h.in
1248 "$(RM)" $(RM_OPTS) libraries/unix/include/HsUnixConfig.h.in
1249 "$(RM)" $(RM_OPTS) libraries/old-time/include/HsTimeConfig.h.in
1251 .PHONY: all_libraries
1253 .PHONY: bootstrapping-files
1254 bootstrapping-files: $(OTHER_LIBS)
1255 bootstrapping-files: includes/ghcautoconf.h
1256 bootstrapping-files: includes/DerivedConstants.h
1257 bootstrapping-files: includes/GHCConstants.h