Skip to content

Commit 3b62e57

Browse files
committed
Fix distcleanTest
1 parent 1ae5a2a commit 3b62e57

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

source/src/BNFC/Backend/FSharp.hs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module BNFC.Backend.FSharp (makeFSharp) where
1313
import System.FilePath (pathSeparator, (</>))
1414

1515
import BNFC.Backend.Base (MkFiles, mkfile)
16+
import BNFC.Backend.Common.Makefile
1617
import BNFC.Backend.FSharp.CFtoFSharpAbs
1718
import BNFC.Backend.FSharp.CFtoFsLex
1819
import BNFC.Backend.FSharp.CFtoFSharpPrinter
@@ -22,6 +23,7 @@ import BNFC.Backend.FSharp.CFtoFSharpTest (fsharpTestfile)
2223
import BNFC.Backend.FSharp.CFtoFsYacc
2324
import qualified BNFC.Backend.XML as XML
2425
import BNFC.CF
26+
import BNFC.PrettyPrint
2527
import BNFC.Options
2628
import BNFC.Utils
2729

@@ -93,11 +95,32 @@ makeFSharp opts cf = do
9395
mkfile (tFile opts) comment $ fsharpTestfile absMod lexMod parMod prMod showMod tFileMod cf
9496
mkfile (utilFile opts) comment $ utilM (utilFileM opts)
9597
mkfile (fsprojFile opts) XML.comment $ fsprojM opts
98+
mkMakefile opts $ makefile opts
9699
-- case xml opts of
97100
-- 2 -> makeXML opts True cf
98101
-- 1 -> makeXML opts False cf
99102
-- _ -> return ()
100103

104+
makefile :: SharedOptions -> String -> Doc
105+
makefile opts basename = vcat
106+
[
107+
mkRule "clean" []
108+
[ "-rm -fr bin obj "]
109+
,mkRule "distclean" ["clean"]
110+
[ "-rm -f " ++ unwords [ mkFile withLang "Lex" "*" opts,
111+
mkFile withLang "Par" "*" opts,
112+
mkFile withLang "Layout" "*" opts,
113+
mkFile withLang "Skel" "*" opts,
114+
mkFile withLang "Print" "*" opts,
115+
mkFile withLang "Show" "*" opts,
116+
mkFile withLang "Test" "*" opts,
117+
mkFile withLang "Abs" "*" opts,
118+
mkFile withLang "Test" "" opts,
119+
mkFile withLang "" "fsproj" opts,
120+
utilFile opts,
121+
basename ]]
122+
]
123+
101124
comment :: String -> String
102125
comment x = unwords [ "(*", x, "*)" ]
103126

0 commit comments

Comments
 (0)