File: Makefile.am

package info (click to toggle)
libnbd 1.24.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,956 kB
  • sloc: ansic: 55,158; ml: 12,325; sh: 8,811; python: 4,757; makefile: 3,038; perl: 165; cpp: 24
file content (123 lines) | stat: -rw-r--r-- 3,719 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 generator

DISTCLEANFILES = stamp-generator

# Note: These are not source files.  They are parsed by the generator
# and output to lib/states.c.
states_code = \
	states.c \
	states-connect.c \
	states-connect-socket-activation.c \
	states-issue-command.c \
	states-magic.c \
	states-newstyle-opt-export-name.c \
	states-newstyle-opt-extended-headers.c \
	states-newstyle-opt-list.c \
	states-newstyle-opt-go.c \
	states-newstyle-opt-meta-context.c \
	states-newstyle-opt-starttls.c \
	states-newstyle-opt-structured-reply.c \
	states-newstyle.c \
	states-oldstyle.c \
	states-reply-chunk.c \
	states-reply-simple.c \
	states-reply.c \
	$(NULL)

# Some man pages contain example code and so must be rebuilt
# if that changes.
examples_code = $(wildcard $(top_srcdir)/examples/*.c)

# Source code for the generator.
sources = \
	config.mli \
	config.ml \
	utils.mli \
	utils.ml \
	state_machine.mli \
	state_machine.ml \
	API.mli \
	API.ml \
	state_machine_generator.mli \
	state_machine_generator.ml \
	C.mli \
	C.ml \
	docs.mli \
	docs.ml \
	Python.mli \
	Python.ml \
	OCaml.mli \
	OCaml.ml \
	GoLang.mli \
	GoLang.ml \
	RustSys.mli \
	RustSys.ml \
	Rust.mli \
	Rust.ml \
	generator.ml \
	$(NULL)

EXTRA_DIST = \
	README.state-machine.md \
	$(states_code) \
	$(sources) \
	$(NULL)

if HAVE_OCAMLC

stamp-generator: generator $(states_code) $(examples_code)
	rm -f $@
#	We must run this from the source directory since these
#	files are distributed in the tarball.
	cd $(top_srcdir) && \
	    OCAMLRUNPARAM=b $(abs_top_builddir)/generator/generator
	touch $@

generator: $(sources)
	$(OCAMLC) $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -I $(srcdir) -I . \
	  -I +str str.cma -I +unix unix.cma $(sources) -o $@

else

stamp-generator:
	@rm -f $@
	@if [ -f $(top_srcdir)/lib/states.c ]; then            \
	    echo "No ocamlc (OCaml bytecode compiler), skipping the generator."; \
	    touch $@;                                          \
	else                                                   \
	    echo;                                              \
	    echo "        *** *** ***";                        \
	    echo;                                              \
	    echo "Generated files are missing from your build."; \
	    echo;                                              \
	    echo "Install the OCaml bytecode compiler (the program called ‘ocamlc’)"; \
	    echo "and rerun ./configure && make";              \
	    echo;                                              \
	    echo "OR build from the tarballs at https://download.libguestfs.org/libnbd/"; \
	    echo "which include generated files.";             \
	    echo;                                              \
	    echo "        *** *** ***";                        \
	    echo;                                              \
	    exit 1;                                            \
	fi

endif