-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile.am
61 lines (49 loc) · 1.67 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
# SPDX-License-Identifier: CC0-1.0
#
# Copyright (C) 2021 Western Digital Corporation or its affiliates.
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src man
EXTRA_DIST = autogen.sh README.md COPYING.GPL CONTRIBUTING
TESTSDIR = $(DESTDIR)$(prefix)/local/cdl-tests
TESTGROUPS=`cd ${top_srcdir}/tests/scripts/; ls -d 0?_*`
install-tests:
@echo "Installing test suite in ${TESTSDIR}..."
@rm -rf ${TESTSDIR}
@install -m 755 -d ${TESTSDIR}
@install -m 755 -d ${TESTSDIR}/scripts
@for g in $(TESTGROUPS) ; do \
install -m 755 -d ${TESTSDIR}/scripts/$${g}; \
install -m 755 $(top_srcdir)/tests/scripts/$${g}/*.sh \
${TESTSDIR}/scripts/$${g}; \
done
@install -m 644 $(top_srcdir)/tests/scripts/test_lib ${TESTSDIR}/scripts
@install -m 755 -d ${TESTSDIR}/scripts/cdl
@install -m 644 $(top_srcdir)/tests//scripts/cdl/* ${TESTSDIR}/scripts/cdl
@install -m 755 $(top_srcdir)/tests/cdl-tests.sh ${TESTSDIR}
uninstall-tests:
@echo "Uninstalling test suite in ${TESTSDIR}..."
@rm -rf ${TESTSDIR}
uninstall-hook:
@rm -rf ${TESTSDIR}
if BUILD_RPM
rpmdir = $(abs_top_builddir)/rpmbuild
EXTRA_DIST += cdl-tools.spec tests
RPMARCH=`$(RPM) --eval %_target_cpu`
rpm: dist
@echo "Building RPM package..."
@mkdir -p $(rpmdir)
$(RPMBUILD) -ta --clean \
-D "_topdir $(rpmdir)" \
-D "pkg_name cdl-tools" \
-D "pkg_version $(PACKAGE_VERSION)" \
cdl-tools-$(PACKAGE_VERSION).tar.gz
@mv -f $(rpmdir)/RPMS/$(RPMARCH)/*.rpm $(abs_top_builddir)
@mv -f $(rpmdir)/RPMS/noarch/*.rpm $(abs_top_builddir)
@mv -f $(rpmdir)/SRPMS/*.rpm $(abs_top_builddir)
@rm -rf $(rpmdir)
@rm -f cdl-tools-$(PACKAGE_VERSION).tar.gz
else
rpm:
@echo "Building RPM packages requires rpmbuild and rpm utilities"
exit 1
endif