Commit 1c1ed869 authored by Simon Marlow's avatar Simon Marlow

Refactoring and tidy up in the build system

Instead of the ghc-stage and ghc-stage2-package files in a package, we
now have a list of these in ghc.mk.  There are other similar lists (of
boot-packages and non-installable packages), so this is not too bad,
and is simpler.

While poking around in the top-level ghc.mk file I spotted various
opportunities to clean up and re-order some of the cruft that has
accumulated over time.
parent 21b05036
......@@ -73,31 +73,22 @@ for $package (@library_dirs) {
if ($#cabals eq 0) {
my $cabal = $cabals[0];
my $pkg;
my $stage;
my $top;
if (-f $cabal) {
$pkg = $cabal;
$pkg =~ s#.*/##;
$pkg =~ s/\.cabal$//;
if (-f "$package/ghc-stage") {
open STAGE, "< $package/ghc-stage"
or die "Can't open $package/ghc-stage: $!";
$stage = int(<STAGE>);
close STAGE
or die "Failed closing $package/ghc-stage: $!";
}
else {
$stage = 1;
}
$top = $package;
$top =~ s#[^/]+#..#g;
$dir = $package;
$dir =~ s#^libraries/##g;
print "Creating $package/ghc.mk\n";
open GHCMK, "> $package/ghc.mk"
or die "Opening $package/ghc.mk failed: $!";
print GHCMK "${package}_PACKAGE = ${pkg}\n";
print GHCMK "${package}_dist-install_GROUP = libraries\n";
print GHCMK "\$(eval \$(call build-package,${package},dist-install,${stage}))\n";
print GHCMK "\$(eval \$(call build-package,${package},dist-install,\$(if \$(filter ${dir},\$(STAGE2_PACKAGES)),2,1)))\n";
close GHCMK
or die "Closing $package/ghc.mk failed: $!";
......
This diff is collapsed.
......@@ -60,3 +60,7 @@ libraries/dph/dph-prim-par_dist-install_EXTRA_HC_OPTS += -Wwarn
libraries/dph/dph-seq_dist-install_EXTRA_HC_OPTS += -Wwarn
libraries/dph/dph-par_dist-install_EXTRA_HC_OPTS += -Wwarn
# We need -fno-warn-deprecated-flags to avoid failure with -Werror
GhcLibHcOpts += -fno-warn-deprecated-flags
GhcBootLibHcOpts += -fno-warn-deprecated-flags
......@@ -162,9 +162,7 @@ $$(foreach way,$$($1_$2_WAYS),$$(eval \
$$(call build-package-way,$1,$2,$$(way),$3) \
))
ifneq "$$($1_$2_HADDOCK_ME)" "NO"
$(call haddock,$1,$2)
endif
endif # package-data.mk exists
......
......@@ -39,10 +39,6 @@ define extra-package # $1 = package root, $2 = package
$(call trace, extra-package($1,$2))
EXTRA_PACKAGES += $2
ifeq "$(wildcard libraries/$1/ghc-stage2-package)" ""
$$(eval $$(call addPackage,$2))
else
$$(eval $$(call addPackage2,$2))
endif
endef
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment