2025-11-13 16:23:35 +01:00
|
|
|
#
|
|
|
|
|
# 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 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 = <janware user name> 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)
|
|
|
|
|
|
2025-11-14 17:13:29 +01:00
|
|
|
$(PROJECTS_DIR_INCLUDE_MK): | $(JWBDIR)
|
|
|
|
|
|
|
|
|
|
$(JWBDIR):
|
2025-11-13 16:23:35 +01:00
|
|
|
git clone $(JWBDIR_GIT_REMOTE) $(JWBDIR)
|
2025-11-17 11:53:28 +01:00
|
|
|
make $(MAKECMDGOALS)
|
2025-11-14 17:13:29 +01:00
|
|
|
|
|
|
|
|
all: link-makefile.done
|
|
|
|
|
link-makefile.done: | $(JWBDIR)
|
2025-11-13 16:23:35 +01:00
|
|
|
[ -L $(PROJECTS_MAKEFILE_NAME) ] || \
|
2025-11-17 11:30:59 +01:00
|
|
|
ln -sf `find $(JWBDIR) -name '*.mk' -print0 | xargs -0 grep -l some-random-string-to-id-this-makefile` \
|
2025-11-13 16:23:35 +01:00
|
|
|
$(PROJECTS_MAKEFILE_NAME)
|
2025-11-14 17:13:29 +01:00
|
|
|
touch $@
|
|
|
|
|
clean: clean.link-makefile
|
|
|
|
|
clean.link-makefile:
|
|
|
|
|
rm -f link-makefile.done
|