-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
137 lines (116 loc) · 3.95 KB
/
Makefile
File metadata and controls
137 lines (116 loc) · 3.95 KB
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
PSTORE=srv/BOSS/processes
TSTORE=srv/BOSS/templates
KSSTORE=srv/BOSS/kickstarts
BINDIR=usr/bin
BSDIR=usr/share/boss-skynet
PCONFDIR=etc/skynet
SCONFDIR=etc/skynet/conf.d
SVDIR=etc/supervisor/conf.d
COVERAGE := $(shell which python-coverage)
INSTALLEXEC=install -D -m 755
INSTALLCONF=install -D -m 644
INSTALLDIR=install -d -m 755
POBJECTS := $(wildcard participants/*.py)
LOBJECTS := $(wildcard launchers/*.py)
PCOBJECTS := $(wildcard conf/*.conf)
SCOBJECTS := $(wildcard conf/skynet/*.conf)
SVOBJECTS := $(wildcard conf/supervisor/*.conf)
MOBJECTS := $(shell find modules/* -maxdepth 0 -type d -exec basename \{\} \;)
TEMPLATEOBJECTS := $(wildcard templates/*)
PROCESSOBJECTS := $(wildcard processes/*.conf processes/*.pdef)
PYSETUPOPT := --install-layout=deb
docs: faketest test_results.txt code_coverage.txt
cd docs; make coverage
touch docs/metrics.rst
cd docs; make html
install: dirs participants launchers conf sv modules utils processes templates kickstarts
dirs:
$(INSTALLDIR) $(DESTDIR)/$(PCONFDIR)
$(INSTALLDIR) $(DESTDIR)/$(SCONFDIR)
$(INSTALLDIR) $(DESTDIR)/$(BINDIR)
$(INSTALLDIR) $(DESTDIR)/$(BSDIR)/
$(INSTALLDIR) $(DESTDIR)/var/lib/obsticket
$(INSTALLDIR) $(DESTDIR)/$(PSTORE)/StandardWorkflow/
$(INSTALLDIR) $(DESTDIR)/$(TSTORE)/
$(INSTALLDIR) $(DESTDIR)/$(KSSTORE)/
$(INSTALLDIR) $(DESTDIR)/$(SVDIR)/
conf:
@for C in $(PCOBJECTS); do \
echo $(INSTALLCONF) $$C $(DESTDIR)/$(PCONFDIR)/ ; \
$(INSTALLCONF) $$C $(DESTDIR)/$(PCONFDIR)/ ; \
done
@for C in $(SCOBJECTS); do \
echo $(INSTALLCONF) $$C $(DESTDIR)/$(SCONFDIR)/ ; \
$(INSTALLCONF) $$C $(DESTDIR)/$(SCONFDIR)/ ; \
done
sv:
@for SV in $(SVOBJECTS); do \
echo $(INSTALLCONF) $$SV $(DESTDIR)/$(SVDIR)/ ; \
$(INSTALLCONF) $$SV $(DESTDIR)/$(SVDIR)/ ; \
done
modules:
cd modules ; \
python setup.py -q install --no-compile --root=$(DESTDIR) $(PYSETUPOPT)
launchers:
@for L in $(LOBJECTS); do \
echo $(INSTALLEXEC) $$L $(DESTDIR)/$(BSDIR)/ ; \
$(INSTALLEXEC) $$L $(DESTDIR)/$(BSDIR)/ ; \
done
participants:
@for P in $(POBJECTS); do \
echo $(INSTALLEXEC) $$P $(DESTDIR)/$(BSDIR)/ ; \
$(INSTALLEXEC) $$P $(DESTDIR)/$(BSDIR)/ ; \
done
utils:
cd utils ; \
$(INSTALLEXEC) boss_swf_enable $(DESTDIR)/$(BINDIR)/ ; \
$(INSTALLEXEC) platform_setup $(DESTDIR)/$(BINDIR)/ ; \
$(INSTALLEXEC) launcher.py $(DESTDIR)/$(BINDIR)/ ; \
$(INSTALLEXEC) repodiff.py $(DESTDIR)/$(BINDIR)/
processes:
@for P in $(PROCESSOBJECTS); do \
echo $(INSTALLCONF) $$P $(DESTDIR)/$(PSTORE)/StandardWorkflow/ ; \
$(INSTALLCONF) $$P $(DESTDIR)/$(PSTORE)/StandardWorkflow/ ; \
done
templates:
@for T in $(TEMPLATEOBJECTS); do \
echo $(INSTALLCONF) $$T $(DESTDIR)/$(TSTORE)/ ; \
$(INSTALLCONF) $$T $(DESTDIR)/$(TSTORE)/ ; \
done
kickstarts:
cd kickstarts ; \
$(INSTALLEXEC) meego-core-ia32-minimal.ks $(DESTDIR)/$(KSSTORE)/
test_results.txt:
PYTHONPATH=participants:launchers:modules:$$PYTHONPATH \
nosetests -v --with-coverage --cover-package none \
--cover-inclusive 2> test_results.txt \
&& cat test_results.txt \
|| (cat test_results.txt; exit 1)
code_coverage.txt: test_results.txt
ifdef COVERAGE
$(COVERAGE) -rm participants/*.py\
launchers/*.py\
modules/ots/*.py\
modules/boss/*.py 2>&1 | tee code_coverage.txt
else
@echo "Coverage not available" > code_coverage.txt
endif
.test_stamp: test_results.txt
touch .test_stamp
faketest:
@echo "Tests not run" > test_results.txt
@echo "Coverage not available" > code_coverage.txt
touch .test_stamp
test: .test_stamp
retest:
@rm -f test_results.txt code_coverage.txt .coverage
$(MAKE) code_coverage.txt
clean:
@rm -rf docs/_build
@find -name "*.pyc" -delete
@rm -f .coverage code_coverage.txt test_results.txt \
.test_stamp docs/c.txt docs/python.txt docs/undoc.pickle \
.noseids
@cd modules; python setup.py -q clean --all >/dev/null 2>/dev/null
.PHONY: dirs docs install clean test faketest participants launchers conf modules utils processes templates kickstarts retest sv
all: docs