Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ all: c csharp elixir go java nim nodejs python rust

.PHONY: c
c:
@make -C src
@$(MAKE) -C src

.PHONY: csharp
csharp:
@make -C bindings/csharp
@$(MAKE) -C bindings/csharp

.PHONY: elixir
elixir:
Expand All @@ -19,19 +19,19 @@ go:

.PHONY: java
java:
@make -C bindings/java build test
@$(MAKE) -C bindings/java build test

.PHONY: nim
nim:
@cd bindings/nim && nim test

.PHONY: nodejs
nodejs:
@make -C bindings/node.js
@$(MAKE) -C bindings/node.js

.PHONY: python
python:
@make -C bindings/python
@$(MAKE) -C bindings/python

.PHONY: rust
rust:
Expand Down
16 changes: 14 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
from os import chdir
from os import chdir, environ
from pathlib import Path
from platform import system
from shutil import which
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from subprocess import check_call


def get_make():
"""Get the GNU make command. Honors $MAKE if set."""
if "MAKE" in environ:
return environ["MAKE"]
if system() == "FreeBSD":
if not which("gmake"):
raise RuntimeError("GNU make (gmake) is required on FreeBSD")
return "gmake"
return "make"


class CustomBuild(build_ext):
def run(self):
if system() == "Windows":
try:
check_call(["blst\\build.bat"])
except Exception:
pass
check_call(["make", "-C", "src", "blst"])
check_call([get_make(), "-C", "src", "blst"])
super().run()


Expand Down
Loading