1
0
rocket-chip/project/build.scala

43 lines
1.4 KiB
Scala
Raw Normal View History

2012-10-02 04:30:11 +02:00
import sbt._
import Keys._
import complete._
import complete.DefaultParsers._
2016-08-09 04:31:03 +02:00
import xerial.sbt.Pack._
2012-10-02 04:30:11 +02:00
object BuildSettings extends Build {
2012-10-02 04:30:11 +02:00
override lazy val settings = super.settings ++ Seq(
organization := "berkeley",
version := "1.2",
scalaVersion := "2.11.7",
parallelExecution in Global := false,
traceLevel := 15,
scalacOptions ++= Seq("-deprecation","-unchecked"),
libraryDependencies ++= Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
2012-10-02 04:30:11 +02:00
)
lazy val chisel = project in file("chisel3")
lazy val hardfloat = project.dependsOn(chisel)
lazy val rocketchip = (project in file(".")).settings(chipSettings).dependsOn(chisel, hardfloat)
lazy val addons = settingKey[Seq[String]]("list of addons used for this build")
lazy val make = inputKey[Unit]("trigger backend-specific makefile command")
val setMake = NotSpace ~ ( Space ~> NotSpace )
2016-08-09 04:31:03 +02:00
val chipSettings = packAutoSettings ++ Seq(
addons := {
val a = sys.env.getOrElse("ROCKETCHIP_ADDONS", "")
println(s"Using addons: $a")
a.split(" ")
},
unmanagedSourceDirectories in Compile ++= addons.value.map(baseDirectory.value / _ / "src/main/scala"),
mainClass in (Compile, run) := Some("rocketchip.Generator"),
make := {
val jobs = java.lang.Runtime.getRuntime.availableProcessors
val (makeDir, target) = setMake.parsed
(run in Compile).evaluated
s"make -C $makeDir -j $jobs $target" !
}
)
2012-10-02 04:30:11 +02:00
}