make: Make targets tests & check more universally useful #51

Closed
Jan Lindemann wants to merge 9 commits from jan/feature/20260722-make-make-targets-tests-check-more-universally-useful into master AGit

This PR brings a couple of improvements to the makefile snippets in make, targeted at a more streamlined usage experience for both people and machines.

ldlibpath.mk: Don't include py-path.mk anylonger

For backwards compatibility, ldlibpath.mk kept py-path.mk included. The projects depending on that have been fixed by now, this is no longer needed, don't include it anylonger, thereby reducing the complexity of the include graph.

py-defs.mk: Allow inclusion without defs.mk

py-defs.mk uses the variables ECHO and SED defined in defs.mk. The complexity this introduces doesn't justify the reduced redundancy, though, so this commit defines them redundantly in py-defs.mk and to allow inclusion without prior defs.mk.

py-check.mk: Add file

Add py-check.mk and use it from py-topdir.mk and py-rules.mk. This removes redundant check definitions, making sure that that checks run from a repo's subdirectory match the checks run from its toplevel directory.

py-path.mk: Add target py-path

Add target py-path to py-path.mk. It's mostly there for documentation purposes, giving people and machines a defined, easily accessible and omni-present way to determine how Python imports should be resolved.

rules.mk / defs.mk: Disable BUILD_MAKEDIR

BUILD_MAKEDIR is a variable which exists for consistency's sake. On the other hand, nor jw-pkg nor any downstream package ever copies makefile snippets during build time. The rule introduced by BUILD_MAKEDIR is quite costly in terms of performance and makes caching harder to understand. This commit disables the variable.

cmds.projects.CmdBuild: Support --dep-flavours

CmdBuild caters for the needs of the targets all, clean and pkg-*. It uses builtin dependency flavours matching those targets to resolve build order. To make it more flexible in general and support more targets, e.g. check and test, add a --dep-flavours option.

projects-dir.mk: Add target test

projects-dir.mk has no test target, fix that.

projects-dir.mk: Support check targets

Add support for the targets check and check-post to projects-dir.mk to make them usable from inside the projects directory.

Note that check-pre is intentionally left out: Running make check in a repo before its prerequisite repos have built their init.py files will fail due to broken import resolution.

install-files.mk: Add missing target "test"

install-files.mk lacks a "test" target, so this commit adds a stub.

This PR brings a couple of improvements to the makefile snippets in make, targeted at a more streamlined usage experience for both people and machines. #### ldlibpath.mk: Don't include py-path.mk anylonger For backwards compatibility, ldlibpath.mk kept py-path.mk included. The projects depending on that have been fixed by now, this is no longer needed, don't include it anylonger, thereby reducing the complexity of the include graph. #### py-defs.mk: Allow inclusion without defs.mk py-defs.mk uses the variables ECHO and SED defined in defs.mk. The complexity this introduces doesn't justify the reduced redundancy, though, so this commit defines them redundantly in py-defs.mk and to allow inclusion without prior defs.mk. #### py-check.mk: Add file Add py-check.mk and use it from py-topdir.mk and py-rules.mk. This removes redundant check definitions, making sure that that checks run from a repo's subdirectory match the checks run from its toplevel directory. #### py-path.mk: Add target py-path Add target py-path to py-path.mk. It's mostly there for documentation purposes, giving people and machines a defined, easily accessible and omni-present way to determine how Python imports should be resolved. #### rules.mk / defs.mk: Disable BUILD_MAKEDIR BUILD_MAKEDIR is a variable which exists for consistency's sake. On the other hand, nor jw-pkg nor any downstream package ever copies makefile snippets during build time. The rule introduced by BUILD_MAKEDIR is quite costly in terms of performance and makes caching harder to understand. This commit disables the variable. #### cmds.projects.CmdBuild: Support --dep-flavours CmdBuild caters for the needs of the targets all, clean and pkg-*. It uses builtin dependency flavours matching those targets to resolve build order. To make it more flexible in general and support more targets, e.g. check and test, add a --dep-flavours option. #### projects-dir.mk: Add target test projects-dir.mk has no test target, fix that. #### projects-dir.mk: Support check targets Add support for the targets check and check-post to projects-dir.mk to make them usable from inside the projects directory. Note that check-pre is intentionally left out: Running make check in a repo before its prerequisite repos have built their __init__.py files will fail due to broken import resolution. #### install-files.mk: Add missing target "test" install-files.mk lacks a "test" target, so this commit adds a stub.
For backwards compatibility, ldlibpath.mk kept py-path.mk included.
The projects depending on that have been fixed by now, this is no
longer needed, don't include it anylonger, thereby reducing the
complexity of the include graph.

Signed-off-by: Jan Lindemann <jan@janware.com>
py-defs.mk uses the variables ECHO and SED defined in defs.mk. The
complexity this introduces doesn't justify the reduced redundancy,
though, so this commit defines them redundantly in py-defs.mk and to
allow inclusion without prior defs.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>
Add py-check.mk and use it from py-topdir.mk and py-rules.mk. This
removes redundant check definitions, making sure that that checks run
from a repo's subdirectory match the checks run from its toplevel
directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
Add target py-path to py-path.mk. It's mostly there for documentation
purposes, giving people and machines a defined, easily accessible and
omni-present way to determine how Python imports should be resolved.

Signed-off-by: Jan Lindemann <jan@janware.com>
BUILD_MAKEDIR is a variable which exists for consistency's sake. On
the other hand, nor jw-pkg nor any downstream package ever copies
makefile snippets during build time. The rule introduced by
BUILD_MAKEDIR is quite costly in terms of performance and makes
caching harder to understand. This commit disables the variable.

Signed-off-by: Jan Lindemann <jan@janware.com>
CmdBuild caters for the needs of the targets all, clean and pkg-*. It
uses builtin dependency flavours matching those targets to resolve
build order. To make it more flexible in general and support more
targets, e.g. check and test, add a --dep-flavours option.

Signed-off-by: Jan Lindemann <jan@janware.com>
projects-dir.mk has no test target, fix that.

Signed-off-by: Jan Lindemann <jan@janware.com>
Add support for the targets check and check-post to projects-dir.mk
to make them usable from inside the projects directory.

Note that check-pre is intentionally left out: Running make check in
a repo before its prerequisite repos have built their __init__.py
files will fail due to broken import resolution.

Signed-off-by: Jan Lindemann <jan@janware.com>
install-files.mk: Add missing target "test"
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 3m43s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 3m40s
CI / Packaging test (pull_request) Failing after 0s
9ff92bd541
install-files.mk lacks a "test" target, so this commit adds a stub.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-07-22 15:27:54 +02:00
Jan Lindemann closed this pull request 2026-08-20 07:53:01 +02:00
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 3m43s
Required
Details
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 3m40s
Required
Details
CI / Packaging test (pull_request) Failing after 0s
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!51
No description provided.