Tizen 2.1 base
[external/device-mapper.git] / test / api / Makefile.in
1 #
2 # Copyright (C) 2009 Red Hat, Inc. All rights reserved.
3 #
4 # This file is part of LVM2.
5 #
6 # This copyrighted material is made available to anyone wishing to use,
7 # modify, copy, or redistribute it subject to the terms and conditions
8 # of the GNU General Public License v.2.
9 #
10 # You should have received a copy of the GNU General Public License
11 # along with this program; if not, write to the Free Software Foundation,
12 # Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
13
14 srcdir = @srcdir@
15 top_srcdir = @top_srcdir@
16 top_builddir = @top_builddir@
17
18 ifeq ("@DEBUG@", "yes")
19         DEFS += -DDEBUG
20 endif
21
22 TARGETS = 
23 test_SOURCES = test.c
24 wrapper_SOURCES = test.c
25 INCLUDES += -I../../include
26
27 UNIT = vgtest.t percent.t
28
29 LVMLIBS = @LVM2APP_LIB@ -ldevmapper
30 DEPLIBS = $(top_builddir)/liblvm/liblvm2app.so $(top_builddir)/libdm/libdevmapper.so
31
32 DEFS += -D_REENTRANT
33
34 include $(top_builddir)/make.tmpl
35
36 LDFLAGS = -L$(top_builddir)/libdm -L$(top_builddir)/liblvm
37
38 ifeq ("@DMEVENTD@", "yes")
39         LVMLIBS += -ldevmapper-event
40         LDFLAGS += -L$(top_builddir)/daemons/dmeventd
41 endif
42
43 test_OBJECTS = $(test_SOURCES:.c=.o)
44 wrapper_OBJECTS = $(wrapper_SOURCES:.c=.o)
45 OBJECTS = $(test_OBJECTS)
46
47 all: tests test
48
49 tests: $(UNIT)
50
51 test: $(test_OBJECTS) $(DEPLIBS)
52         $(CC) -o test $(test_OBJECTS) $(CFLAGS) $(LDFLAGS) $(LVMLIBS) $(LIBS) $(READLINE_LIBS)
53
54 %.t: %.o $(DEPLIBS)
55         $(CC) -o $@ $(<) $(CFLAGS) $(LDFLAGS) $(LVMLIBS) $(LIBS)
56
57 wrapper: $(wrapper_OBJECTS) $(DEPLIBS)
58         $(CC) -o wrapper $(wrapper_OBJECTS) $(CFLAGS) $(LDFLAGS) $(LVMLIBS) $(LIBS) -lreadline
59
60 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
61         cd $(top_builddir) && $(SHELL) ./config.status test/api/Makefile