forked from Flumotion/flumotion-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.mk
94 lines (76 loc) · 3.34 KB
/
common.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# these are toplevel targets
test:
@make check -C flumotion/test
quicktest:
@make check -C flumotion/test \
TRIAL_FLAGS="--reporter=verbose --skip-slow"
check-docs:
@make check -C doc/reference
check-local-registry:
$(top_builddir)/env bash -c 'export PYTHONPATH=$(FLUMOTION_DIR):$(top_srcdir)$${PYTHONPATH:+:$$PYTHONPATH} && export FLU_PROJECT_PATH=$(top_srcdir)$${FLU_PROJECT_PATH:+:$$FLU_PROJECT_PATH} && $(PYTHON) $(top_srcdir)/common/validate-registry.py'
# this is a target for any directory containing CONFIG in its Makefile.am
check-local-config:
ret=0; for f in $(CONFIG); do echo "Validating $$f"; $(top_builddir)/env bash -c "export PYTHONPATH=$(FLUMOTION_DIR):$(top_srcdir)${PYTHONPATH:+:$PYTHONPATH} && $(PYTHON) $(top_srcdir)/common/validate-config.py $(srcdir)/$$f" || ret=1; done && exit $$ret
check-local-pep8:
find $(top_srcdir)/flumotion ! -regex $(top_srcdir)/flumotion/extern/.\* -name \*.py | sort -u | xargs $(PYTHON) $(top_srcdir)/common/pep8.py --repeat
find $(top_srcdir)/flumotion ! -regex $(top_srcdir)/flumotion/extern/.\* -name \*.py.in | sort -u | xargs $(PYTHON) $(top_srcdir)/common/pep8.py --repeat
# run our hacked-up version of trial with all the reactors that we actually use and build up the final result
coverage:
@test ! -z "$(COVERAGE_MODULES)" || \
(echo Define COVERAGE_MODULES in your Makefile.am; exit 1)
rm -f flu-saved-coverage.pickle
@$(top_builddir)/env bash -c "common/flumotion-trial --reactor default --temp-directory=_trial_coverage --coverage --saved-coverage=flu-saved-coverage.pickle $(COVERAGE_MODULES)"
@$(top_builddir)/env bash -c "common/flumotion-trial --reactor gtk2 --temp-directory=_trial_coverage --coverage --saved-coverage=flu-saved-coverage.pickle $(COVERAGE_MODULES)"
make show-coverage
show-coverage:
@test ! -z "$(COVERAGE_MODULES)" || \
(echo Define COVERAGE_MODULES in your Makefile.am; exit 1)
@keep=""; \
for m in $(COVERAGE_MODULES); do \
echo adding $$m; \
keep="$$keep `ls _trial_coverage/coverage/$$m*`"; \
done; \
$(PYTHON) common/show-coverage.py $$keep
fixme:
tools/fixme | less -R
# remove any cache written in distcheck
dist-hook::
rm -rf cache
release: dist
make $(PACKAGE)-$(VERSION).tar.bz2.md5
if test -r $(PACKAGE)-$(VERSION).tar.gz; then \
make $(PACKAGE)-$(VERSION).tar.gz.md5; \
fi
# generate md5 sum files
%.md5: %
md5sum $< > $@
# generate a sloc count
sloc:
sloccount flumotion | grep "(SLOC)" | cut -d = -f 2
.PHONY: test quicktest
locale-uninstalled-1:
if test -d po; then \
cd po; \
make datadir=../$(top_builddir) itlocaledir=../$(top_builddir)/locale install; \
fi
# the locale-uninstalled rule can be replaced with the following lines,
# once we can depend on a newer intltool than 0.34.2
# if test -d po; then \
# cd po; \
# make datadir=../$(top_builddir) itlocaledir=../$(top_builddir)/locale install; \
# fi
locale-uninstalled:
podir=$(top_builddir)/po; \
localedir=$(top_builddir)/locale; \
make -C $$podir; \
for file in $$(ls $$podir/*.gmo); do \
lang=`basename $$file .gmo`; \
dir=$$localedir/$$lang/LC_MESSAGES; \
mkdir -p $$dir; \
echo "installing $$podir/$$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
install $$podir/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
done;
locale-uninstalled-clean:
@-rm -rf _trial_temp
@-rm -f flu-saved-coverage.pickle
@-rm -rf $(top_builddir)/locale