diff options
author | Simon Marlow <marlowsd@gmail.com> | 2010-09-23 09:56:42 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2010-09-23 09:56:42 +0000 |
commit | 1c1ed8694bdd24b003fa5935d001a1835e9b0f4e (patch) | |
tree | 618f8aa531dbc76dfcf45b315e3d1522d3366659 /boot-pkgs | |
parent | 21b05036b6659aa3370f76c24c0e08e7a31f302b (diff) | |
download | haskell-1c1ed8694bdd24b003fa5935d001a1835e9b0f4e.tar.gz |
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.
Diffstat (limited to 'boot-pkgs')
-rw-r--r-- | boot-pkgs | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -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: $!"; |