jw-pkg/make/projects-dir-minimal.mk
Jan Lindemann aac261d782 projects-dir[-minimal].mk: Change usage comment
The usage comments heading projects-dir-minimal.mk and
projects-dir.mk state that for cloning all repositories, JANWARE_USER
needs to be defined. That restriction is now gone, so reflect that in
the comment.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-18 15:56:21 +01:00

50 lines
1.6 KiB
Makefile

#
# SPDX-License-Identifier: LGPL-2.0-only
#
# Makefile for managing multiple software repositories in one tree
#
# (C) Copyright 2001-2025, Jan Lindemann <jan@janware.com>
#
# This is the top-level Makefile for a software build tree organized by
# jw-build. It is provided under the terms of the GNU Lesser Public License,
# Version 2.
#
# 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))
ifeq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
ifneq ($(JANWARE_USER),)
PROJECTS_DIR_REMOTE_BASE ?= ssh://$(JANWARE_USER)@git.janware.com/srv/git/jan$(PROJECTS_DIR_REMOTE_SUBPATH)/jw-build
else
PROJECTS_DIR_REMOTE_BASE ?= https://janware.com/code/janware
endif
endif
JWBDIR_GIT_REMOTE ?= $(PROJECTS_DIR_REMOTE_BASE)/jw-build
JWBDIR ?= $(notdir $(JWBDIR_GIT_REMOTE))
PROJECTS_DIR_INCLUDE_MK = $(JWBDIR)/make/projects-dir-include.mk
-include local.mk
all:
include $(PROJECTS_DIR_INCLUDE_MK)
$(PROJECTS_DIR_INCLUDE_MK): | $(JWBDIR)
$(JWBDIR):
git clone $(JWBDIR_GIT_REMOTE) $(JWBDIR)
make $(MAKECMDGOALS)
all: link-makefile.done
link-makefile.done: | $(JWBDIR)
[ -L $(PROJECTS_MAKEFILE_NAME) ] || \
ln -sf `find $(JWBDIR) -name '*.mk' -print0 | xargs -0 grep -l some-random-string-to-id-this-makefile` \
$(PROJECTS_MAKEFILE_NAME)
touch $@
clean: clean.link-makefile
clean.link-makefile:
rm -f link-makefile.done