1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
  | 
module CPP.CompileWithFrontend ( compileImportedModule )
 where
import Control.Monad               ( when )
import Curry.Compiler.Distribution ( curryCompiler )
import System.FrontendExec
compileImportedModule :: Int -> String -> IO ()
compileImportedModule verb modname = do
  mapM (compileModuleTo verb modname) [ACY, UACY]
  compileModule2Flat
 where
  compileModule2Flat
    | curryCompiler == "kics2"
    = compileModuleTo verb modname TFCY
    | curryCompiler == "pakcs"
    = compileModuleTo verb modname FCY
    | otherwise
    = error $ "compileSetFunctions: unknown Curry compiler '" ++
              curryCompiler ++ "'!"
compileModuleTo :: Int -> String -> FrontendTarget -> IO ()
compileModuleTo verb modname target = do
  when (verb > 2) $ putStrLn $
    "Compiling '" ++ modname ++ "' to '" ++ show target ++ "'..."
  callFrontendWithParams target (setQuiet True defaultParams) modname
 |