Skip to content

Commit

Permalink
Add target for building bluespec-libraries, also 'bluespec' alias
Browse files Browse the repository at this point in the history
'bluespec-libraries' builds and installs the B-lang-org/bsc-contrib repo
into the local install.

'bluespec' is a dummy target which depends on 'bluespec-libraries' which
depends on 'bluespec-compiler', so building 'bluespec' with dependencies
builds both.

Upstream bluespec-compiler's makefile tends to rebuild all its BSV files
even if nothing changed, so building 'bluespec-libraries' also causes the
BSV inside bluespec-compiler to get rebuilt.  Not sure if there's an easy
solution for this.
  • Loading branch information
tmarkettos committed Aug 8, 2024
1 parent 0bbf3cc commit 8c944f0
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pycheribuild/projects/bluespec_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
# SUCH DAMAGE.
#
from .project import DefaultInstallDir, GitRepository, MakeCommandKind, Project
from .project import ExternallyManagedSourceRepository
from .simple_project import TargetAliasWithDependencies
from ..utils import OSInfo


Expand Down Expand Up @@ -86,3 +88,26 @@ def install(self, **kwargs):

def run_tests(self) -> None:
self.run_cmd("check-smoke")


class BuildBluespecLibraries(Project):
target = "bluespec-libraries"
dependencies = ("bluespec-compiler",)
default_directory_basename = "bsc-contrib"
repository = GitRepository("https://github.com/B-Lang-org/bsc-contrib.git")
native_install_dir = DefaultInstallDir.BOOTSTRAP_TOOLS
build_in_source_dir = True
make_kind = MakeCommandKind.GnuMake

def compile(self, **kwargs):
self.make_args.set(PREFIX=self.install_dir)
self.run_make("all")

def clean(self):
self.make_args.set(PREFIX=self.install_dir)
self.run_make("full_clean", cwd=self.source_dir)


class BuildBluespec(TargetAliasWithDependencies):
target = "bluespec"
dependencies = ("bluespec-libraries",)

0 comments on commit 8c944f0

Please sign in to comment.