jw-pkg/make/projects-dir.mk

54 lines
1.3 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 ?= $(dir $(wildcard */CVS */.git))
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))
all:
for p in $(PROJECTS); do make -C $$p || break; done
clean:
for p in $(PROJECTS); do make -C $$p clean || break; done
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
update pull:
cvs update -dP $(CVS_PROJECTS)
$(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-%:
mv $* old/
sed -i "/$*/ d" CVS/Entries