#!/usr/bin/perl
use warnings;
use strict;
use File::Basename;
# remove ghc intermediate files
my $rm = 'rm -f';
my @files;
my @suffixes = qw(.o .hi .hc .s .tix .aux .prof .hp .ps);
my @ssuffixes = qw(.hs .lhs .hs-boot .lhs-boot);
map { push @files, "*$_" } @suffixes;
push @files, ('*.hi-boot', '*.o-boot');
map { push @files, (fileparse($_, qr/\.[^.]*/))[0] }
(@ARGV > 0 ? @ARGV : map { glob("*$_") } @ssuffixes);
print "$rm $_\n" for @files;
|