1 -----------------------------------------------------------------------------
2 -- $Id: DriverPipeline.hs,v 1.8 2000/10/26 16:21:02 sewardj 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"
41 import MkIface ( pprIface )
47 -- import Posix commented out temp by SLPJ to get going on windows
54 -----------------------------------------------------------------------------
55 -- GHC modes of operation
58 = DoMkDependHS -- ghc -M
59 | DoMkDLL -- ghc -mk-dll
60 | StopBefore Phase -- ghc -E | -C | -S | -c
61 | DoMake -- ghc --make
62 | DoInteractive -- ghc --interactive
63 | DoLink -- [ the default ]
66 GLOBAL_VAR(v_GhcMode, error "todo", GhcMode)
68 modeFlag :: String -> Maybe GhcMode
69 modeFlag "-M" = Just $ DoMkDependHS
70 modeFlag "-E" = Just $ StopBefore Hsc
71 modeFlag "-C" = Just $ StopBefore HCc
72 modeFlag "-S" = Just $ StopBefore As
73 modeFlag "-c" = Just $ StopBefore Ln
74 modeFlag "--make" = Just $ DoMake
75 modeFlag "--interactive" = Just $ DoInteractive
78 getGhcMode :: [String]
79 -> IO ( [String] -- rest of command line
81 , String -- "GhcMode" flag
84 = case my_partition modeFlag flags of
85 ([] , rest) -> return (rest, DoLink, "") -- default is to do linking
86 ([(flag,one)], rest) -> return (rest, one, flag)
89 "only one of the flags -M, -E, -C, -S, -c, --make, --interactive is allowed")
91 -----------------------------------------------------------------------------
94 -- Herein is all the magic about which phases to run in which order, whether
95 -- the intermediate files should be in /tmp or in the current directory,
96 -- what the suffix of the intermediate files should be, etc.
98 -- The following compilation pipeline algorithm is fairly hacky. A
99 -- better way to do this would be to express the whole comilation as a
100 -- data flow DAG, where the nodes are the intermediate files and the
101 -- edges are the compilation phases. This framework would also work
102 -- nicely if a haskell dependency generator was included in the
105 -- It would also deal much more cleanly with compilation phases that
106 -- generate multiple intermediates, (eg. hsc generates .hc, .hi, and
107 -- possibly stub files), where some of the output files need to be
108 -- processed further (eg. the stub files need to be compiled by the C
111 -- A cool thing to do would then be to execute the data flow graph
112 -- concurrently, automatically taking advantage of extra processors on
113 -- the host machine. For example, when compiling two Haskell files
114 -- where one depends on the other, the data flow graph would determine
115 -- that the C compiler from the first comilation can be overlapped
116 -- with the hsc comilation for the second file.
118 data IntermediateFileType
124 :: GhcMode -- when to stop
125 -> String -- "stop after" flag (for error messages)
126 -> String -- original filename
127 -> IO [ -- list of phases to run for this file
129 IntermediateFileType, -- keep the output from this phase?
130 String) -- output file suffix
133 genPipeline todo stop_flag filename
135 split <- readIORef v_Split_object_files
136 mangle <- readIORef v_Do_asm_mangling
137 lang <- readIORef v_Hsc_Lang
138 keep_hc <- readIORef v_Keep_hc_files
139 keep_raw_s <- readIORef v_Keep_raw_s_files
140 keep_s <- readIORef v_Keep_s_files
143 ----------- ----- ---- --- -- -- - - -
144 (_basename, suffix) = splitFilename filename
146 start_phase = startPhase suffix
148 haskellish = haskellish_suffix suffix
149 cish = cish_suffix suffix
151 -- for a .hc file, or if the -C flag is given, we need to force lang to HscC
152 real_lang | suffix == "hc" = HscC
156 ----------- ----- ---- --- -- -- - - -
158 | todo == DoMkDependHS = [ Unlit, Cpp, MkDependHS ]
162 HscC | split && mangle -> [ Unlit, Cpp, Hsc, HCc, Mangle,
163 SplitMangle, SplitAs ]
164 | mangle -> [ Unlit, Cpp, Hsc, HCc, Mangle, As ]
166 | otherwise -> [ Unlit, Cpp, Hsc, HCc, As ]
168 HscAsm | split -> [ Unlit, Cpp, Hsc, SplitMangle, SplitAs ]
169 | otherwise -> [ Unlit, Cpp, Hsc, As ]
171 HscJava | split -> not_valid
172 | otherwise -> error "not implemented: compiling via Java"
176 | otherwise = [ ] -- just pass this file through to the linker
178 -- ToDo: this is somewhat cryptic
179 not_valid = throwDyn (OtherError ("invalid option combination"))
180 ----------- ----- ---- --- -- -- - - -
182 -- this shouldn't happen.
183 if start_phase /= Ln && start_phase `notElem` pipeline
184 then throwDyn (OtherError ("can't find starting phase for "
188 -- if we can't find the phase we're supposed to stop before,
189 -- something has gone wrong.
193 && phase `notElem` pipeline
194 && not (phase == As && SplitAs `elem` pipeline)) $
196 ("flag " ++ stop_flag
197 ++ " is incompatible with source file `" ++ filename ++ "'"))
201 ----------- ----- ---- --- -- -- - - -
203 :: [Phase] -- raw pipeline
204 -> Phase -- phase to stop before
205 -> [(Phase, IntermediateFileType, String{-file extension-})]
206 annotatePipeline [] _ = []
207 annotatePipeline (Ln:_) _ = []
208 annotatePipeline (phase:next_phase:ps) stop =
209 (phase, keep_this_output, phaseInputExt next_phase)
210 : annotatePipeline (next_phase:ps) stop
213 | next_phase == stop = Persistent
217 Mangle | keep_raw_s -> Persistent
218 As | keep_s -> Persistent
219 HCc | keep_hc -> Persistent
222 -- add information about output files to the pipeline
223 -- the suffix on an output file is determined by the next phase
224 -- in the pipeline, so we add linking to the end of the pipeline
225 -- to force the output from the final phase to be a .o file.
226 stop_phase = case todo of StopBefore phase -> phase
229 annotated_pipeline = annotatePipeline (pipeline ++ [ Ln ]) stop_phase
231 phase_ne p (p1,_,_) = (p1 /= p)
232 ----------- ----- ---- --- -- -- - - -
235 dropWhile (phase_ne start_phase) .
236 foldr (\p ps -> if phase_ne stop_phase p then p:ps else []) []
241 :: [ (Phase, IntermediateFileType, String) ] -- phases to run
242 -> String -- input file
243 -> Bool -- doing linking afterward?
244 -> Bool -- take into account -o when generating output?
245 -> IO String -- return final filename
247 runPipeline pipeline input_fn do_linking use_ofile
248 = pipeLoop pipeline input_fn do_linking use_ofile basename suffix
249 where (basename, suffix) = splitFilename input_fn
251 pipeLoop [] input_fn _ _ _ _ = return input_fn
252 pipeLoop ((phase, keep, o_suffix):phases)
253 input_fn do_linking use_ofile orig_basename orig_suffix
256 output_fn <- outputFileName (null phases) keep o_suffix
258 carry_on <- run_phase phase orig_basename orig_suffix input_fn output_fn
259 -- sometimes we bail out early, eg. when the compiler's recompilation
260 -- checker has determined that recompilation isn't necessary.
262 then do let (_,keep,final_suffix) = last phases
263 ofile <- outputFileName True keep final_suffix
265 else do -- carry on ...
267 -- sadly, ghc -E is supposed to write the file to stdout. We
268 -- generate <file>.cpp, so we also have to cat the file here.
269 when (null phases && phase == Cpp) $
270 run_something "Dump pre-processed file to stdout"
271 ("cat " ++ output_fn)
273 pipeLoop phases output_fn do_linking use_ofile orig_basename orig_suffix
276 outputFileName last_phase keep suffix
277 = do o_file <- readIORef v_Output_file
278 if last_phase && not do_linking && use_ofile && isJust o_file
281 Nothing -> error "outputFileName"
282 else if keep == Persistent
283 then do f <- odir_ify (orig_basename ++ '.':suffix)
285 else newTempName suffix
287 -------------------------------------------------------------------------------
290 run_phase Unlit _basename _suff input_fn output_fn
291 = do unlit <- readIORef v_Pgm_L
292 unlit_flags <- getOpts opt_L
293 run_something "Literate pre-processor"
294 ("echo '# 1 \"" ++input_fn++"\"' > "++output_fn++" && "
295 ++ unlit ++ ' ':input_fn ++ " - >> " ++ output_fn)
298 -------------------------------------------------------------------------------
301 run_phase Cpp _basename _suff input_fn output_fn
302 = do src_opts <- getOptionsFromSource input_fn
303 _ <- processArgs dynamic_flags src_opts []
305 do_cpp <- readState cpp_flag
308 cpp <- readIORef v_Pgm_P
309 hscpp_opts <- getOpts opt_P
310 hs_src_cpp_opts <- readIORef v_Hs_source_cpp_opts
312 cmdline_include_paths <- readIORef v_Include_paths
313 pkg_include_dirs <- getPackageIncludePath
314 let include_paths = map (\p -> "-I"++p) (cmdline_include_paths
318 run_something "C pre-processor"
320 (["echo '{-# LINE 1 \"" ++ input_fn ++ "\" -}'", ">", output_fn, "&&",
325 ++ [ "-x", "c", input_fn, ">>", output_fn ]
328 run_something "Ineffective C pre-processor"
329 ("echo '{-# LINE 1 \"" ++ input_fn ++ "\" -}' > "
330 ++ output_fn ++ " && cat " ++ input_fn
331 ++ " >> " ++ output_fn)
334 -----------------------------------------------------------------------------
337 run_phase MkDependHS basename suff input_fn _output_fn = do
338 src <- readFile input_fn
339 let imports = getImports src
341 deps <- mapM (findDependency basename) imports
343 osuf_opt <- readIORef v_Output_suf
344 let osuf = case osuf_opt of
348 extra_suffixes <- readIORef v_Dep_suffixes
349 let suffixes = osuf : map (++ ('_':osuf)) extra_suffixes
350 ofiles = map (\suf -> basename ++ '.':suf) suffixes
352 objs <- mapM odir_ify ofiles
354 hdl <- readIORef v_Dep_tmp_hdl
356 -- std dependeny of the object(s) on the source file
357 hPutStrLn hdl (unwords objs ++ " : " ++ basename ++ '.':suff)
359 let genDep (dep, False {- not an hi file -}) =
360 hPutStrLn hdl (unwords objs ++ " : " ++ dep)
361 genDep (dep, True {- is an hi file -}) = do
362 hisuf <- readIORef v_Hi_suf
363 let dep_base = remove_suffix '.' dep
364 deps = (dep_base ++ hisuf)
365 : map (\suf -> dep_base ++ suf ++ '_':hisuf) extra_suffixes
366 -- length objs should be == length deps
367 sequence_ (zipWith (\o d -> hPutStrLn hdl (o ++ " : " ++ d)) objs deps)
369 mapM genDep [ d | Just d <- deps ]
373 -- add the lines to dep_makefile:
377 -- if the dependency is on something other than a .hi file:
378 -- this.o this.p_o ... : dep
380 -- if the import is {-# SOURCE #-}
381 -- this.o this.p_o ... : dep.hi-boot[-$vers]
384 -- this.o ... : dep.hi
385 -- this.p_o ... : dep.p_hi
388 -- (where .o is $osuf, and the other suffixes come from
389 -- the cmdline -s options).
391 -----------------------------------------------------------------------------
394 run_phase Hsc basename suff input_fn output_fn
397 -- we add the current directory (i.e. the directory in which
398 -- the .hs files resides) to the import path, since this is
399 -- what gcc does, and it's probably what you want.
400 let current_dir = getdir basename
402 paths <- readIORef v_Include_paths
403 writeIORef v_Include_paths (current_dir : paths)
405 -- figure out where to put the .hi file
406 ohi <- readIORef v_Output_hi
407 hisuf <- readIORef v_Hi_suf
408 let hifile = case ohi of
409 Nothing -> current_dir ++ {-ToDo: modname!!-}basename
413 -- figure out if the source has changed, for recompilation avoidance.
414 -- only do this if we're eventually going to generate a .o file.
415 -- (ToDo: do when generating .hc files too?)
417 -- Setting source_unchanged to "-fsource_unchanged" means that M.o seems
418 -- to be up to date wrt M.hs; so no need to recompile unless imports have
419 -- changed (which the compiler itself figures out).
420 -- Setting source_unchanged to "" tells the compiler that M.o is out of
421 -- date wrt M.hs (or M.o doesn't exist) so we must recompile regardless.
422 do_recomp <- readIORef v_Recomp
423 todo <- readIORef v_GhcMode
424 o_file <- odir_ify (basename ++ '.':phaseInputExt Ln)
426 if not (do_recomp && ( todo == DoLink || todo == StopBefore Ln ))
428 else do t1 <- getModificationTime (basename ++ '.':suff)
429 o_file_exists <- doesFileExist o_file
431 then return "" -- Need to recompile
432 else do t2 <- getModificationTime o_file
434 then return "-fsource-unchanged"
437 -- build a bogus ModSummary to pass to hscMain.
438 let summary = ModSummary {
439 ms_location = error "no loc",
440 ms_ppsource = Just (input_fn, error "no fingerprint"),
441 ms_imports = error "no imports"
445 dyn_flags <- readIORef v_DynFlags
448 pcs <- initPersistentCompilerState
449 result <- hscMain dyn_flags{ hscOutName = output_fn }
453 emptyModuleEnv -- HomeSymbolTable
454 emptyModuleEnv -- HomeIfaceTable
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
465 maybe_stub_o <- dealWithStubs basename maybe_stub_h maybe_stub_c
468 Just stub_o -> add v_Ld_inputs stub_o
473 -----------------------------------------------------------------------------
476 -- we don't support preprocessing .c files (with -E) now. Doing so introduces
477 -- way too many hacks, and I can't say I've ever used it anyway.
479 run_phase cc_phase _basename _suff input_fn output_fn
480 | cc_phase == Cc || cc_phase == HCc
481 = do cc <- readIORef v_Pgm_c
482 cc_opts <- (getOpts opt_c)
483 cmdline_include_dirs <- readIORef v_Include_paths
485 let hcc = cc_phase == HCc
487 -- add package include paths even if we're just compiling
488 -- .c files; this is the Value Add(TM) that using
489 -- ghc instead of gcc gives you :)
490 pkg_include_dirs <- getPackageIncludePath
491 let include_paths = map (\p -> "-I"++p) (cmdline_include_dirs
494 c_includes <- getPackageCIncludes
495 cmdline_includes <- readState cmdline_hc_includes -- -#include options
497 let cc_injects | hcc = unlines (map mk_include
498 (c_includes ++ reverse cmdline_includes))
502 '"':_{-"-} -> "#include "++h_file
503 '<':_ -> "#include "++h_file
504 _ -> "#include \""++h_file++"\""
506 cc_help <- newTempName "c"
507 h <- openFile cc_help WriteMode
509 hPutStrLn h ("#include \"" ++ input_fn ++ "\"\n")
512 ccout <- newTempName "ccout"
514 mangle <- readIORef v_Do_asm_mangling
515 (md_c_flags, md_regd_c_flags) <- machdepCCOpts
519 o2 <- readIORef v_minus_o2_for_C
520 let opt_flag | o2 = "-O2"
523 pkg_extra_cc_opts <- getPackageExtraCcOpts
525 excessPrecision <- readIORef v_Excess_precision
527 run_something "C Compiler"
528 (unwords ([ cc, "-x", "c", cc_help, "-o", output_fn ]
530 ++ (if cc_phase == HCc && mangle
533 ++ [ verb, "-S", "-Wimplicit", opt_flag ]
534 ++ [ "-D__GLASGOW_HASKELL__="++cProjectVersionInt ]
536 #ifdef mingw32_TARGET_OS
539 ++ (if excessPrecision then [] else [ "-ffloat-store" ])
546 -- ToDo: postprocess the output from gcc
548 -----------------------------------------------------------------------------
551 run_phase Mangle _basename _suff input_fn output_fn
552 = do mangler <- readIORef v_Pgm_m
553 mangler_opts <- getOpts opt_m
555 if (prefixMatch "i386" cTARGETPLATFORM)
556 then do n_regs <- readState stolen_x86_regs
557 return [ show n_regs ]
559 run_something "Assembly Mangler"
562 ++ [ input_fn, output_fn ]
567 -----------------------------------------------------------------------------
570 run_phase SplitMangle _basename _suff input_fn _output_fn
571 = do splitter <- readIORef v_Pgm_s
573 -- this is the prefix used for the split .s files
574 tmp_pfx <- readIORef v_TmpDir
576 let split_s_prefix = tmp_pfx ++ "/ghc" ++ show x
577 writeIORef v_Split_prefix split_s_prefix
578 addFilesToClean [split_s_prefix ++ "__*"] -- d:-)
580 -- allocate a tmp file to put the no. of split .s files in (sigh)
581 n_files <- newTempName "n_files"
583 run_something "Split Assembly File"
590 -- save the number of split files for future references
591 s <- readFile n_files
592 let n = read s :: Int
593 writeIORef v_N_split_files n
596 -----------------------------------------------------------------------------
599 run_phase As _basename _suff input_fn output_fn
600 = do as <- readIORef v_Pgm_a
601 as_opts <- getOpts opt_a
603 cmdline_include_paths <- readIORef v_Include_paths
604 let cmdline_include_flags = map (\p -> "-I"++p) cmdline_include_paths
605 run_something "Assembler"
606 (unwords (as : as_opts
607 ++ cmdline_include_flags
608 ++ [ "-c", input_fn, "-o", output_fn ]
612 run_phase SplitAs basename _suff _input_fn _output_fn
613 = do as <- readIORef v_Pgm_a
614 as_opts <- getOpts opt_a
616 split_s_prefix <- readIORef v_Split_prefix
617 n <- readIORef v_N_split_files
619 odir <- readIORef v_Output_dir
620 let real_odir = case odir of
624 let assemble_file n = do
625 let input_s = split_s_prefix ++ "__" ++ show n ++ ".s"
626 let output_o = newdir real_odir
627 (basename ++ "__" ++ show n ++ ".o")
628 real_o <- osuf_ify output_o
629 run_something "Assembler"
630 (unwords (as : as_opts
631 ++ [ "-c", "-o", real_o, input_s ]
634 mapM_ assemble_file [1..n]
637 -----------------------------------------------------------------------------
640 doLink :: [String] -> IO ()
642 ln <- readIORef v_Pgm_l
644 o_file <- readIORef v_Output_file
645 let output_fn = case o_file of { Just s -> s; Nothing -> "a.out"; }
647 pkg_lib_paths <- getPackageLibraryPath
648 let pkg_lib_path_opts = map ("-L"++) pkg_lib_paths
650 lib_paths <- readIORef v_Library_paths
651 let lib_path_opts = map ("-L"++) lib_paths
653 pkg_libs <- getPackageLibraries
654 let pkg_lib_opts = map (\lib -> "-l"++lib) pkg_libs
656 libs <- readIORef v_Cmdline_libraries
657 let lib_opts = map ("-l"++) (reverse libs)
658 -- reverse because they're added in reverse order from the cmd line
660 pkg_extra_ld_opts <- getPackageExtraLdOpts
662 -- probably _stub.o files
663 extra_ld_inputs <- readIORef v_Ld_inputs
665 -- opts from -optl-<blah>
666 extra_ld_opts <- getStaticOpts v_Opt_l
668 run_something "Linker"
670 ([ ln, verb, "-o", output_fn ]
682 -----------------------------------------------------------------------------
683 -- Just preprocess a file, put the result in a temp. file (used by the
684 -- compilation manager during the summary phase).
686 preprocess :: FilePath -> IO FilePath
687 preprocess filename =
688 ASSERT(haskellish_file filename)
689 do pipeline <- genPipeline (StopBefore Hsc) ("preprocess") filename
690 runPipeline pipeline filename False{-no linking-} False{-no -o flag-}
692 -----------------------------------------------------------------------------
693 -- Compile a single module.
695 -- This is the interface between the compilation manager and the
696 -- compiler proper (hsc), where we deal with tedious details like
697 -- reading the OPTIONS pragma from the source file, and passing the
698 -- output of hsc through the C compiler.
700 -- The driver sits between 'compile' and 'hscMain', translating calls
701 -- to the former into calls to the latter, and results from the latter
702 -- into results from the former. It does things like preprocessing
703 -- the .hs file if necessary, and compiling up the .stub_c files to
704 -- generate Linkables.
706 compile :: Finder -- to find modules
707 -> ModSummary -- summary, including source
708 -> Maybe ModIface -- old interface, if available
709 -> HomeSymbolTable -- for home module ModDetails
710 -> HomeIfaceTable -- for home module Ifaces
711 -> PersistentCompilerState -- persistent compiler state
715 = CompOK ModDetails -- new details (HST additions)
716 (Maybe (ModIface, Linkable))
717 -- summary and code; Nothing => compilation not reqd
718 -- (old summary and code are still valid)
719 PersistentCompilerState -- updated PCS
721 | CompErrs PersistentCompilerState -- updated PCS
724 compile finder summary old_iface hst hit pcs = do
725 verb <- readIORef v_Verbose
726 when verb (hPutStrLn stderr
727 (showSDoc (text "compile: compiling"
728 <+> ppr (name_of_summary summary))))
730 init_dyn_flags <- readIORef v_InitDynFlags
731 writeIORef v_DynFlags init_dyn_flags
733 let input_fn = case ms_ppsource summary of
734 Just (ppsource, fingerprint) -> ppsource
735 Nothing -> hs_file (ms_location summary)
737 when verb (hPutStrLn stderr ("compile: input file " ++ input_fn))
739 opts <- getOptionsFromSource input_fn
740 processArgs dynamic_flags opts []
741 dyn_flags <- readIORef v_DynFlags
743 hsc_lang <- readIORef v_Hsc_Lang
744 output_fn <- case hsc_lang of
745 HscAsm -> newTempName (phaseInputExt As)
746 HscC -> newTempName (phaseInputExt HCc)
747 HscJava -> newTempName "java" -- ToDo
748 HscInterpreted -> return (error "no output file")
751 hsc_result <- hscMain dyn_flags{ hscOutName = output_fn }
752 finder summary old_iface hst hit pcs
755 HscFail pcs -> return (CompErrs pcs);
757 HscOK details maybe_iface
758 maybe_stub_h maybe_stub_c maybe_interpreted_code pcs -> do
760 -- if no compilation happened, bail out early
761 case maybe_iface of {
762 Nothing -> return (CompOK details Nothing pcs);
765 let (basename, _) = splitFilename (hs_file (ms_location summary))
766 maybe_stub_o <- dealWithStubs basename maybe_stub_h maybe_stub_c
767 let stub_unlinked = case maybe_stub_o of
769 Just stub_o -> [ DotO stub_o ]
774 -- in interpreted mode, just return the compiled code
775 -- as our "unlinked" object.
777 case maybe_interpreted_code of
778 Just (code,itbl_env) -> return [Trees code itbl_env]
779 Nothing -> panic "compile: no interpreted code"
781 -- we're in batch mode: finish the compilation pipeline.
782 _other -> do pipe <- genPipeline (StopBefore Ln) "" output_fn
783 o_file <- runPipeline pipe output_fn False False
784 return [ DotO o_file ]
786 let linkable = LM (moduleName (ms_mod summary))
787 (hs_unlinked ++ stub_unlinked)
789 return (CompOK details (Just (iface, linkable)) pcs)
793 -----------------------------------------------------------------------------
794 -- stub .h and .c files (for foreign export support)
796 dealWithStubs basename maybe_stub_h maybe_stub_c
798 = do let stub_h = basename ++ "_stub.h"
799 let stub_c = basename ++ "_stub.c"
801 -- copy the .stub_h file into the current dir if necessary
804 Just tmp_stub_h -> do
805 run_something "Copy stub .h file"
806 ("cp " ++ tmp_stub_h ++ ' ':stub_h)
808 -- #include <..._stub.h> in .hc file
809 addCmdlineHCInclude tmp_stub_h -- hack
811 -- copy the .stub_c file into the current dir, and compile it, if necessary
813 Nothing -> return Nothing
814 Just tmp_stub_c -> do -- copy the _stub.c file into the current dir
815 run_something "Copy stub .c file"
817 "rm -f", stub_c, "&&",
818 "echo \'#include \""++stub_h++"\"\' >"++stub_c, " &&",
819 "cat", tmp_stub_c, ">> ", stub_c
822 -- compile the _stub.c file w/ gcc
823 pipeline <- genPipeline (StopBefore Ln) "" stub_c
824 stub_o <- runPipeline pipeline stub_c False{-no linking-}
825 False{-no -o option-}