utils/haddock/dist/package-data.mk: compiler/stage2/package-data.mk
utils/hsc2hs/dist-install/package-data.mk: compiler/stage2/package-data.mk
+utils/compare_sizes/dist/package-data.mk: compiler/stage2/package-data.mk
# add the final two package.conf dependencies: ghc-prim depends on RTS,
# and RTS depends on libffi.
$(GHC_TOUCHY_DIR)
endif
+BUILD_DIRS += utils/count_lines
+BUILD_DIRS += utils/compare_sizes
+
ifneq "$(CLEANING)" "YES"
# After compiler/, because these packages depend on it
BUILD_DIRS += \
utils/hpc_dist_DISABLE = YES
utils/hsc2hs_dist-install_DISABLE = YES
utils/ghc-pkg_dist-install_DISABLE = YES
+utils/compare_sizes_dist_DISABLE = YES
compiler_stage2_DISABLE = YES
compiler_stage3_DISABLE = YES
ghc_stage2_DISABLE = YES
# $2 = distdir
ifeq "$$($1_$2_TOPDIR)" "YES"
-$1_$2_INPLACE = $(INPLACE_TOPDIR)/$$($1_$2_PROG)
+$1_$2_INPLACE = $$(INPLACE_TOPDIR)/$$($1_$2_PROG)
else
-$1_$2_INPLACE = $(INPLACE_BIN)/$$($1_$2_PROG)
+$1_$2_INPLACE = $$(INPLACE_BIN)/$$($1_$2_PROG)
endif
-$(call all-target,$$($1_$2_INPLACE))
+$(call all-target,$1_$2,$$($1_$2_INPLACE))
$(call clean-target,$1,$2,$1/$2 $$($1_$2_INPLACE))
.PHONY: clean_$1
--- /dev/null
+The Glasgow Haskell Compiler License
+
+Copyright 2002, The University Court of the University of Glasgow.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+- Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+
+- Neither name of the University nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
+GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
dir' = dir <//> subdir
doEntry :: FilePath -> IO (Maybe Tree)
doEntry e = liftM Just (getTree isFileInteresting root dir' e)
- `catch` \_ -> -- XXX Do this better
+ `catchIO` \_ -> -- XXX We ought to check this is a
+ -- "not a directory" exception really
if isFileInteresting e
then do let fn = dir' <//> e
h <- openFile (root </> fn) ReadMode
return $ Just $ File e fn size
else return Nothing
+catchIO :: IO a -> (IOError -> IO a) -> IO a
+catchIO = catch
+
----------------------------------------------------------------------
-- Comparing the trees
--- /dev/null
+name: compareSizes
+version: 0.1.0.0
+cabal-version: >= 1.6
+license: BSD3
+build-type: Simple
+license-file: LICENSE
+stability: experimental
+synopsis: Size comparison util
+description: Size comparison util
+category: Development
+
+executable compareSizes
+ build-depends:
+ base >= 4 && < 5,
+ directory,
+ filepath
+
+ main-is: Main.hs
+
--- /dev/null
+
+utils/compare_sizes_USES_CABAL = YES
+utils/compare_sizes_PACKAGE = compareSizes
+utils/compare_sizes_MODULES = Main
+utils/compare_sizes_dist_PROG = compareSizes$(exeext)
+
+$(eval $(call build-prog,utils/compare_sizes,dist,1))
+
#! /usr/bin/perl
+\begin{code}
+
use FindBin;
%DirCount = ();
$totcmts += $ModComments{$m};
}
printf "\n%-20s %6d %6d\n", 'TOTAL:', $tot, $totcmts;
+
+\end{code}
+
--- /dev/null
+
+utils/count_lines_PERL_SRC = count_lines.lprl
+utils/count_lines_dist_PROG = count_lines
+
+$(eval $(call build-perl,utils/count_lines,dist))