jw-pkg/make/projects-dir.mk

101 lines
2.1 KiB
Makefile
Raw Normal View History

ifneq ($(PROJECTS),)
export PGIT_CLONE_PROJECTS = $(PROJECTS)
endif
ifneq ($(CLONE_FROM_USER),)
export PGIT_CLONE_FROM_USER = $(CLONE_FROM_USER)
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
WHOAMI = $(shell id -un)
PGIT = CLONE_PROJECTS="$(PROJECTS)" CLONE_FROM_USER="$(shell whoami)" /bin/bash $(firstword $(wildcard ./ytools/devutil/scripts/pgit.sh /opt/ytools/bin/pgit.sh))
EXCLUDE_FROM_BUILD = \
dspider-btools \
dspider-shared \
feedfs-dspcd \
casview \
dspfs \
feedfs-qt \
jux3
all: links.done clone.done cvs-update.done
all clean: config.done
python ./ytools/devutil/scripts/build.py -b $(shell pwd) $@ $(filter-out $(EXCLUDE_FROM_BUILD),$(PROJECTS))
clean: done.clean
clean-dirs:
ls */dirs-all.done 2>/dev/null | sed 's%/.*%%' | xargs -r build.py -b $(shell pwd) 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
clone diff commit push:
$(PGIT) $@
git-push:
$(PGIT) push
git-diff:
$(PGIT) diff
cvs-update:
cvs update -dP $(CVS_PROJECTS)
update pull: cvs-update
$(PGIT) pull
git-pull:
$(PGIT) pull
status:
for p in $(CVS_PROJECTS); do test -f $$d/CVS || echo $$p; done
cvs status $(addsuffix VERSION,$(CVS_PROJECTS))
$(PGIT) status
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' > $@
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 $@
%.done: %
touch $@
done.clean:
rm -f *.done