From 3e001a06b498da5d2ea1385cf26601700d9888b2 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 30 Jun 2007 13:39:44 +0000 Subject: [PATCH] Tidy up -keep* flags --- compiler/main/DynFlags.hs | 13 +++++++++---- docs/users_guide/flags.xml | 9 ++++++--- docs/users_guide/separate_compilation.xml | 6 ++++++ docs/users_guide/using.xml | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 428d8d4..063f102 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -898,10 +898,15 @@ dynamic_flags = [ , ( "stubdir" , HasArg (upd . setStubDir . Just)) ------- Keeping temporary files ------------------------------------- - , ( "keep-hc-file" , AnySuffix (\_ -> setDynFlag Opt_KeepHcFiles)) - , ( "keep-s-file" , AnySuffix (\_ -> setDynFlag Opt_KeepSFiles)) - , ( "keep-raw-s-file", AnySuffix (\_ -> setDynFlag Opt_KeepRawSFiles)) - , ( "keep-tmp-files" , AnySuffix (\_ -> setDynFlag Opt_KeepTmpFiles)) + -- These can be singular (think ghc -c) or plural (think ghc --make) + , ( "keep-hc-file" , NoArg (setDynFlag Opt_KeepHcFiles)) + , ( "keep-hc-files" , NoArg (setDynFlag Opt_KeepHcFiles)) + , ( "keep-s-file" , NoArg (setDynFlag Opt_KeepSFiles)) + , ( "keep-s-files" , NoArg (setDynFlag Opt_KeepSFiles)) + , ( "keep-raw-s-file" , NoArg (setDynFlag Opt_KeepRawSFiles)) + , ( "keep-raw-s-files", NoArg (setDynFlag Opt_KeepRawSFiles)) + -- This only makes sense as plural + , ( "keep-tmp-files" , NoArg (setDynFlag Opt_KeepTmpFiles)) ------- Miscellaneous ---------------------------------------------- , ( "no-hs-main" , NoArg (setDynFlag Opt_NoHsMain)) diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index ba6e895..b84cc22 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -286,19 +286,22 @@ - + or + retain intermediate .hc files dynamic - - + or + retain intermediate .s files dynamic - - + or + retain intermediate .raw_s files dynamic - diff --git a/docs/users_guide/separate_compilation.xml b/docs/users_guide/separate_compilation.xml index 91cefb4..59723d7 100644 --- a/docs/users_guide/separate_compilation.xml +++ b/docs/users_guide/separate_compilation.xml @@ -436,7 +436,9 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch` + , + @@ -451,7 +453,9 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch` + , + @@ -461,7 +465,9 @@ $ ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch` + , + diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml index 3ab73a1..f27844d 100644 --- a/docs/users_guide/using.xml +++ b/docs/users_guide/using.xml @@ -81,7 +81,7 @@ module X where It is not recommended to move all the contents of your Makefiles into your source files, but in some circumstances, the OPTIONS_GHC pragma is the Right Thing. (If you - use and have OPTION flags in + use and have OPTION flags in your module, the OPTIONS_GHC will get put into the generated .hc file). -- 1.7.10.4