1 -----------------------------------------------------------------------------
2 -- $Id: DriverPipeline.hs,v 1.7 2000/10/26 14:38:42 simonmar Exp $
6 -- (c) Simon Marlow 2000
8 -----------------------------------------------------------------------------
10 module DriverPipeline (
12 -- interfaces for the batch-mode driver
13 GhcMode(..), getGhcMode, v_GhcMode,
14 genPipeline, runPipeline,
16 -- interfaces for the compilation manager (interpreted/batch-mode)
19 -- batch-mode linking interface
23 #include "HsVersions.h"
46 -- import Posix commented out temp by SLPJ to get going on windows
53 -----------------------------------------------------------------------------
54 -- GHC modes of operation
57 = DoMkDependHS -- ghc -M
58 | DoMkDLL -- ghc -mk-dll
59 | StopBefore Phase -- ghc -E | -C | -S | -c
60 | DoMake -- ghc --make
61 | DoInteractive -- ghc --interactive
62 | DoLink -- [ the default ]
65 GLOBAL_VAR(v_GhcMode, error "todo", GhcMode)
67 modeFlag :: String -> Maybe GhcMode
68 modeFlag "-M" = Just $ DoMkDependHS
69 modeFlag "-E" = Just $ StopBefore Hsc
70 modeFlag "-C" = Just $ StopBefore HCc
71 modeFlag "-S" = Just $ StopBefore As
72 modeFlag "-c" = Just $ StopBefore Ln
73 modeFlag "--make" = Just $ DoMake
74 modeFlag "--interactive" = Just $ DoInteractive
77 getGhcMode :: [String]
78 -> IO ( [String] -- rest of command line
80 , String -- "GhcMode" flag
83 = case my_partition modeFlag flags of
84 ([] , rest) -> return (rest, DoLink, "") -- default is to do linking
85 ([(flag,one)], rest) -> return (rest, one, flag)
88 "only one of the flags -M, -E, -C, -S, -c, --make, --interactive is allowed")
90 -----------------------------------------------------------------------------
93 -- Herein is all the magic about which phases to run in which order, whether
94 -- the intermediate files should be in /tmp or in the current directory,
95 -- what the suffix of the intermediate files should be, etc.
97 -- The following compilation pipeline algorithm is fairly hacky. A
98 -- better way to do this would be to express the whole comilation as a
99 -- data flow DAG, where the nodes are the intermediate files and the
100 -- edges are the compilation phases. This framework would also work
101 -- nicely if a haskell dependency generator was included in the
104 -- It would also deal much more cleanly with compilation phases that
105 -- generate multiple intermediates, (eg. hsc generates .hc, .hi, and
106 -- possibly stub files), where some of the output files need to be
107 -- processed further (eg. the stub files need to be compiled by the C
110 -- A cool thing to do would then be to execute the data flow graph
111 -- concurrently, automatically taking advantage of extra processors on
112 -- the host machine. For example, when compiling two Haskell files
113 -- where one depends on the other, the data flow graph would determine
114 -- that the C compiler from the first comilation can be overlapped
115 -- with the hsc comilation for the second file.
117 data IntermediateFileType
123 :: GhcMode -- when to stop
124 -> String -- "stop after" flag (for error messages)
125 -> String -- original filename
126 -> IO [ -- list of phases to run for this file
128 IntermediateFileType, -- keep the output from this phase?
129 String) -- output file suffix
132 genPipeline todo stop_flag filename
134 split <- readIORef split_object_files
135 mangle <- readIORef do_asm_mangling
136 lang <- readIORef hsc_lang
137 keep_hc <- readIORef keep_hc_files
138 keep_raw_s <- readIORef keep_raw_s_files
139 keep_s <- readIORef keep_s_files
142 ----------- ----- ---- --- -- -- - - -
143 (_basename, suffix) = splitFilename filename
145 start_phase = startPhase suffix
147 haskellish = haskellish_suffix suffix
148 cish = cish_suffix suffix
150 -- for a .hc file, or if the -C flag is given, we need to force lang to HscC
151 real_lang | suffix == "hc" = HscC
155 ----------- ----- ---- --- -- -- - - -
157 | todo == DoMkDependHS = [ Unlit, Cpp, MkDependHS ]
161 HscC | split && mangle -> [ Unlit, Cpp, Hsc, HCc, Mangle,
162 SplitMangle, SplitAs ]
163 | mangle -> [ Unlit, Cpp, Hsc, HCc, Mangle, As ]
165 | otherwise -> [ Unlit, Cpp, Hsc, HCc, As ]
167 HscAsm | split -> [ Unlit, Cpp, Hsc, SplitMangle, SplitAs ]
168 | otherwise -> [ Unlit, Cpp, Hsc, As ]
170 HscJava | split -> not_valid
171 | otherwise -> error "not implemented: compiling via Java"
175 | otherwise = [ ] -- just pass this file through to the linker
177 -- ToDo: this is somewhat cryptic
178 not_valid = throwDyn (OtherError ("invalid option combination"))
179 ----------- ----- ---- --- -- -- - - -
181 -- this shouldn't happen.
182 if start_phase /= Ln && start_phase `notElem` pipeline
183 then throwDyn (OtherError ("can't find starting phase for "
187 -- if we can't find the phase we're supposed to stop before,
188 -- something has gone wrong.
192 && phase `notElem` pipeline
193 && not (phase == As && SplitAs `elem` pipeline)) $
195 ("flag " ++ stop_flag
196 ++ " is incompatible with source file `" ++ filename ++ "'"))
200 ----------- ----- ---- --- -- -- - - -
202 :: [Phase] -- raw pipeline
203 -> Phase -- phase to stop before
204 -> [(Phase, IntermediateFileType, String{-file extension-})]
205 annotatePipeline [] _ = []
206 annotatePipeline (Ln:_) _ = []
207 annotatePipeline (phase:next_phase:ps) stop =
208 (phase, keep_this_output, phaseInputExt next_phase)
209 : annotatePipeline (next_phase:ps) stop
212 | next_phase == stop = Persistent
216 Mangle | keep_raw_s -> Persistent
217 As | keep_s -> Persistent
218 HCc | keep_hc -> Persistent
221 -- add information about output files to the pipeline
222 -- the suffix on an output file is determined by the next phase
223 -- in the pipeline, so we add linking to the end of the pipeline
224 -- to force the output from the final phase to be a .o file.
225 stop_phase = case todo of StopBefore phase -> phase
228 annotated_pipeline = annotatePipeline (pipeline ++ [ Ln ]) stop_phase
230 phase_ne p (p1,_,_) = (p1 /= p)
231 ----------- ----- ---- --- -- -- - - -
234 dropWhile (phase_ne start_phase) .
235 foldr (\p ps -> if phase_ne stop_phase p then p:ps else []) []
240 :: [ (Phase, IntermediateFileType, String) ] -- phases to run
241 -> String -- input file
242 -> Bool -- doing linking afterward?
243 -> Bool -- take into account -o when generating output?
244 -> IO String -- return final filename
246 runPipeline pipeline input_fn do_linking use_ofile
247 = pipeLoop pipeline input_fn do_linking use_ofile basename suffix
248 where (basename, suffix) = splitFilename input_fn
250 pipeLoop [] input_fn _ _ _ _ = return input_fn
251 pipeLoop ((phase, keep, o_suffix):phases)
252 input_fn do_linking use_ofile orig_basename orig_suffix
255 output_fn <- outputFileName (null phases) keep o_suffix
257 carry_on <- run_phase phase orig_basename orig_suffix input_fn output_fn
258 -- sometimes we bail out early, eg. when the compiler's recompilation
259 -- checker has determined that recompilation isn't necessary.
261 then do let (_,keep,final_suffix) = last phases
262 ofile <- outputFileName True keep final_suffix
264 else do -- carry on ...
266 -- sadly, ghc -E is supposed to write the file to stdout. We
267 -- generate <file>.cpp, so we also have to cat the file here.
268 when (null phases && phase == Cpp) $
269 run_something "Dump pre-processed file to stdout"
270 ("cat " ++ output_fn)
272 pipeLoop phases output_fn do_linking use_ofile orig_basename orig_suffix
275 outputFileName last_phase keep suffix
276 = do o_file <- readIORef output_file
277 if last_phase && not do_linking && use_ofile && isJust o_file
280 Nothing -> error "outputFileName"
281 else if keep == Persistent
282 then do f <- odir_ify (orig_basename ++ '.':suffix)
284 else newTempName suffix
286 -------------------------------------------------------------------------------
289 run_phase Unlit _basename _suff input_fn output_fn
290 = do unlit <- readIORef pgm_L
291 unlit_flags <- getOpts opt_L
292 run_something "Literate pre-processor"
293 ("echo '# 1 \"" ++input_fn++"\"' > "++output_fn++" && "
294 ++ unlit ++ ' ':input_fn ++ " - >> " ++ output_fn)
297 -------------------------------------------------------------------------------
300 run_phase Cpp _basename _suff input_fn output_fn
301 = do src_opts <- getOptionsFromSource input_fn
302 _ <- processArgs dynamic_flags src_opts []
304 do_cpp <- readState cpp_flag
307 cpp <- readIORef pgm_P
308 hscpp_opts <- getOpts opt_P
309 hs_src_cpp_opts <- readIORef hs_source_cpp_opts
311 cmdline_include_paths <- readIORef include_paths
312 pkg_include_dirs <- getPackageIncludePath
313 let include_paths = map (\p -> "-I"++p) (cmdline_include_paths
317 run_something "C pre-processor"
319 (["echo '{-# LINE 1 \"" ++ input_fn ++ "\" -}'", ">", output_fn, "&&",
324 ++ [ "-x", "c", input_fn, ">>", output_fn ]
327 run_something "Ineffective C pre-processor"
328 ("echo '{-# LINE 1 \"" ++ input_fn ++ "\" -}' > "
329 ++ output_fn ++ " && cat " ++ input_fn
330 ++ " >> " ++ output_fn)
333 -----------------------------------------------------------------------------
336 run_phase MkDependHS basename suff input_fn _output_fn = do
337 src <- readFile input_fn
338 let imports = getImports src
340 deps <- mapM (findDependency basename) imports
342 osuf_opt <- readIORef output_suf
343 let osuf = case osuf_opt of
347 extra_suffixes <- readIORef dep_suffixes
348 let suffixes = osuf : map (++ ('_':osuf)) extra_suffixes
349 ofiles = map (\suf -> basename ++ '.':suf) suffixes
351 objs <- mapM odir_ify ofiles
353 hdl <- readIORef dep_tmp_hdl
355 -- std dependeny of the object(s) on the source file
356 hPutStrLn hdl (unwords objs ++ " : " ++ basename ++ '.':suff)
358 let genDep (dep, False {- not an hi file -}) =
359 hPutStrLn hdl (unwords objs ++ " : " ++ dep)
360 genDep (dep, True {- is an hi file -}) = do
361 hisuf <- readIORef hi_suf
362 let dep_base = remove_suffix '.' dep
363 deps = (dep_base ++ hisuf)
364 : map (\suf -> dep_base ++ suf ++ '_':hisuf) extra_suffixes
365 -- length objs should be == length deps
366 sequence_ (zipWith (\o d -> hPutStrLn hdl (o ++ " : " ++ d)) objs deps)
368 mapM genDep [ d | Just d <- deps ]
372 -- add the lines to dep_makefile:
376 -- if the dependency is on something other than a .hi file:
377 -- this.o this.p_o ... : dep
379 -- if the import is {-# SOURCE #-}
380 -- this.o this.p_o ... : dep.hi-boot[-$vers]
383 -- this.o ... : dep.hi
384 -- this.p_o ... : dep.p_hi
387 -- (where .o is $osuf, and the other suffixes come from
388 -- the cmdline -s options).
390 -----------------------------------------------------------------------------
393 run_phase Hsc basename suff input_fn output_fn
396 -- we add the current directory (i.e. the directory in which
397 -- the .hs files resides) to the import path, since this is
398 -- what gcc does, and it's probably what you want.
399 let current_dir = getdir basename
401 paths <- readIORef include_paths
402 writeIORef include_paths (current_dir : paths)
404 -- figure out where to put the .hi file
405 ohi <- readIORef output_hi
406 hisuf <- readIORef hi_suf
407 let hifile = case ohi of
408 Nothing -> current_dir ++ {-ToDo: modname!!-}basename
412 -- figure out if the source has changed, for recompilation avoidance.
413 -- only do this if we're eventually going to generate a .o file.
414 -- (ToDo: do when generating .hc files too?)
416 -- Setting source_unchanged to "-fsource_unchanged" means that M.o seems
417 -- to be up to date wrt M.hs; so no need to recompile unless imports have
418 -- changed (which the compiler itself figures out).
419 -- Setting source_unchanged to "" tells the compiler that M.o is out of
420 -- date wrt M.hs (or M.o doesn't exist) so we must recompile regardless.
421 do_recomp <- readIORef recomp
422 todo <- readIORef v_GhcMode
423 o_file <- odir_ify (basename ++ '.':phaseInputExt Ln)
425 if not (do_recomp && ( todo == DoLink || todo == StopBefore Ln ))
427 else do t1 <- getModificationTime (basename ++ '.':suff)
428 o_file_exists <- doesFileExist o_file
430 then return "" -- Need to recompile
431 else do t2 <- getModificationTime o_file
433 then return "-fsource-unchanged"
436 -- build a bogus ModSummary to pass to hscMain.
437 let summary = ModSummary {
438 ms_location = error "no loc",
439 ms_ppsource = Just (input_fn, error "no fingerprint"),
440 ms_imports = error "no imports"
444 dyn_flags <- readIORef v_DynFlags
447 pcs <- initPersistentCompilerState
448 result <- hscMain dyn_flags{ hscOutName = output_fn }
452 emptyModuleEnv -- HomeSymbolTable
453 emptyModuleEnv -- HomeIfaceTable
454 emptyModuleEnv -- PackageIfaceTable
459 HscFail pcs -> throwDyn (PhaseFailed "hsc" (ExitFailure 1));
461 HscOK details maybe_iface maybe_stub_h maybe_stub_c
462 _maybe_interpreted_code pcs -> do
464 -- generate the interface file
466 Nothing -> -- compilation not required
467 do run_something "Touching object file" ("touch " ++ o_file)
471 -- discover the filename for the .hi file in a roundabout way
472 let mod = moduleString (mi_module iface)
473 ohi <- readIORef output_hi
474 hifile <- case ohi of
476 Nothing -> do hisuf <- readIORef hi_suf
477 return (current_dir ++
479 -- write out the interface...
480 if_hdl <- openFile hifile WriteMode
481 printForIface if_hdl (pprIface iface)
485 maybe_stub_o <- dealWithStubs basename maybe_stub_h maybe_stub_c
488 Just stub_o -> add ld_inputs stub_o
493 -----------------------------------------------------------------------------
496 -- we don't support preprocessing .c files (with -E) now. Doing so introduces
497 -- way too many hacks, and I can't say I've ever used it anyway.
499 run_phase cc_phase _basename _suff input_fn output_fn
500 | cc_phase == Cc || cc_phase == HCc
501 = do cc <- readIORef pgm_c
502 cc_opts <- (getOpts opt_c)
503 cmdline_include_dirs <- readIORef include_paths
505 let hcc = cc_phase == HCc
507 -- add package include paths even if we're just compiling
508 -- .c files; this is the Value Add(TM) that using
509 -- ghc instead of gcc gives you :)
510 pkg_include_dirs <- getPackageIncludePath
511 let include_paths = map (\p -> "-I"++p) (cmdline_include_dirs
514 c_includes <- getPackageCIncludes
515 cmdline_includes <- readState cmdline_hc_includes -- -#include options
517 let cc_injects | hcc = unlines (map mk_include
518 (c_includes ++ reverse cmdline_includes))
522 '"':_{-"-} -> "#include "++h_file
523 '<':_ -> "#include "++h_file
524 _ -> "#include \""++h_file++"\""
526 cc_help <- newTempName "c"
527 h <- openFile cc_help WriteMode
529 hPutStrLn h ("#include \"" ++ input_fn ++ "\"\n")
532 ccout <- newTempName "ccout"
534 mangle <- readIORef do_asm_mangling
535 (md_c_flags, md_regd_c_flags) <- machdepCCOpts
539 o2 <- readIORef v_minus_o2_for_C
540 let opt_flag | o2 = "-O2"
543 pkg_extra_cc_opts <- getPackageExtraCcOpts
545 excessPrecision <- readIORef excess_precision
547 run_something "C Compiler"
548 (unwords ([ cc, "-x", "c", cc_help, "-o", output_fn ]
550 ++ (if cc_phase == HCc && mangle
553 ++ [ verb, "-S", "-Wimplicit", opt_flag ]
554 ++ [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt ]
556 #ifdef mingw32_TARGET_OS
559 ++ (if excessPrecision then [] else [ "-ffloat-store" ])
566 -- ToDo: postprocess the output from gcc
568 -----------------------------------------------------------------------------
571 run_phase Mangle _basename _suff input_fn output_fn
572 = do mangler <- readIORef pgm_m
573 mangler_opts <- getOpts opt_m
575 if (prefixMatch "i386" cTARGETPLATFORM)
576 then do n_regs <- readState stolen_x86_regs
577 return [ show n_regs ]
579 run_something "Assembly Mangler"
582 ++ [ input_fn, output_fn ]
587 -----------------------------------------------------------------------------
590 run_phase SplitMangle _basename _suff input_fn _output_fn
591 = do splitter <- readIORef pgm_s
593 -- this is the prefix used for the split .s files
594 tmp_pfx <- readIORef v_TmpDir
596 let split_s_prefix = tmp_pfx ++ "/ghc" ++ show x
597 writeIORef split_prefix split_s_prefix
598 addFilesToClean [split_s_prefix ++ "__*"] -- d:-)
600 -- allocate a tmp file to put the no. of split .s files in (sigh)
601 n_files <- newTempName "n_files"
603 run_something "Split Assembly File"
610 -- save the number of split files for future references
611 s <- readFile n_files
612 let n = read s :: Int
613 writeIORef n_split_files n
616 -----------------------------------------------------------------------------
619 run_phase As _basename _suff input_fn output_fn
620 = do as <- readIORef pgm_a
621 as_opts <- getOpts opt_a
623 cmdline_include_paths <- readIORef include_paths
624 let cmdline_include_flags = map (\p -> "-I"++p) cmdline_include_paths
625 run_something "Assembler"
626 (unwords (as : as_opts
627 ++ cmdline_include_flags
628 ++ [ "-c", input_fn, "-o", output_fn ]
632 run_phase SplitAs basename _suff _input_fn _output_fn
633 = do as <- readIORef pgm_a
634 as_opts <- getOpts opt_a
636 split_s_prefix <- readIORef split_prefix
637 n <- readIORef n_split_files
639 odir <- readIORef output_dir
640 let real_odir = case odir of
644 let assemble_file n = do
645 let input_s = split_s_prefix ++ "__" ++ show n ++ ".s"
646 let output_o = newdir real_odir
647 (basename ++ "__" ++ show n ++ ".o")
648 real_o <- osuf_ify output_o
649 run_something "Assembler"
650 (unwords (as : as_opts
651 ++ [ "-c", "-o", real_o, input_s ]
654 mapM_ assemble_file [1..n]
657 -----------------------------------------------------------------------------
660 doLink :: [String] -> IO ()
662 ln <- readIORef pgm_l
664 o_file <- readIORef output_file
665 let output_fn = case o_file of { Just s -> s; Nothing -> "a.out"; }
667 pkg_lib_paths <- getPackageLibraryPath
668 let pkg_lib_path_opts = map ("-L"++) pkg_lib_paths
670 lib_paths <- readIORef library_paths
671 let lib_path_opts = map ("-L"++) lib_paths
673 pkg_libs <- getPackageLibraries
674 let pkg_lib_opts = map (\lib -> "-l"++lib) pkg_libs
676 libs <- readIORef cmdline_libraries
677 let lib_opts = map ("-l"++) (reverse libs)
678 -- reverse because they're added in reverse order from the cmd line
680 pkg_extra_ld_opts <- getPackageExtraLdOpts
682 -- probably _stub.o files
683 extra_ld_inputs <- readIORef ld_inputs
685 -- opts from -optl-<blah>
686 extra_ld_opts <- getStaticOpts opt_l
688 run_something "Linker"
690 ([ ln, verb, "-o", output_fn ]
702 -----------------------------------------------------------------------------
703 -- Just preprocess a file, put the result in a temp. file (used by the
704 -- compilation manager during the summary phase).
706 preprocess :: FilePath -> IO FilePath
707 preprocess filename =
708 ASSERT(haskellish_file filename)
709 do pipeline <- genPipeline (StopBefore Hsc) ("preprocess") filename
710 runPipeline pipeline filename False{-no linking-} False{-no -o flag-}
712 -----------------------------------------------------------------------------
713 -- Compile a single module.
715 -- This is the interface between the compilation manager and the
716 -- compiler proper (hsc), where we deal with tedious details like
717 -- reading the OPTIONS pragma from the source file, and passing the
718 -- output of hsc through the C compiler.
720 -- The driver sits between 'compile' and 'hscMain', translating calls
721 -- to the former into calls to the latter, and results from the latter
722 -- into results from the former. It does things like preprocessing
723 -- the .hs file if necessary, and compiling up the .stub_c files to
724 -- generate Linkables.
726 compile :: Finder -- to find modules
727 -> ModSummary -- summary, including source
728 -> Maybe ModIface -- old interface, if available
729 -> HomeSymbolTable -- for home module ModDetails
730 -> PersistentCompilerState -- persistent compiler state
734 = CompOK ModDetails -- new details (HST additions)
735 (Maybe (ModIface, Linkable))
736 -- summary and code; Nothing => compilation not reqd
737 -- (old summary and code are still valid)
738 PersistentCompilerState -- updated PCS
740 | CompErrs PersistentCompilerState -- updated PCS
743 compile finder summary old_iface hst pcs = do
744 verb <- readIORef verbose
745 when verb (hPutStrLn stderr ("compile: compiling " ++
746 name_of_summary summary))
748 init_dyn_flags <- readIORef v_InitDynFlags
749 writeIORef v_DynFlags init_dyn_flags
751 let input_fn = case ms_ppsource summary of
752 Just (ppsource, fingerprint) -> ppsource
753 Nothing -> hs_file (ms_location summary)
755 when verb (hPutStrLn stderr ("compile: input file " ++ input_fn))
757 opts <- getOptionsFromSource input_fn
758 processArgs dynamic_flags opts []
759 dyn_flags <- readIORef v_DynFlags
761 output_fn <- case hsc_lang of
762 HscAsm -> newTempName (phaseInputExt As)
763 HscC -> newTempName (phaseInputExt HCc)
764 HscJava -> newTempName "java" -- ToDo
765 HscInterpreted -> return (error "no output file")
768 hsc_result <- hscMain dyn_flags summary old_iface output_fn hst pcs
771 HscFail pcs -> return (CompErrs pcs);
773 HscOK details maybe_iface
774 maybe_stub_h maybe_stub_c maybe_interpreted_code pcs warns -> do
776 -- if no compilation happened, bail out early
777 case maybe_iface of {
778 Nothing -> return (CompOK details Nothing pcs warns);
781 let (basename, _) = splitFilename (hs_file (ms_location summary))
782 maybe_stub_o <- dealWithStubs basename maybe_stub_h maybe_stub_c
783 stub_unlinked <- case maybe_stub_o of
785 Just stub_o -> [ DotO stub_o ]
790 -- in interpreted mode, just return the compiled code
791 -- as our "unlinked" object.
793 case maybe_interpreted_code of
794 Just code -> return (Trees code)
795 Nothing -> panic "compile: no interpreted code"
797 -- we're in batch mode: finish the compilation pipeline.
798 _other -> do pipe <- genPipeline (StopBefore Ln) "" output_fn
799 o_file <- runPipeline pipe output_fn False False
800 return [ DotO o_file ]
802 let linkable = LM (moduleName (ms_mod summary))
803 (hs_unlinked ++ stub_unlinked)
805 return (CompOK details (Just (iface, linkable)) pcs warns)
809 -----------------------------------------------------------------------------
810 -- stub .h and .c files (for foreign export support)
812 dealWithStubs basename maybe_stub_h maybe_stub_c
814 = do let stub_h = basename ++ "_stub.h"
815 let stub_c = basename ++ "_stub.c"
817 -- copy the .stub_h file into the current dir if necessary
820 Just tmp_stub_h -> do
821 run_something "Copy stub .h file"
822 ("cp " ++ tmp_stub_h ++ ' ':stub_h)
824 -- #include <..._stub.h> in .hc file
825 addCmdlineHCInclude tmp_stub_h -- hack
827 -- copy the .stub_c file into the current dir, and compile it, if necessary
829 Nothing -> return Nothing
830 Just tmp_stub_c -> do -- copy the _stub.c file into the current dir
831 run_something "Copy stub .c file"
833 "rm -f", stub_c, "&&",
834 "echo \'#include \""++stub_h++"\"\' >"++stub_c, " &&",
835 "cat", tmp_stub_c, ">> ", stub_c
838 -- compile the _stub.c file w/ gcc
839 pipeline <- genPipeline (StopBefore Ln) "" stub_c
840 stub_o <- runPipeline pipeline stub_c False{-no linking-}
841 False{-no -o option-}