optDefines = [ Str "-DBARRELFISH" ] ++ Config.defines,
optIncludes = cStdIncs arch archFamily,
optDependencies =
- [ PreDep InstallTree arch "/include/errors/errno.h",
- PreDep InstallTree arch "/include/barrelfish_kpi/capbits.h",
- PreDep InstallTree arch "/include/asmoffsets.h",
- PreDep InstallTree arch "/include/trace_definitions/trace_defs.h" ],
+ [ Dep InstallTree arch "/include/errors/errno.h",
+ Dep InstallTree arch "/include/barrelfish_kpi/capbits.h",
+ Dep InstallTree arch "/include/asmoffsets.h",
+ Dep InstallTree arch "/include/trace_definitions/trace_defs.h" ],
optLdFlags = ldFlags arch,
optLdCxxFlags = ldCxxFlags arch,
optLibs = stdLibs arch,
isOutput :: RuleToken -> Bool
isOutput (Out _ _) = True
+isOutput (Target _ _) = True
isOutput _ = False
formatToken :: RuleToken -> String
printTokens h $ ruleOutputs compiledRule
if double_colon then hPutStr h ":: " else hPutStr h ": "
printTokens h $ ruleDepends compiledRule
- printDirs h $ ruleDirs compiledRule
- when (not (S.null (rulePreDepends compiledRule))) $ do
- hPutStr h " | "
- printTokens h $ rulePreDepends compiledRule
+ -- printDirs h $ ruleDirs compiledRule
+ hPutStr h " | directories "
+ --when (not (S.null (rulePreDepends compiledRule))) $ do
+ printTokens h $ rulePreDepends compiledRule
hPutStrLn h ""
doBody
where
makeDirectories :: Handle -> S.Set FilePath -> IO ()
makeDirectories h dirs = do
hPutStrLn h "# Directories follow"
- mapM_ (makeDir h) (S.toList (S.delete ("." </> ".marker") dirs))
+ --mapM_ (makeDir h) (S.toList (S.delete ("." </> ".marker") dirs))
+ hPutStrLn h "DIRECTORIES=\\"
+ mapM_ (\d -> hPutStrLn h $ " " ++ d ++ " \\") (S.toList dirs)
+ hPutStrLn h "\n"
+ hPutStrLn h ".PHONY: directories"
+ hPutStr h "directories: $(DIRECTORIES)"
+ hPutStrLn h ""
+ hPutStrLn h "%.marker:"
+ hPutStrLn h "\tmkdir -p `dirname $@`"
+ hPutStrLn h "\ttouch $@"
makeDir :: Handle -> FilePath -> IO ()
makeDir h dir = do
liftIO $ putStrLn $ "Generating build directory dependencies..."
liftIO $ makeDirectories makefile dirs
+ liftIO $ hFlush makefile
+ liftIO $ hClose makefile
return ()
main :: IO ()
flounderBindingHelper :: Options -> String -> [String] -> String -> [String] -> HRule
flounderBindingHelper opts ifn backends cfile srcs = Rules $
[ flounderRule opts $ args ++ [flounderIfFileLoc ifn, Out arch cfile ],
- compileGeneratedCFile (opts { extraDependencies = [flounderHeader] }) cfile,
+ compileGeneratedCFile opts cfile,
flounderDefsDepend opts ifn allbackends srcs]
+ ++ [extraGeneratedCDependency opts (flounderIfDefsPath ifn) cfile]
++ [extraGeneratedCDependency opts (flounderIfDrvDefsPath ifn d) cfile
| d <- allbackends]
where
archfam = optArchFamily opts
args = [Str "-a", Str archfam] ++ [Str $ "--" ++ d ++ "-stub" | d <- backends]
allbackends = backends `union` optFlounderBackends opts \\ ["generic"]
- flounderHeader = Dep BuildTree arch $ flounderIfDefsPath ifn
--
-- Build a Flounder THC header file from a definition.
extraCxxFlags = Args.addCxxFlags args,
extraLdFlags = [ Str f | f <- Args.addLinkFlags args ],
extraDependencies =
- [Dep BuildTree arch s | s <- Args.addGeneratedDependencies args]
+ [Dep BuildTree arch s |
+ s <- Args.addGeneratedDependencies args]
}
appBuildArch af tf args arch =