mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
188 lines
4 KiB
Makefile
188 lines
4 KiB
Makefile
# ------------ 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
|
|
|
|
ifneq ($(EXCLUDE_FROM_BUILD),)
|
|
BUILD_PY_EXTRA_ARGS += --exclude "$(EXCLUDE_FROM_BUILD)"
|
|
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
|
|
|
|
# ------------ 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 $(PROJECTS_PY_EXTRA_ARGS) 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 \
|
|
mkdir CVS && \
|
|
echo :ext:$(JANWARE_USER)@cvs.jannet.de:/home/jannet/arc/cvs > CVS/Root && \
|
|
echo proj > CVS/Repository && \
|
|
echo "/Makefile/$Revision$ ///" | sed 's/ *evision: *\([0-9.]*\) */\1/; s/ *$$ *//' > CVS/Entries ;\
|
|
fi
|
|
touch $@
|
|
|
|
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 $@
|
|
|