[commit: ghc] wip/nfs-locking: Finish Generate rule. (f7ee775)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:21:04 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/f7ee77565aa3b16f2911f99b7ef14059c16f9534/ghc

>---------------------------------------------------------------

commit f7ee77565aa3b16f2911f99b7ef14059c16f9534
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Mon Sep 21 01:03:02 2015 +0100

    Finish Generate rule.


>---------------------------------------------------------------

f7ee77565aa3b16f2911f99b7ef14059c16f9534
 src/Rules/Generate.hs | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs
index 055dccb..535f99b 100644
--- a/src/Rules/Generate.hs
+++ b/src/Rules/Generate.hs
@@ -23,33 +23,15 @@ generatePackageCode _ target @ (PartialTarget stage package) =
     let path        = targetPath stage package
         packagePath = pkgPath package
         buildPath   = path -/- "build"
-    in do
+    in do -- TODO: do we need to copy *.(l)hs-boot files here? Never happens?
         buildPath </> "*.hs" %> \file -> do
             dirs  <- interpretPartial target $ getPkgDataList SrcDirs
             files <- getDirectoryFiles "" $
                 [ packagePath </> d </> takeBaseName file <.> "*" | d <- dirs ]
             let gens = [ (f, b) | f <- files, Just b <- [determineBuilder f] ]
-                (src, builder) = head gens
             when (length gens /= 1) . putError $
                 "Exactly one generator expected for " ++ file
                 ++ "(found: " ++ show gens ++ ")."
+            let (src, builder) = head gens
             need [src]
             build $ fullTarget target builder [src] [file]
-
--- $1/$2/build/%.hs : $1/$3/%.ly | $$$$(dir $$$$@)/.
---     $$(call cmd,HAPPY) $$($1_$2_ALL_HAPPY_OPTS) $$< -o $$@
-
--- $1/$2/build/%.hs : $1/$3/%.y | $$$$(dir $$$$@)/.
---     $$(call cmd,HAPPY) $$($1_$2_ALL_HAPPY_OPTS) $$< -o $$@
-
--- $1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs : $1/$3/%.hsc $$$$(hsc2hs_INPLACE) | $$$$(dir $$$$@)/.
---     $$(call cmd,hsc2hs_INPLACE) $$($1_$2_ALL_HSC2HS_OPTS) $$< -o $$@
-
--- # Now the rules for hs-boot files.
-
--- $1/$2/build/%.hs-boot : $1/$3/%.hs-boot
---     "$$(CP)" $$< $$@
-
--- $1/$2/build/%.lhs-boot : $1/$3/%.lhs-boot
---     "$$(CP)" $$< $$@
-



More information about the ghc-commits mailing list