summaryrefslogtreecommitdiff
path: root/boot-pkgs
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-09-23 09:56:42 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-09-23 09:56:42 +0000
commit1c1ed8694bdd24b003fa5935d001a1835e9b0f4e (patch)
tree618f8aa531dbc76dfcf45b315e3d1522d3366659 /boot-pkgs
parent21b05036b6659aa3370f76c24c0e08e7a31f302b (diff)
downloadhaskell-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-pkgs15
1 files changed, 3 insertions, 12 deletions
diff --git a/boot-pkgs b/boot-pkgs
index 677ae52a8c..4552088808 100644
--- a/boot-pkgs
+++ b/boot-pkgs
@@ -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: $!";