summaryrefslogtreecommitdiffstats
path: root/tools/Makefile.in
blob: 489ad9d97aef0155322472dba68fb84071b1b7ae (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
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
#
# Copyright (C) 2001 Sistina Software
#
# This LVM library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This LVM 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this LVM library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@

SOURCES=\
	archive.c \
	lvchange.c \
	lvcreate.c \
	lvdisplay.c \
	lvextend.c \
	lvm.c \
	lvmchange.c \
	lvmdiskscan.c \
	lvreduce.c \
	lvremove.c \
	lvrename.c \
	lvresize.c \
	lvscan.c \
	pvchange.c \
	pvcreate.c \
	pvdisplay.c \
	pvremove.c \
	pvscan.c \
	report.c \
	toollib.c \
	vgcfgbackup.c \
	vgcfgrestore.c \
	vgchange.c \
	vgck.c \
	vgcreate.c \
	vgconvert.c \
	vgdisplay.c \
	vgexport.c \
	vgextend.c \
	vgimport.c \
	vgmerge.c \
	vgreduce.c \
	vgremove.c \
	vgrename.c \
	vgscan.c \
	vgsplit.c

TARGETS=\
	.commands \
	lvm

LVMLIBS=-llvm

ifeq ("@DEVMAPPER@", "yes")
	LVMLIBS += -ldevmapper
endif

include ../make.tmpl

ifeq ("@STATIC_LINK@", "no")
	LVMLIBS += -rdynamic
endif

lvm: $(OBJECTS) $(top_srcdir)/lib/liblvm.a
	$(CC) -o lvm $(OBJECTS) $(LD_FLAGS) -L$(top_srcdir)/lib \
	      -L$(DESTDIR)/lib $(LVMLIBS) $(LIBS)

.commands: commands.h cmdnames.h Makefile
	$(CC) -E -P cmdnames.h 2> /dev/null | \
		egrep -v '^ *(|#.*|help|version) *$$' > .commands

install: $(TARGETS)
	$(INSTALL) -D -o $(OWNER) -g $(GROUP) -m 555 $(STRIP) lvm \
		$(sbindir)/lvm
	@echo Creating symbolic links for individual commands in $(sbindir)
	@( \
		for v in `cat .commands`; do \
			cd $(sbindir); \
			$(LN_S) -f lvm $$v; \
		done; \
	)