make: Miscellaneous versatility improvements #83

Merged
Jan Lindemann merged 5 commits from jan/feature/20260905-make-miscellaneous-versatility-improvements into master 2026-09-05 13:49:10 +02:00 AGit
Showing only changes of commit f3f0ef10ca - Show all commits

pgit.sh: Allow running under any projects-dir.mk

There's a random string "some-random-string-to-id-this-makefile" in
projects-dir-minimial.mk intended to check if the Makefile in the
projects-directory is actually the final link target. It's re-used in
pgit.sh to find the projects toplevel directory, but since it doesn't need
to be an actual projects-dir-minimal.mk copy, another case should also be
taken into consideration: Check if projects-dir.mk is included.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann 2026-08-24 14:35:42 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -78,7 +78,7 @@ set_global_variables()
# If we're in a toplevel directory, suppose projects_dir == project_dirs,
# i.e. we only want to target this Git repo
if [ ! -d .git ]; then
while [ ! -r Makefile ] || ! grep -q some-random-string-to-id-this-makefile Makefile; do
while [ ! -r Makefile ] || ! grep -q 'include $(JWBDIR)/make/projects-dir\.mk\|some-random-string-to-id-this-makefile' Makefile; do
[ "$projects_dir" = / ] && fatal "Failed to find projects directory"
projects_dir=`dirname $projects_dir`
done