mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 20:13:32 +01:00
177 lines
4 KiB
Makefile
177 lines
4 KiB
Makefile
define CVSDIR_MIME =
|
|
QlpoOTFBWSZTWSqR0W8AALh/ks+QASBAAf/yb9JbRH9/32AMACAICEhAAjxQBTCUkmTEZGh6
|
|
gAAAAA0AGgHMAmAmRgBGJiYTCYIaYmmBzAJgJkYARiYmEwmCGmJpgFURNE2k1NGlPT1NJmoH
|
|
qDRtBPSY0I9TR6n6p8j3nf86/pWteXvN7hPE0JUJ5YTMwTtERHTg8nDZ0+T+jE0KkjIqYGLY
|
|
j68pmazwxI0CJEWvZzd3Xhgtn9ms8+kQrl216NSKHhymW4MJOHhtxqk83C6M+7jCRlKVA7Df
|
|
cvI+EtcgH0UyCAsieckg3yQUPRw8/p9vb2/xsP1JIXJN0ih1fV6N8RKTFNHLz5E+WlejKqqY
|
|
uMqecnZPYRJtmvih5oUUMDStS9ojVghha1bbdCfGv+Q/43GyGhbYV1msRrKmYwK81tDV1MsY
|
|
vfKFMq3Iuknk3aVdmV4mtG3PsX2ozRgRqMyMqYItEYzFCJU1vuLIrEUiio5Ga2JgzuWL4riY
|
|
Mr1WyjFSxU2M7kXLmO3DGq1LZ3VK9V8/v+7Ajs3ePwceOyrpxxcKeomsJk7hNPaJQ2nw9MQ3
|
|
DH9rncZeypb3eb5H0/zuoE7B2i0DQRFcTJBKgPSwTie7gOeQW6t9tQJQKw5ESj6OT/d7c8F2
|
|
915wWWwLJccyauIwKMqOvoHe8qZtFKU3uZxFnOWM9XWDYXckU4UJAqkdFvA==
|
|
endef
|
|
|
|
define newline
|
|
|
|
|
|
endef
|
|
|
|
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
|
|
|
|
ifeq ($(JANWARE_USER),)
|
|
WHOAMI = $(shell id -un)
|
|
else
|
|
WHOAMI = $(JANWARE_USER)
|
|
endif
|
|
|
|
ifeq ($(CVSROOT),)
|
|
CVSROOT = :ext:$(WHOAMI)@cvs.jannet.de:/home/jannet/arc/cvs
|
|
export CVSROOT
|
|
endif
|
|
|
|
ifeq ($(CVS_RSH),)
|
|
CVS_RSH = ssh
|
|
export CVS_RSH
|
|
endif
|
|
|
|
PGIT = CLONE_PROJECTS="$(PROJECTS)" PGIT_CLONE_FROM_USER="$(JANWARE_USER)" /bin/bash $(firstword $(wildcard ./ytools/devutil/scripts/pgit.sh /opt/ytools/bin/pgit.sh) pgit.sh-not-found)
|
|
BUILD_PY = python ./ytools/devutil/scripts/build.py -b $(shell pwd) $(BUILD_PY_EXTRA_ARGS)
|
|
PURGE_SH = /bin/bash $(firstword $(wildcard ./ytools/devutil/scripts/purge-stale-projects.sh /opt/ytools/bin/purge-stale-projects.sh) purge-not-found)
|
|
|
|
EXCLUDE_FROM_BUILD = \
|
|
dspider-btools \
|
|
dspider-shared \
|
|
feedfs-dspcd \
|
|
casview \
|
|
dspfs \
|
|
feedfs-qt \
|
|
jux3
|
|
|
|
all: pull.done
|
|
|
|
all clean: pull.done
|
|
$(BUILD_PY) $@ $(filter-out $(EXCLUDE_FROM_BUILD),$(PROJECTS))
|
|
|
|
pkg-%: pull.done
|
|
$(BUILD_PY) $@ $(filter-out $(EXCLUDE_FROM_BUILD),$(PROJECTS))
|
|
|
|
clean: done.clean
|
|
|
|
clean-dirs:
|
|
ls */dirs-all.done 2>/dev/null | sed 's%/.*%%' | xargs -r $(BUILD_PY) clean
|
|
|
|
cpp:
|
|
@find $(PROJECTS) -name '*.cpp' | grep /worker/ | grep -ve "old\|tmp\|nomake\|new" | \
|
|
while read f; do d=`dirname $$f`; if [ $$d/generate_code.sh ]; then echo $$f; fi ;\
|
|
done
|
|
|
|
status:
|
|
for p in $(CVS_PROJECTS); do test -f $$d/CVS || echo $$p; done
|
|
cvs status $(addsuffix VERSION,$(CVS_PROJECTS))
|
|
$(PGIT) status
|
|
|
|
purge:
|
|
$(PURGE_SH)
|
|
|
|
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
|
|
|
|
subdirs-%:
|
|
FORCE_REBUILD_SUBDIRS=true make $*
|
|
|
|
cvs-update:
|
|
rm -f $@.done
|
|
make $@.done
|
|
|
|
git-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
|
|
|
|
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 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:
|
|
ln -sf btools dspider-btools
|
|
ln -sf dspc/src/shared dspider-shared
|
|
touch $@
|
|
|
|
cvsdir.done:
|
|
if [ ! -d CVS ]; then \
|
|
echo -e '$(subst $(newline),\n,${CVSDIR_MIME})' | tee /tmp/test.mime | mimencode -u | tar -xjf - ;\
|
|
fi
|
|
if grep -q "^jan@cvs.jannet.de/" CVS/Root; then \
|
|
echo $(CVSROOT) > CVS/Root ;\
|
|
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 $@
|
|
|