summaryrefslogtreecommitdiffstats
path: root/erlang/Makefile.am
blob: 7ebc444321e1b6258223af5f646eb6374c3ae3c3 (plain)
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
# libguestfs Erlang bindings
# Copyright (C) 2011 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; 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

generator_built = \
	bindtests.erl \
	erl-guestfs.c \
	guestfs.erl

EXTRA_DIST = \
	$(generator_built) \
	run-bindtests \
	tests/*.erl \
	README

if HAVE_ERLANG

erlang_bindir = $(libdir)/erlang/lib/$(PACKAGE_NAME)-$(PACKAGE_VERSION)/ebin

erlang_bin_DATA = guestfs.beam

guestfs.beam: guestfs.erl
	$(ERLC) +debug_info $^

bin_PROGRAMS = erl-guestfs

erl_guestfs_SOURCES = erl-guestfs.c erl-guestfs-proto.c

erl_guestfs_CFLAGS = \
	-I$(top_srcdir)/src -I$(top_builddir)/src \
	-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
	-I$(ERLANG_LIB_DIR_erl_interface)/include \
	$(WARN_CFLAGS) $(WERROR_CFLAGS)

erl_guestfs_LDADD = \
	$(ERLANG_LIB_DIR_erl_interface)/lib/liberl_interface.a \
	$(ERLANG_LIB_DIR_erl_interface)/lib/libei.a \
	-lpthread \
	$(top_builddir)/src/libguestfs.la \
	../gnulib/lib/libgnu.la

TESTS_ENVIRONMENT = PATH=$(builddir):$$PATH $(top_builddir)/run --test

TESTS = run-bindtests

if ENABLE_APPLIANCE
TESTS += tests/010-load.erl
endif

endif