Commit 1ef6a045 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Generalise and export suffix :: Way -> String.

parent 2f9338d4
......@@ -13,6 +13,7 @@ module Ways (
loggingDynamic, threadedLoggingDynamic,
wayHcOpts,
suffix,
hisuf, osuf, hcsuf
) where
......@@ -84,15 +85,11 @@ wayHcOpts (Way _ _ units) =
, when (units == [Debug] || units == [Debug, Dynamic]) $ arg ["-ticky", "-DTICKY_TICKY"]
]
-- TODO: cover other cases
suffix :: FilePath -> Way -> FilePath
suffix base (Way _ _ units) =
concat $
["p_" | Profiling `elem` units] ++
["dyn_" | Dynamic `elem` units] ++
[base ]
suffix :: Way -> String
suffix way | way == vanilla = ""
| otherwise = tag way ++ "_"
hisuf, osuf, hcsuf :: Way -> FilePath
hisuf = suffix "hi"
osuf = suffix "o"
hcsuf = suffix "hc"
hisuf, osuf, hcsuf :: Way -> String
hisuf = (++ "hi") . suffix
osuf = (++ "o" ) . suffix
hcsuf = (++ "hc") . suffix
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment