mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
projects-dir-minimal.mk: Improve on link-makefile.done
- Make PROJECTS_MAKEFILE_NAME point to first in $(MAKEFILE_LIST)
- Allow to include projects-dir-minimal.mk in hand-written Makefile
without fear that its going to be overwritten with a link
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
f0832d2b4b
commit
c6444a4a72
1 changed files with 6 additions and 4 deletions
|
|
@ -13,7 +13,7 @@
|
|||
# take you there semi-automatically.
|
||||
#
|
||||
|
||||
PROJECTS_MAKEFILE_NAME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
PROJECTS_MAKEFILE_NAME := $(firstword $(MAKEFILE_LIST))
|
||||
|
||||
-include local.mk
|
||||
|
||||
|
|
@ -69,11 +69,13 @@ ifneq ($(findstring proactiveAuth,$(GIT_GLOBAL_OPTS)),)
|
|||
endif
|
||||
make $(MAKECMDGOALS)
|
||||
|
||||
RANDOM_STRING := some-random-string-to-id-this-makefile
|
||||
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)
|
||||
if [ ! -L $(PROJECTS_MAKEFILE_NAME) ] && grep -q $(RANDOM_STRING) $(PROJECTS_MAKEFILE_NAME); then \
|
||||
ln -sf `git -C $(JWBDIR) ls-files | sed '/\.mk$$/ !d; s|^|$(JWBDIR)/|' | xargs grep -l $(RANDOM_STRING)` \
|
||||
$(PROJECTS_MAKEFILE_NAME) ;\
|
||||
fi
|
||||
touch $@
|
||||
clean: clean.link-makefile
|
||||
clean.link-makefile:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue