jw-pkg/make/projects-dir-minimal.mk
Jan Lindemann 41cc712dee projects-dir-minimal.mk: Clone jw-build with proactiveAuth=basic
Pass -c http.proactiveAuth=basic to the initial "git clone jw-build"
invocation. This is necessary while jw-build is still behind
authentication. The restriction will likely be lifted (for jw-build),
but for testing now it's fine, and it doesn't do any harm, either.
With the way janware.com currently operates, it will also necessary
for push over HTTP, so  make it persistent in jw-build's
configuration.

Signed-off-by: Jan Lindemann <jan@janware.com>
2025-11-20 09:38:24 +01:00

59 lines
1.9 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))
-include local.mk
JWBDIR ?= jw-build
ifeq ($(JANWARE_USER),)
ifneq ($(wildcard $(JWBDIR)),)
JANWARE_USER := $(shell /usr/bin/python3 $(JWBDIR)/scripts/jw-projects.py -p . get-auth-info --username --only-values)
endif
endif
ifeq ($(origin PROJECTS_DIR_REMOTE_BASE),undefined)
ifneq ($(JANWARE_USER),)
CLONE_FROM_USER ?= $(JANWARE_USER)
PROJECTS_DIR_REMOTE_BASE ?= ssh://$(JANWARE_USER)@git.janware.com/srv/git
else
CLONE_FROM_USER ?= janware
PROJECTS_DIR_REMOTE_BASE ?= https://janware.com/code
endif
endif
JWBDIR_GIT_REMOTE ?= $(PROJECTS_DIR_REMOTE_BASE)/$(CLONE_FROM_USER)/$(notdir $(JWBDIR))
PROJECTS_DIR_INCLUDE_MK = $(JWBDIR)/make/projects-dir-include.mk
all:
include $(PROJECTS_DIR_INCLUDE_MK)
$(PROJECTS_DIR_INCLUDE_MK): | $(JWBDIR)
$(JWBDIR):
git -c http.proactiveAuth=basic clone $(addprefix -b ,$(JW_BUILD_BRANCH)) $(JWBDIR_GIT_REMOTE) $(JWBDIR)
git -C $(JWBDIR) config set http.proactiveAuth basic
make $(MAKECMDGOALS)
all: link-makefile.done
link-makefile.done: | $(JWBDIR)
[ -L $(PROJECTS_MAKEFILE_NAME) ] || \
ln -sf `git -C $(JWBDIR) ls-files | sed '/\.mk$$/ !d; s|^|$(JWBDIR)/|' | xargs 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