make: Beautify *.mk #31

Merged
Jan Lindemann merged 6 commits from jan/feature/20260624-defs-mk-add-slice-to-local-systemd into master 2026-06-24 21:50:32 +02:00 AGit

This PR fixes some non-blocking bugs and some uglyness in make/*.mk files, and adds some features.

py-defs.mk: Move all path defs into py-path.mk

py-path.mk is the place to host PYTHONPATH and MYPYPATH definitions, so move them there from py-defs.mk for consistency. Also, remove some dead code.

projects-dir.mk: Fix: clean-dirs does too much

The clean-dirs target does not only clean the repos present in PROJECTS, but all repos it finds to be dirty, and clean-all-dirs does the opposite. I suppose that was an oversight, swap their recipes.

Moreover, cleaning all directories goes about its business in an overly complicated and unecessarily time-consuming way, fix that, too.

platform.mk: Move include .cache-project.mk up

Reverse inclusion order of .cache-project.mk and cache-projects.mk: Definitions in .cache-project.mk should win over cache-projects.mk, because it's the more specialized include file, and the way the definitions in both files are structured, the later doesn't overwrite the earlier.

platform.mk: Support PREREQ_RUN_ADD

Modifying JW_PKG_XXX_PATH in pre-local.mk is fragile.

Amending PREREQ_RUN in pre-local.mk works, but only with $(JW_PKG_NO_CACHE) == true, or if "undefine JW_PKG_XXX_PATH" is also added in pre-local.mk. Otherwise JW_PKG_XXX_PATH will not be recomputed, because it's already defined from the cache.

Introduce the new variable PREREQ_RUN_ADD to solve that. If it's defined, it automatically invalidates the JW_PKG_XXX_PATH variables and sets them up for recalculation in py-path.mk / ldlibpath.mk.

defs.mk: Minor code beautification

Uppercase some comments, and remove some dead code.

defs.mk: Add *.slice to LOCAL_SYSTEMD

Support automatic installation of *.slice files into the system's systemd directory.

This PR fixes some non-blocking bugs and some uglyness in make/*.mk files, and adds some features. #### py-defs.mk: Move all path defs into py-path.mk py-path.mk is the place to host PYTHONPATH and MYPYPATH definitions, so move them there from py-defs.mk for consistency. Also, remove some dead code. #### projects-dir.mk: Fix: clean-dirs does too much The clean-dirs target does not only clean the repos present in PROJECTS, but all repos it finds to be dirty, and clean-all-dirs does the opposite. I suppose that was an oversight, swap their recipes. Moreover, cleaning all directories goes about its business in an overly complicated and unecessarily time-consuming way, fix that, too. #### platform.mk: Move include .cache-project.mk up Reverse inclusion order of .cache-project.mk and cache-projects.mk: Definitions in .cache-project.mk should win over cache-projects.mk, because it's the more specialized include file, and the way the definitions in both files are structured, the later doesn't overwrite the earlier. #### platform.mk: Support PREREQ_RUN_ADD Modifying JW_PKG_XXX_PATH in pre-local.mk is fragile. Amending PREREQ_RUN in pre-local.mk works, but only with $(JW_PKG_NO_CACHE) == true, or if "undefine JW_PKG_XXX_PATH" is also added in pre-local.mk. Otherwise JW_PKG_XXX_PATH will not be recomputed, because it's already defined from the cache. Introduce the new variable PREREQ_RUN_ADD to solve that. If it's defined, it automatically invalidates the JW_PKG_XXX_PATH variables and sets them up for recalculation in py-path.mk / ldlibpath.mk. #### defs.mk: Minor code beautification Uppercase some comments, and remove some dead code. #### defs.mk: Add *.slice to LOCAL_SYSTEMD Support automatic installation of *.slice files into the system's systemd directory.

py-path.mk is the place to host PYTHONPATH and MYPYPATH definitions, so move them there from py-defs.mk for consistency. Also, remove some dead code.

Signed-off-by: Jan Lindemann <jan@janware.com>

The clean-dirs target does not only clean the repos present in PROJECTS, but all repos it finds to be dirty, and clean-all-dirs does the opposite. I suppose that was an oversight, swap their recipes.

Moreover, cleaning all directories goes about its business in an overly complicated and unecessarily time-consuming way, fix that, too.

Signed-off-by: Jan Lindemann <jan@janware.com>

Reverse inclusion order of .cache-project.mk and cache-projects.mk: Definitions in .cache-project.mk should win over cache-projects.mk, because it's the more specialized include file, and the way the definitions in both files are structured, the later doesn't overwrite the earlier.

Signed-off-by: Jan Lindemann <jan@janware.com>

Modifying JW_PKG_XXX_PATH in pre-local.mk is fragile.

Amending PREREQ_RUN in pre-local.mk works, but only with $(JW_PKG_NO_CACHE) == true, or if "undefine JW_PKG_XXX_PATH" is also added in pre-local.mk. Otherwise JW_PKG_XXX_PATH will not be recomputed, because it's already defined from the cache.

Introduce the new variable PREREQ_RUN_ADD to solve that. If it's defined, it automatically invalidates the JW_PKG_XXX_PATH variables and sets them up for recalculation in py-path.mk / ldlibpath.mk.

Signed-off-by: Jan Lindemann <jan@janware.com>

Uppercase some comments, and remove some dead code.

Signed-off-by: Jan Lindemann <jan@janware.com>
defs.mk: Add *.slice to LOCAL_SYSTEMD
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m3s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m7s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m1s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 3m9s
CI / Packaging test (push) Successful in 0s
80cafa4737

Support automatic installation of *.slice files into the system's systemd directory.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-06-24 21:43:16 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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!31
No description provided.