File: Makefile.am

package info (click to toggle)
libnbd 1.24.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 10,956 kB
  • sloc: ansic: 55,063; ml: 12,326; sh: 8,817; python: 4,757; makefile: 3,036; perl: 165; cpp: 24
file content (123 lines) | stat: -rw-r--r-- 3,418 bytes parent folder | download | duplicates (2)
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
# nbd client library in userspace
# Copyright Red Hat
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

include $(top_srcdir)/subdir-rules.mk

CLEANFILES += *.annot *.cmi *.cmo *.cmx *.o *.a *.so *.bc *.opt

ML_TESTS = \
	test_010_import.ml \
	test_100_handle.ml \
	test_105_with_handle.ml \
	test_110_defaults.ml \
	test_120_set_non_defaults.ml \
	test_130_private_data.ml \
	test_140_explicit_close.ml \
	test_200_connect_command.ml \
	test_210_opt_abort.ml \
	test_220_opt_list.ml \
	test_230_opt_info.ml \
	test_240_opt_list_meta.ml \
	test_245_opt_list_meta_queries.ml \
	test_250_opt_set_meta.ml \
	test_255_opt_set_meta_queries.ml \
	test_300_get_size.ml \
	test_400_pread.ml \
	test_405_pread_structured.ml \
	test_410_pwrite.ml \
	test_460_block_status.ml \
	test_465_block_status_64.ml \
	test_500_aio_pread.ml \
	test_500_aio_pread_buffer_lifetime.ml \
	test_500_aio_pread_old_buffer.ml \
	test_505_aio_pread_structured_callback.ml \
	test_505_aio_pread_structured_callback_old_buffer.ml \
	test_510_aio_pwrite.ml \
	test_510_aio_pwrite_old_buffer.ml \
	test_580_aio_connect.ml \
	test_580_aio_is_zero.ml \
	test_590_aio_copy.ml \
	test_600_debug_callback.ml \
	test_610_exception.ml \
	test_620_stats.ml \
	$(NULL)

EXTRA_DIST = \
	$(ML_TESTS) \
	ocaml_test_config.mli \
	$(NULL)

if HAVE_OCAML
if HAVE_NBDKIT

tests_bc = $(ML_TESTS:.ml=.bc)
tests_opt = $(ML_TESTS:.ml=.opt)

OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
OCAMLPACKAGES = \
	-package $(OCAMLFIND_PACKAGES) \
	-I $(srcdir)/.. -I $(builddir)/.. -I $(srcdir) -I $(builddir)

check_SCRIPTS = $(tests_bc)
if HAVE_OCAMLOPT
check_SCRIPTS += $(tests_opt)
endif

%.bc: %.cmo ../mlnbd.cma ocaml_test_config.cmo
	LD_LIBRARY_PATH=../../lib/.libs \
	$(OCAMLFIND) ocamlc \
	  $(OCAMLFLAGS) $(OCAMLPACKAGES) -linkpkg \
	  mlnbd.cma ocaml_test_config.cmo $< -o $@

ocaml_test_config.cmo: ocaml_test_config.ml
	$(OCAMLFIND) ocamlc $(OCAMLFLAGS) -c $< -o $@

if HAVE_OCAMLOPT
%.opt: %.cmx ../mlnbd.cmxa ocaml_test_config.cmx
	LD_LIBRARY_PATH=../../lib/.libs \
	$(OCAMLFIND) ocamlopt \
	  $(OCAMLFLAGS) $(OCAMLPACKAGES) \
	  -cclib -L$(top_builddir)/lib/.libs -linkpkg \
	  mlnbd.cmxa ocaml_test_config.cmx $< -o $@

ocaml_test_config.cmx: ocaml_test_config.ml
	$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) -c $< -o $@
endif

TESTS_ENVIRONMENT = \
	LIBNBD_DEBUG=1 \
	$(MALLOC_CHECKS) \
	OCAMLRUNPARAM=b \
	$(NULL)
LOG_COMPILER = $(top_builddir)/run
TESTS = $(tests_bc)
if HAVE_OCAMLOPT
TESTS += $(tests_opt)
endif

endif HAVE_NBDKIT

check-valgrind:
	LIBNBD_VALGRIND=1 $(MAKE) check TESTS="$(tests_opt)"

# Dependencies.
#.depend: $(srcdir)/*.mli $(srcdir)/*.ml
.depend: $(srcdir)/*.ml
	$(OCAMLFIND) ocamldep -I .. $(srcdir)/*.ml > $@
-include .depend

endif HAVE_OCAML