diff options
| -rw-r--r-- | ext/Makefile | 14 | ||||
| -rw-r--r-- | pyproject.toml | 5 | ||||
| -rw-r--r-- | setup.py | 5 |
3 files changed, 14 insertions, 10 deletions
diff --git a/ext/Makefile b/ext/Makefile index ffd53d5..9af9657 100644 --- a/ext/Makefile +++ b/ext/Makefile @@ -8,11 +8,13 @@ help: clean: $(MAKE) -C libtommath clean +TOMMATH_DIR?=../pyecsca/codegen/tommath + tommath_dir: - mkdir -p ../pyecsca/codegen/tommath + mkdir -p $(TOMMATH_DIR) tommath_headers: tommath_dir - cp libtommath/*.h ../pyecsca/codegen/tommath/ + cp -u libtommath/*.h $(TOMMATH_DIR) host: LIBNAME=libtommath-HOST.a host: CFLAGS=-DMP_NO_DEV_URANDOM -DMP_LOW_MEM -DMP_DEFAULT_DIGIT_COUNT=10 -DMP_MIN_DIGIT_COUNT=10 @@ -21,7 +23,7 @@ host: COMPILE_LTO=1 host: tommath_dir tommath_headers $(MAKE) -C libtommath clean $(MAKE) -C libtommath - cp libtommath/$(LIBNAME) ../pyecsca/codegen/tommath/$(LIBNAME) + cp -u libtommath/$(LIBNAME) $(TOMMATH_DIR)/$(LIBNAME) nano: CROSS_COMPILE=arm-none-eabi- nano: CFLAGS=-mcpu=cortex-m0 -mthumb -mfloat-abi=soft -ffunction-sections -DMP_NO_DEV_URANDOM -DMP_32BIT -DMP_LOW_MEM -DMP_DEFAULT_DIGIT_COUNT=10 -DMP_MIN_DIGIT_COUNT=10 @@ -32,7 +34,7 @@ nano: LIBNAME=libtommath-CWNANO.a nano: tommath_dir tommath_headers $(MAKE) -C libtommath clean $(MAKE) -C libtommath - cp libtommath/$(LIBNAME) ../pyecsca/codegen/tommath/$(LIBNAME) + cp -u libtommath/$(LIBNAME) $(TOMMATH_DIR)/$(LIBNAME) stm32f0: CROSS_COMPILE=arm-none-eabi- stm32f0: CFLAGS=-mcpu=cortex-m0 -mthumb -mfloat-abi=soft -ffunction-sections -DMP_NO_DEV_URANDOM -DMP_32BIT -DMP_LOW_MEM -DMP_DEFAULT_DIGIT_COUNT=10 -DMP_MIN_DIGIT_COUNT=10 @@ -43,7 +45,7 @@ stm32f0: LIBNAME=libtommath-CW308_STM32F0.a stm32f0: tommath_dir tommath_headers $(MAKE) -C libtommath clean $(MAKE) -C libtommath - cp libtommath/$(LIBNAME) ../pyecsca/codegen/tommath/$(LIBNAME) + cp -u libtommath/$(LIBNAME) $(TOMMATH_DIR)/$(LIBNAME) stm32f3: CROSS_COMPILE=arm-none-eabi- stm32f3: CFLAGS=-mcpu=cortex-m4 -mthumb -mfloat-abi=soft -mfpu=fpv4-sp-d16 -fmessage-length=0 -ffunction-sections -DMP_NO_DEV_URANDOM -DMP_32BIT -DMP_LOW_MEM -DMP_DEFAULT_DIGIT_COUNT=10 -DMP_MIN_DIGIT_COUNT=10 @@ -54,6 +56,6 @@ stm32f3: LIBNAME=libtommath-CW308_STM32F3.a stm32f3: tommath_dir tommath_headers $(MAKE) -C libtommath clean $(MAKE) -C libtommath - cp libtommath/$(LIBNAME) ../pyecsca/codegen/tommath/$(LIBNAME) + cp -u libtommath/$(LIBNAME) $(TOMMATH_DIR)/$(LIBNAME) .PHONY: all host nano stm32f0 stm32f3 tommath_dir tommath_headers help clean diff --git a/pyproject.toml b/pyproject.toml index 41585c7..5dee05e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,11 +4,14 @@ [project] name = "pyecsca-codegen" - version = "0.3.0" + version = "0.3.2" authors = [ { name = "Jan Jancar", email = "johny@neuromancer.sk" }, { name = "Andrej Batora"} ] + maintainers = [ + { name = "Jan Jancar", email = "johny@neuromancer.sk" } + ] description = "Python Elliptic Curve cryptography Side Channel Analysis toolkit (codegen package)." readme = "README.md" license = { "text" = "MIT" } @@ -16,9 +16,8 @@ class CustomTommath(Command): def run(self) -> None: if self.build_lib: - subprocess.run(["make", "host", "nano", "stm32f0", "stm32f3"], cwd="ext") - tommath_dir = Path("pyecsca/codegen/tommath") - shutil.copytree(tommath_dir, self.build_lib / tommath_dir) + tommath_dir = Path("..") / self.build_lib / Path("pyecsca/codegen/tommath") + subprocess.run(["make", "host", "nano", "stm32f0", "stm32f3", f"TOMMATH_DIR={tommath_dir}"], cwd="ext") |
