Skip to content

Commit

Permalink
Fix distcleanTest
Browse files Browse the repository at this point in the history
  • Loading branch information
gdziadkiewicz committed Jan 21, 2022
1 parent 1ae5a2a commit 3b62e57
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions source/src/BNFC/Backend/FSharp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module BNFC.Backend.FSharp (makeFSharp) where
import System.FilePath (pathSeparator, (</>))

import BNFC.Backend.Base (MkFiles, mkfile)
import BNFC.Backend.Common.Makefile
import BNFC.Backend.FSharp.CFtoFSharpAbs
import BNFC.Backend.FSharp.CFtoFsLex
import BNFC.Backend.FSharp.CFtoFSharpPrinter
Expand All @@ -22,6 +23,7 @@ import BNFC.Backend.FSharp.CFtoFSharpTest (fsharpTestfile)
import BNFC.Backend.FSharp.CFtoFsYacc
import qualified BNFC.Backend.XML as XML
import BNFC.CF
import BNFC.PrettyPrint
import BNFC.Options
import BNFC.Utils

Expand Down Expand Up @@ -93,11 +95,32 @@ makeFSharp opts cf = do
mkfile (tFile opts) comment $ fsharpTestfile absMod lexMod parMod prMod showMod tFileMod cf
mkfile (utilFile opts) comment $ utilM (utilFileM opts)
mkfile (fsprojFile opts) XML.comment $ fsprojM opts
mkMakefile opts $ makefile opts
-- case xml opts of
-- 2 -> makeXML opts True cf
-- 1 -> makeXML opts False cf
-- _ -> return ()

makefile :: SharedOptions -> String -> Doc
makefile opts basename = vcat
[
mkRule "clean" []
[ "-rm -fr bin obj "]
,mkRule "distclean" ["clean"]
[ "-rm -f " ++ unwords [ mkFile withLang "Lex" "*" opts,
mkFile withLang "Par" "*" opts,
mkFile withLang "Layout" "*" opts,
mkFile withLang "Skel" "*" opts,
mkFile withLang "Print" "*" opts,
mkFile withLang "Show" "*" opts,
mkFile withLang "Test" "*" opts,
mkFile withLang "Abs" "*" opts,
mkFile withLang "Test" "" opts,
mkFile withLang "" "fsproj" opts,
utilFile opts,
basename ]]
]

comment :: String -> String
comment x = unwords [ "(*", x, "*)" ]

Expand Down

0 comments on commit 3b62e57

Please sign in to comment.