Changeset 21747 for Makefile.PL

Show
Ignore:
Timestamp:
08/03/08 07:39:46 (4 months ago)
Author:
audreyt
Message:

* build Pugs-Compiler-Rule with pugs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Makefile.PL

    r21744 r21747  
    139139    } 
    140140 
     141    my @srcdirs  = grep {-d} glob("src"), glob("src/*"), glob("src/*/*"), glob("src/*/*/*"); 
     142    my @srcfiles = map { glob("$_/*.*hs") } @srcdirs; 
     143    push @srcfiles, map { glob("$_/*.*hs-boot") } @srcdirs; 
     144    push @srcfiles, map { map { substr($_, 0, -1) } glob("$_/*.*hsc") } @srcdirs; 
     145 
     146    my $version_h = "src/Pugs/pugs_version.h"; 
     147    my $config_h = "src/Pugs/pugs_config.h"; 
     148 
    141149    # Ok, now we have Cabal-Install and all the deps.  Let's be lazy and write a simple makefile. 
    142150    postamble(<<"."); 
    143 pugs$Config{_exe} :: src/Pugs/Config.hs src/Pugs/Prelude.hs 
    144 \t\$(RM_F) dist/build/pugs/pugs$Config{_exe} 
    145 \t\$(RM_F) Pugs.cabal 
    146 \t\$(CP) Pugs.cabal.in Pugs.cabal 
    147 \t./Setup$Config{_exe} configure --user 
    148 \t./Setup$Config{_exe} build 
    149 \t\$(CP) dist/build/pugs/pugs$Config{_exe} . 
     151pugs_requirements : @srcfiles $version_h $config_h config.yml src/Pugs/Config.hs src/Pugs/Prelude.hs 
     152 
     153$config_h : lib/Perl6/Pugs.pm util/config_h.pl 
     154        \$(PERL) util/config_h.pl "$ghc $ghc_flags" 
     155 
     156$version_h : 
     157        \$(PERL) util/version_h.pl $version_h 
     158 
     159pugs$Config{_exe} :: pugs_requirements build_perl5 
     160        \$(RM_F) dist/build/pugs/pugs$Config{_exe} 
     161        \$(RM_F) Pugs.cabal 
     162        \$(CP) Pugs.cabal.in Pugs.cabal 
     163        ./Setup$Config{_exe} configure --user 
     164        ./Setup$Config{_exe} build 
     165        \$(CP) dist/build/pugs/pugs$Config{_exe} . 
    150166 
    151167install :: 
     
    176192src/Pugs/Prelude.hs : src/perl6/Prelude.pm util/gen_prelude.pl 
    177193\t\$(PERL) util/gen_prelude.pl -v --touch --inline -i src/perl6/Prelude.pm --output src/Pugs/Prelude.hs 
     194 
     195build_perl5 :: 
     196@{[for_perl5(" 
     197        cd __DIR__ && $^X Makefile.PL && \$(MAKE) 
     198")]} 
     199 
     200clean :: 
     201@{[for_perl5(" 
     202        -cd __DIR__ && \$(TEST_F) \$(FIRST_MAKEFILE) && \$(MAKE) clean 
     203")]} 
     204 
     205realclean :: 
     206@{[for_perl5(" 
     207        -cd __DIR__ && \$(TEST_F) \$(FIRST_MAKEFILE) && \$(MAKE) realclean 
     208")]} 
     209 
    178210. 
    179211 
     
    230262        next if glob("$dir/*.xs") or glob("$dir/*.i") or $dir =~ /-\d+/; 
    231263 
     264        next unless $dir =~ /Pugs-Compiler-Rule/; 
     265 
    232266        my $this = $cmd; 
    233267        $this =~ s{__DIR__}{$dir}g;