forked from os-autoinst/os-autoinst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
251 lines (207 loc) · 6.69 KB
/
Makefile.am
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = t debugviewer snd2png
COVERAGE_THRESHOLD = 30.1
doc_DATA = \
README.asciidoc \
INSTALL.asciidoc \
COPYING \
doc/basetest.html \
doc/testapi.html
backendexecdir = $(pkglibexecdir)/backend
backendexec_DATA = \
backend/baseclass.pm \
backend/console_proxy.pm \
backend/driver.pm \
backend/generalhw.pm \
backend/ikvm.pm \
backend/ipmi.pm \
backend/qemu.pm \
backend/s390x.pm \
backend/svirt.pm \
backend/pvm.pm \
backend/spvm.pm \
backend/virt.pm
consolesexecdir = $(pkglibexecdir)/consoles
consolesexec_DATA = \
consoles/console.pm \
consoles/icewm.cfg \
consoles/ipmiSol.pm \
consoles/localXvnc.pm \
consoles/remoteVnc.pm \
consoles/s3270.pm \
consoles/sshX3270.pm \
consoles/sshVirtsh.pm \
consoles/sshVirtshSUT.pm \
consoles/sshIucvconn.pm \
consoles/sshXtermIPMI.pm \
consoles/sshXtermVt.pm \
consoles/ttyConsole.pm \
consoles/virtio_screen.pm \
consoles/virtio_terminal.pm \
consoles/vnc_base.pm \
consoles/network_console.pm \
consoles/VNC.pm
openqaexecdir = $(pkglibexecdir)/OpenQA
openqaexec_DATA = \
OpenQA/Commands.pm \
OpenQA/Exceptions.pm
openqaexecbenchdir = $(pkglibexecdir)/OpenQA/Benchmark
openqaexecbench_DATA = \
OpenQA/Benchmark/Stopwatch.pm
openqaexecrunargsdir = $(pkglibexecdir)/OpenQA/Test
openqaexecrunargs_DATA = \
OpenQA/Test/RunArgs.pm
openqaexecqemudir = $(pkglibexecdir)/OpenQA/Qemu
openqaexecqemu_DATA = \
OpenQA/Qemu/BlockDevConf.pm \
OpenQA/Qemu/BlockDev.pm \
OpenQA/Qemu/ControllerConf.pm \
OpenQA/Qemu/DriveController.pm \
OpenQA/Qemu/DriveDevice.pm \
OpenQA/Qemu/DrivePath.pm \
OpenQA/Qemu/MutParams.pm \
OpenQA/Qemu/PFlashDevice.pm \
OpenQA/Qemu/Proc.pm \
OpenQA/Qemu/SnapshotConf.pm \
OpenQA/Qemu/Snapshot.pm
openqaisotovideodir = $(pkglibexecdir)/OpenQA/Isotovideo
openqaisotovideo_DATA = \
OpenQA/Isotovideo/CommandHandler.pm \
OpenQA/Isotovideo/NeedleDownloader.pm \
OpenQA/Isotovideo/Interface.pm \
OpenQA/Isotovideo/Utils.pm
# circumvent automake's test - possibly we really shouldn't install in /usr/lib though
perlexecdir = $(pkglibexecdir)
perlexec_DATA = \
autotest.pm \
basetest.pm \
bmwqemu.pm \
testapi.pm \
myjsonrpc.pm \
mmapi.pm \
lockapi.pm \
commands.pm \
distribution.pm \
ocr.pm \
cv.pm \
needle.pm \
osutils.pm
pkglibexec_SCRIPTS = \
crop.py \
os-autoinst-openvswitch
bin_SCRIPTS = isotovideo
install-exec-hook:
sed -i -e "s,\$$installprefix = undef;,\$$installprefix = '$(pkglibexecdir)';," $(DESTDIR)$(bindir)/isotovideo && \
sed -i -e "s,\$$sysdir = undef;,\$$sysdir = '$(pkglibexecdir)';," $(DESTDIR)$(pkglibexecdir)/cv.pm
pkglibexec_FOLDERS = \
tools \
inst \
inst.d \
dmidata
# sort the above out so it is not done directory wise
pkglibexec_PROGRAMS = videoencoder
videoencoder_SOURCES = videoencoder.cpp
videoencoder_CFLAGS = -O2 -Wall -W $(OPENCV_CFLAGS)
videoencoder_LDADD = $(OPENCV_LIBS) $(THEORAENC_LIBS) -lm
EXTRA_DIST = \
autogen.sh \
ppmclibs/tinycv.i \
$(backendhelpexec_SCRIPTS) $(backendexec_SCRIPTS) \
$(doc_DATA) $(pkglibexec_DATA) $(pkglibexec_SCRIPTS) $(packagestate_DATA_FOLDERS) $(pkglibexec_FOLDERS) \
etc/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf \
systemd/os-autoinst-openvswitch.service
CLEANFILES = \
$(ppmcexec_SCRIPTS) \
ppmclibs/tinycv_wrap.cxx \
doc/basetest.html \
doc/testapi.html
PERL_MODULE = ppmclibs/blib/arch/auto/tinycv/tinycv.so
OPENVSWITCH_SERVICE = systemd/os-autoinst-openvswitch.service
ppmclibs/Makefile: ppmclibs/Makefile.PL
cd ppmclibs && \
perl Makefile.PL OPTIMIZE="$(CXXFLAGS)" CC="$(CXX)"
$(PERL_MODULE): ppmclibs/Makefile
$(MAKE) -C ppmclibs
$(OPENVSWITCH_SERVICE):
rm -f $@ $@.tmp
sed -e 's,@pkglibexecdir[@],$(pkglibexecdir),g' '$(top_srcdir)/$@.in' > '$(top_srcdir)/$@.tmp'
mv '$(top_srcdir)/$@.tmp' '$(top_srcdir)/$@'
install-exec-local: $(PERL_MODULE)
$(MAKE) -C ppmclibs pure_install DESTDIR="$(DESTDIR)" INSTALLDIRS="$(INSTALLDIRS)"
all-local: $(PERL_MODULE)
doc/%.html: %.pm
pod2html $< > $@
install-data-local: $(OPENVSWITCH_SERVICE)
$(MKDIR_P) $(DESTDIR)/$(packagestatedir) ; \
for i in $(packagestate_DATA_FOLDERS) ; do \
cp -r $(top_srcdir)/$$i "$(DESTDIR)/$(packagestatedir)" ; \
done
$(MKDIR_P) "$(DESTDIR)/$(pkgdatadir)" ; \
for i in $(pkglibexec_FOLDERS) ; do \
cp -r $(top_srcdir)/$$i "$(DESTDIR)/$(pkglibexecdir)" ; \
done
install -D -m 644 $(top_srcdir)/etc/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf "$(DESTDIR)/etc/dbus-1/system.d/org.opensuse.os_autoinst.switch.conf"
install -D -m 644 "$(top_srcdir)/$(OPENVSWITCH_SERVICE)" "$(DESTDIR)/usr/lib/systemd/system/os-autoinst-openvswitch.service"
uninstall-local:
for i in $(packagestate_DATA_FOLDERS) ; do \
rm -rf "$(DESTDIR)/$(packagestatedir)/$$i" ; \
done
for i in $(pkglibexec_FOLDERS) ; do \
rm -rf "$(DESTDIR)/$(pkglibexecdir)/$$i" ; \
done
dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
echo Creating ChangeLog && \
( cd "$(top_srcdir)" && \
echo '# Generated by Makefile. Do not edit.'; echo; \
$(top_srcdir)/missing --run git log ) > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git clone is required to generate a ChangeLog >&2; \
fi
rm -rf `find $(distdir) -name .gitignore`
distclean-local: clean-local
check-local:
$(srcdir)/tools/tidy --check
PERL5LIB=tools/lib/perlcritic:$$PERL5LIB perlcritic --gentle --include Perl::Critic::Policy::HashKeyQuote --include Perl::Critic::Policy::ConsistentQuoteLikeWords $(srcdir)
$(MAKE) check-doc
.PHONY: check-doc
check-doc: check-doc-testapi
.PHONY: check-doc-testapi
check-doc-testapi:
[ -z "$$(podspell testapi.pm | spell)" ]
clean-local:
@if test -e ppmclibs/Makefile; then $(MAKE) -C ppmclibs distclean; fi
-rm -rf *.tar.*
-rm -rf t/cover_db/
t/cover_db/: check
.PHONY: coverage-test
coverage-test: t/cover_db/
.PHONY: coverage
coverage: coverage-html
.PHONY: coverage-codecov
coverage-codecov: t/cover_db/
(cd t && cover -report codecov)
t/cover_db/coverage.html: t/cover_db/
(cd t && cover -report html_basic)
.PHONY: coverage-html
coverage-html: t/cover_db/coverage.html
.PHONY: coverage-check
coverage-check: t/cover_db/coverage.html
(cd t && ../tools/check_coverage ${COVERAGE_THRESHOLD})
.PHONY: tidy-cpp
tidy-cpp:
clang-format --style=WebKit -i $$(find . -name \*.cc -o -name \*.cpp)
.PHONY: docker-test-build
docker-test-build:
docker build --no-cache $(top_srcdir)/docker/travis_test -t os-autoinst/travis_test:latest
.PHONY: docker-test-run
docker-test-run:
docker run --rm -v $(abs_top_srcdir):/opt/repo os-autoinst/travis_test:latest 'make && make check VERBOSE=1'
.PHONY: docker-test
.NOTPARALLEL: docker-test
docker-test: docker-test-build docker-test-run
echo "Use docker-rm and docker-rmi to remove the container and image if necessary"