From df4a295d794d79f1cea02f3ac62cc0671e84e48d Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Mon, 3 Nov 2025 22:28:08 +0100 Subject: [PATCH] Add git-projects-dir-[include|minimal].mk In the attempt to move both jw-build and the janware toplevel Makefile from CVS to Git, add two new makefile snippets to make/*.mk: - projects-dir-minimal.mk A new toplevel-Makefile for building all projects in one go. It should be suitable to be downloaded from janware.com/Makefile and then be used to bootstrap all repos hosted on janware.com, that a user has access to, just like the current toplevel Makefile is. It is as small as possible: Little code means few assumptions on what the world outside of it looks like, notably jw-build. This is desirable, because it lives outside of version control, albeit for a short while, and as long as it does, there's no mechanism in place to keep it current. That said, on first use, it replaces itself with a symbolic link into jw-build and is then version controlled with jw-build. - projects-dir-include.mk This is essentially the existing projects-dir.mk / toplevel-Makefile, which it includes. It's meant as a place for adaptations to the next-generation implementation. This might prove handy to have while both implementations coexist during the transition phase. Signed-off-by: Jan Lindemann --- make/projects-dir-include.mk | 3 +++ make/projects-dir-minimal.mk | 41 ++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 make/projects-dir-include.mk create mode 100644 make/projects-dir-minimal.mk diff --git a/make/projects-dir-include.mk b/make/projects-dir-include.mk new file mode 100644 index 00000000..4c3f3043 --- /dev/null +++ b/make/projects-dir-include.mk @@ -0,0 +1,3 @@ +all: + +include $(JWBDIR)/make/projects-dir.mk diff --git a/make/projects-dir-minimal.mk b/make/projects-dir-minimal.mk new file mode 100644 index 00000000..97fa7a8e --- /dev/null +++ b/make/projects-dir-minimal.mk @@ -0,0 +1,41 @@ +# +# SPDX-License-Identifier: LGPL-2.0-only +# +# Makefile for managing multiple software repositories in one tree +# +# (C) Copyright 2001-2025, Jan Lindemann +# +# This is the top-level Makefile for a janware software build tree. It is +# provided under the terms of the GNU Lesser Public License, Version 2. +# +# Some of its targets download software from janware GmbH servers. For those, +# you will need a janware.com user account. Ask admin@janware.com if you want +# one, then define the JANWARE_USER = environment variable. +# +# Current documentation on how this Makefile is meant to be used can be found +# under https://janware.com/wiki/pub/en/sw/build/. Running "make help" might +# take you there semi-automatically. +# + +PROJECTS_MAKEFILE_NAME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +JWBDIR_GIT_REMOTE ?= ssh://$(JANWARE_USER)@git.janware.com/srv/git/jan/proj/jw-build +JWBDIR ?= $(notdir $(JWBDIR_GIT_REMOTE)) +PROJECTS_DIR_INCLUDE_MK = $(JWBDIR)/make/projects-dir-include.mk + +ifndef JANWARE_USER + JANWARE_USER = $(shell id -un) + $(warning Assuming JANWARE_USER=$(JANWARE_USER) from id -un) + $(warning Explicitly set environment variable JANWARE_USER to turn off this warning!) +endif + +-include local.mk + +all: + +include $(PROJECTS_DIR_INCLUDE_MK) + +$(PROJECTS_DIR_INCLUDE_MK): + git clone --branch jw-dev $(JWBDIR_GIT_REMOTE) $(JWBDIR) + [ -L $(PROJECTS_MAKEFILE_NAME) ] || \ + ln -sf `find $(JWBDIR) -type f -print0 | xargs -0 grep -l some-random-string-to-id-this-makefile` \ + $(PROJECTS_MAKEFILE_NAME)