diff --git a/make/projects-dir.mk b/make/projects-dir.mk index 0905b984..beea8e4e 100644 --- a/make/projects-dir.mk +++ b/make/projects-dir.mk @@ -43,8 +43,10 @@ EXCLUDE_FROM_BUILD += \ # ------------ external programs I +CWD := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) MOD_SCRIPT_DIR = ./jw-build/scripts GET_OS_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/get-os.sh /opt/jw-build/bin/get-os.sh) get-os-sh-not-found) +SSH_WRAPPER_SH := $(CWD)/ssh-wrapper.sh EXCLUDES_FILE ?= exclude.txt EXCLUDES_FILES = exclude-$(shell $(GET_OS_SH) name).txt exclude-$(shell $(GET_OS_SH)).txt $(EXCLUDES_FILE) @@ -62,14 +64,12 @@ else UNAVAILABLE_TARGETS ?= endif -CWD := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) - export CVSROOT = :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs ifneq ($(JW_BUILD_SSH),) export CVS_RSH := $(JW_BUILD_SSH) else - export CVS_RSH := $(CWD)/ssh-wrapper.sh + export CVS_RSH := $(SSH_WRAPPER_SH) endif export GIT_SSH := $(CVS_RSH) @@ -173,12 +173,12 @@ pkg-init-%: doc-project doc-module: $(BROWSER) $(firstword $(shell sed '/https:/ !d; s%.*https%https%; s/ .*//' $(firstword $(MAKEFILE_LIST)))) -status: ssh-wrapper.sh +status: $(SSH_WRAPPER_SH) for p in $(CVS_PROJECTS); do test -f $$d/CVS || echo $$p; done cvs status $(addsuffix VERSION,$(CVS_PROJECTS)) $(PGIT) status -purge: ssh-wrapper.sh +purge: $(SSH_WRAPPER_SH) ifneq ($(wildcard CVS),) $(PURGE_SH) endif @@ -195,47 +195,47 @@ pull-all: purge cvs-update git-clone git-pull-all touch clone.done touch pull.done -diff-all diff: ssh-wrapper.sh +diff-all diff: $(SSH_WRAPPER_SH) cvs diff -u; $(PGIT) diff rebuild: clean purge pull subdirs-all -release: ssh-wrapper.sh +release: $(SSH_WRAPPER_SH) $(RELEASE_SH) subdirs-%: FORCE_REBUILD_SUBDIRS=true make $* -cvs-update: ssh-wrapper.sh +cvs-update: $(SSH_WRAPPER_SH) rm -f $@.done make $@.done -cvs-diff: ssh-wrapper.sh +cvs-diff: $(SSH_WRAPPER_SH) cvs diff -u -git-push push: ssh-wrapper.sh +git-push push: $(SSH_WRAPPER_SH) $(PGIT) push -git-push-all: ssh-wrapper.sh +git-push-all: $(SSH_WRAPPER_SH) $(PGIT) push --all -git-diff: ssh-wrapper.sh +git-diff: $(SSH_WRAPPER_SH) $(PGIT) diff -git-short-diff: ssh-wrapper.sh +git-short-diff: $(SSH_WRAPPER_SH) $(PGIT) diff --shortstat -git-pull: ssh-wrapper.sh +git-pull: $(SSH_WRAPPER_SH) $(PGIT) clone -git-pull-all: ssh-wrapper.sh +git-pull-all: $(SSH_WRAPPER_SH) $(PGIT) pull --all -git-clone: ssh-wrapper.sh +git-clone: $(SSH_WRAPPER_SH) $(PGIT) clone touch clone.done -git-clone-%: ssh-wrapper.sh +git-clone-%: $(SSH_WRAPPER_SH) PGIT_CLONE_FROM_USER=$* $(PGIT) clone git-show-non-master-branches: @@ -248,13 +248,13 @@ git-show-non-master-branches: fi ;\ done -pull-%: ssh-wrapper.sh +pull-%: $(SSH_WRAPPER_SH) PGIT_CLONE_FROM_USER=$* $(PGIT) clone git-commit: $(PGIT) commit -git-conv-%: ssh-wrapper.sh +git-conv-%: $(SSH_WRAPPER_SH) [ -e $*/.git ] || { \ mv $* old/ ;\ if PROJECTS="$*" make clone; then \ @@ -264,15 +264,15 @@ git-conv-%: ssh-wrapper.sh fi \ } -check-conv: ssh-wrapper.sh +check-conv: $(SSH_WRAPPER_SH) for p in `$(GIT_SRV_ADMIN_SH) -u jan -j list-personal-projects`; do \ make git-conv-$$p ;\ done -list-maintainers: ssh-wrapper.sh +list-maintainers: $(SSH_WRAPPER_SH) $(GIT_SRV_ADMIN_SH) $@ -git-update-project-descriptions: ssh-wrapper.sh +git-update-project-descriptions: $(SSH_WRAPPER_SH) $(GIT_SRV_ADMIN_SH) -j update-descriptions all projects.txt: @@ -286,16 +286,16 @@ links.done: if [ -d dspc/src/shared ]; then ln -sf dspc/src/shared dspider-shared; fi touch $@ -ssh-wrapper.sh: Makefile +$(SSH_WRAPPER_SH): Makefile /bin/echo -e '#!/bin/bash -x\n\nexec /usr/bin/ssh $$JW_BUILD_SSH_EXTRA_OPTS "$$@"' > $@.tmp chmod 700 $@.tmp mv $@.tmp $@ -ssh-wrapper: ssh-wrapper.sh +ssh-wrapper: $(SSH_WRAPPER_SH) clean.ssh-wrapper: - rm -f ssh-wrapper.sh + rm -f $(SSH_WRAPPER_SH) clean: clean.ssh-wrapper -cvsdir.done: ssh-wrapper.sh +cvsdir.done: $(SSH_WRAPPER_SH) if [ ! -d CVS ]; then \ mkdir CVS && \ echo :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs > CVS/Root && \ @@ -304,7 +304,7 @@ cvsdir.done: ssh-wrapper.sh fi touch $@ -cvs-update.done: $(filter-out $(UNAVAILABLE_TARGETS),cvsdir.done ssh-wrapper.sh) +cvs-update.done: $(filter-out $(UNAVAILABLE_TARGETS),cvsdir.done $(SSH_WRAPPER_SH)) cvs update -dP Makefile $(shell $(CVS_ADMIN_SH) list-projects) touch $@ @@ -313,7 +313,7 @@ update.done: purge pull.done: $(filter-out $(UNAVAILABLE_TARGETS),cvs-update.done clone.done links.done) touch $@ -clone.done: $(filter-out $(UNAVAILABLE_TARGETS),ssh-wrapper.sh) +clone.done: $(filter-out $(UNAVAILABLE_TARGETS),$(SSH_WRAPPER_SH)) $(PGIT) clone touch $@