$NetBSD: patch-Makefile,v 1.3 2025/09/24 05:54:54 dkazankov Exp $ Make python bin settable Add gprbuild and gprinstall options Make install target for a library Fix huge /tmp waste during testing --- Makefile.orig 2024-01-03 19:00:52.000000000 +0200 +++ Makefile @@ -3,6 +3,10 @@ PROCESSORS ?= 0 BUILD_DIR ?= . INSTALL_DIR ?= . +PYTHON ?= python3 + +GPRBUILD_OPTIONS ?= -p -j$(PROCESSORS) +GPRINSTALL_OPTIONS ?= ALL_LIBRARY_TYPES = static static-pic relocatable @@ -11,17 +15,29 @@ gprbuild -k -P adasat.gpr -p -j$(PROCESSORS) \ --relocate-build-tree="$(BUILD_DIR)" \ -XLIBRARY_TYPE=$(LIBRARY_TYPE) \ - -XBUILD_MODE=$(BUILD_MODE) + -XBUILD_MODE=$(BUILD_MODE) \ + $(GPRBUILD_OPTIONS) .PHONY: all-libs all-libs: for kind in $(ALL_LIBRARY_TYPES) ; do \ - gprbuild -k -P adasat.gpr -p -j$(PROCESSORS) \ + gprbuild -k -P adasat.gpr $(GPRBUILD_OPTIONS) \ --relocate-build-tree="$(BUILD_DIR)" \ -XLIBRARY_TYPE=$$kind \ -XBUILD_MODE=$(BUILD_MODE) ; \ done +.PHONY: install-lib +install-lib: + gprinstall -P adasat.gpr -p -f \ + -XLIBRARY_TYPE=$(LIBRARY_TYPE) \ + -XBUILD_MODE=$(BUILD_MODE) \ + --relocate-build-tree="$(BUILD_DIR)" \ + --prefix="$(INSTALL_DIR)" \ + --build-name=$(LIBRARY_TYPE) \ + --build-var=LIBRARY_TYPE ; \ + $(GPRINSTALL_OPTIONS) \ + .PHONY: install install: for kind in $(ALL_LIBRARY_TYPES) ; do \ @@ -32,6 +48,7 @@ --prefix="$(INSTALL_DIR)" \ --build-name=$$kind \ --build-var=LIBRARY_TYPE ; \ + $(GPRINSTALL_OPTIONS) \ done .PHONY: test @@ -43,5 +60,5 @@ .PHONY: test test: lib - python3 testsuite/testsuite.py + $(PYTHON) testsuite/testsuite.py --dev-temp=$(shell pwd)/testsuite/temp