# ------------ initial CVS subdir define CVSDIR_MIME = QlpoOTFBWSZTWWJXrDwAALh/ks+QASBAAf/yX0pbRH9/32AMACAICEhAAjxTRLQJSU0MQ0ZGg0NA NAABoAYgEoKZqaUZAGIaADQMCAyAGhzCYBMAJhMJpgAAEyaaBgqiIBTU8TQJpiaD1A000NBtQZBp 6n3Pqd34r6q1rp7jU4p2m4SoTphMzBOYREcazicanaSYFSRyFSwyWry+k1mk8FxGIRIi3mcu7s14 2XTclqxiGevXXfzEUO/G9pLy18RsGVPNLwrkuTDKRZSlOMwwMQJTB6g4CkUsCBwEb5QQSdHs6fd8 fl1/PA6SSGRJEm/zzG9nNLlt4+bA5eGliSzcFOglxEOpQlCcxMZVZCFsFBaS1ahpTLYOJOgkrVZd WlOoD+DIxNBSklznplYwKIlRNcjVdbDcUWXoXBUzUMLixVoSiM+DqyZl5dPUqYRGJYZlzElgviit 1xKt9IqrbFGckvqrFw8kGqHCGgFgUJxaEokJQTYmqJYIUJI6KjDLJpOQFkqxIR4t6nC78vJUCYda 7+mnTW5enMuNjE1hMmwTT6CUMx2e+IaBd7cjYX9dS3stdgij8qBNgeI9ZMCMfEzt0WyJ0E5kmAGI gdZdavkjhKwzolGxn/upod7Jqa8YLVthaltxJq2iwovo18A5HatmlIpTU3W0WN4uMfA1g/4u5Ipw oSDEr1h4 endef define newline endef # ------------ makefile and environment variables ifneq ($(PROJECTS),) export PGIT_CLONE_PROJECTS = $(PROJECTS) endif ifneq ($(wildcard projects.txt),) PROJECTS = $(shell cat projects.txt | sed '/^ *\#/ d') # TODO: this could be nicer CVS_PROJECTS = $(PROJECTS) else PROJECTS ?= $(shell ls -d */CVS */.git 2>/dev/null | sed 's%/[^/]*%%') CVS_PROJECTS = $(filter $(dir $(wildcard */CVS)),$(PROJECTS)) endif EXCLUDE_FROM_BUILD = \ dspider-btools \ dspider-shared \ feedfs-dspcd \ casview \ dspfs \ feedfs-qt \ jux3 BUILD_PROJECTS = $(filter-out $(EXCLUDE_FROM_BUILD),$(PROJECTS)) ifeq ($(JANWARE_USER),) export JANWARE_USER = $(shell id -un) endif export CVSROOT = :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs ifeq ($(CVS_RSH),) export CVS_RSH = ssh endif ifneq ($(CLONE_FROM_USER),) export PGIT_CLONE_FROM_USER = $(CLONE_FROM_USER) else export PGIT_CLONE_FROM_USER = $(JANWARE_USER) endif # ------------ commands MOD_SCRIPT_DIR = ./ytools/devutil/scripts PGIT = CLONE_PROJECTS="$(PROJECTS)" /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/pgit.sh /opt/ytools/bin/pgit.sh) pgit.sh-not-found) BUILD_PY = python $(MOD_SCRIPT_DIR)/build.py -b $(shell pwd) $(BUILD_PY_EXTRA_ARGS) PURGE_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/purge-stale-projects.sh /opt/ytools/bin/purge-stale-projects.sh) purge-not-found) RELEASE_SH = /bin/bash $(firstword $(wildcard $(MOD_SCRIPT_DIR)/build-release.sh /opt/ytools/bin/build-release.sh) release-not-found) BROWSER ?= firefox THIS_MAKEFILE = $(lastword $(MAKEFILE_LIST)) # ------------ targets all: pull.done all clean: pull.done $(BUILD_PY) $@ $(BUILD_PROJECTS) clean: done.clean clean-dirs: ls */dirs-all.done 2>/dev/null | sed 's%/.*%%' | xargs -r $(BUILD_PY) clean echo-required-pkg: @make pull.done >/dev/null 2>&1 @python $(MOD_SCRIPT_DIR)/projects.py required-pkg $(BUILD_PROJECTS) doc-project doc-module: $(BROWSER) https://janware.com/wiki/pub/sw:build: pkg-%: pull.done $(BUILD_PY) $@ $(BUILD_PROJECTS) status: for p in $(CVS_PROJECTS); do test -f $$d/CVS || echo $$p; done cvs status $(addsuffix VERSION,$(CVS_PROJECTS)) $(PGIT) status purge: ifneq ($(wildcard CVS),) $(PURGE_SH) endif update pull: purge cvs-update git-clone git-pull touch pull.done pull-all: purge cvs-update git-clone git-pull-all touch pull.done rebuild: clean pull subdirs-all release: $(RELEASE_SH) subdirs-%: FORCE_REBUILD_SUBDIRS=true make $* cvs-update: rm -f $@.done make $@.done git-push push: $(PGIT) push git-push-all: $(PGIT) push --all git-diff: $(PGIT) diff git-short-diff: $(PGIT) diff --shortstat git-pull: $(PGIT) pull git-pull-all: $(PGIT) pull --all git-clone: $(PGIT) clone touch clone.done git-clone-%: PGIT_CLONE_FROM_USER=$* $(PGIT) clone pull-%: PGIT_CLONE_FROM_USER=$* $(PGIT) clone git-commit: $(PGIT) commit git-conv-%: [ -e $*/.git ] || { \ mv $* old/ ;\ if PROJECTS="$*" make clone; then \ sed -i "/^D\/$*\// d" CVS/Entries ;\ else \ mv old/$* . ;\ fi \ } check-conv: for p in `ssh $(JANWARE_USER)@git.jannet.de /opt/ytools/bin/git-srv-admin.sh -u jan -j list-personal-projects`; do \ make git-conv-$$p ;\ done projects.txt: echo $(PROJECTS) | sed 's/ /\n/g; s%/%%g' > $@ done.clean: rm -f *.done config.done: cvs-update.done make -C ytools config touch $@ links.done: if [ -d btools ]; then ln -sf btools dspider-btools; fi if [ -d dspc/src/shared ]; then ln -sf dspc/src/shared dspider-shared; fi touch $@ cvsdir.done: if [ ! -d CVS ]; then \ echo -e '$(subst $(newline),\n,${CVSDIR_MIME})' | base64 -d | tar -xjf - ;\ fi if grep -q "^:ext:jan@cvs.jannet.de:" CVS/Root; then \ echo $(CVSROOT) > CVS/Root ;\ fi touch $@ re-encode: tar -cjf - CVS | base64 | \ sed '/^define CVSDIR_MIME =/,/^endef/ {//!d}; /^define CVSDIR_MIME =/r/dev/stdin' \ $(THIS_MAKEFILE) > $(THIS_MAKEFILE).tmp mv $(THIS_MAKEFILE).tmp $(THIS_MAKEFILE) cvs-update.done: cvsdir.done cvs update -dP $(CVS_PROJECTS) touch $@ update.done: purge pull.done: cvs-update.done config.done clone.done links.done touch $@ clone.done: $(PGIT) clone touch $@