2011-12-21 15:34:00 +05:30
|
|
|
# Copyright (C) 2011 Red Hat, Inc. All rights reserved.
|
|
|
|
#
|
|
|
|
# This file is part of the thin-provisioning-tools source.
|
|
|
|
#
|
|
|
|
# thin-provisioning-tools 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 3 of
|
|
|
|
# the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# thin-provisioning-tools 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 thin-provisioning-tools. If not, see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
|
2011-12-21 16:01:56 +05:30
|
|
|
.PHONY: all
|
2011-08-31 18:31:48 +05:30
|
|
|
|
2011-12-06 21:17:24 +05:30
|
|
|
PROGRAMS=\
|
2013-03-15 21:54:17 +05:30
|
|
|
cache_check \
|
|
|
|
cache_dump \
|
|
|
|
cache_restore \
|
|
|
|
\
|
2012-03-08 22:50:46 +05:30
|
|
|
thin_debug \
|
2012-03-02 15:30:31 +05:30
|
|
|
thin_check \
|
2011-12-06 21:17:24 +05:30
|
|
|
thin_dump \
|
|
|
|
thin_restore
|
|
|
|
|
|
|
|
all: $(PROGRAMS)
|
2011-08-31 18:31:48 +05:30
|
|
|
|
2011-06-16 12:46:10 +05:30
|
|
|
SOURCE=\
|
2013-01-02 18:25:41 +05:30
|
|
|
persistent-data/checksum.cc \
|
|
|
|
persistent-data/endian_utils.cc \
|
|
|
|
persistent-data/error_set.cc \
|
|
|
|
persistent-data/hex_dump.cc \
|
2013-01-07 20:29:41 +05:30
|
|
|
persistent-data/lock_tracker.cc \
|
2013-01-12 00:56:51 +05:30
|
|
|
persistent-data/transaction_manager.cc \
|
|
|
|
\
|
2013-01-02 18:25:41 +05:30
|
|
|
persistent-data/space_map.cc \
|
2013-01-11 03:06:38 +05:30
|
|
|
persistent-data/space-maps/disk.cc \
|
|
|
|
persistent-data/space-maps/recursive.cc \
|
|
|
|
persistent-data/space-maps/careful_alloc.cc \
|
2013-01-12 00:56:51 +05:30
|
|
|
\
|
2013-03-15 21:54:17 +05:30
|
|
|
cache/metadata_disk_structures.cc \
|
|
|
|
\
|
2013-01-02 18:25:41 +05:30
|
|
|
thin-provisioning/human_readable_format.cc \
|
|
|
|
thin-provisioning/metadata.cc \
|
|
|
|
thin-provisioning/metadata_checker.cc \
|
|
|
|
thin-provisioning/metadata_disk_structures.cc \
|
|
|
|
thin-provisioning/metadata_dumper.cc \
|
|
|
|
thin-provisioning/restore_emitter.cc \
|
|
|
|
thin-provisioning/thin_pool.cc \
|
|
|
|
thin-provisioning/xml_format.cc
|
2011-08-22 15:12:13 +05:30
|
|
|
|
2011-11-03 20:14:00 +05:30
|
|
|
PROGRAM_SOURCE=\
|
2013-03-15 21:54:17 +05:30
|
|
|
cache/check.cc \
|
|
|
|
cache/dump.cc \
|
|
|
|
cache/restore.cc \
|
|
|
|
\
|
2013-01-02 18:25:41 +05:30
|
|
|
thin-provisioning/thin_check.cc \
|
|
|
|
thin-provisioning/thin_dump.cc \
|
|
|
|
thin-provisioning/thin_restore.cc
|
2011-11-03 20:14:00 +05:30
|
|
|
|
2011-12-21 15:34:00 +05:30
|
|
|
CXX:=@CXX@
|
|
|
|
OBJECTS:=$(subst .cc,.o,$(SOURCE))
|
2011-12-09 18:24:51 +05:30
|
|
|
TOP_DIR:=@top_srcdir@
|
2011-12-21 15:34:00 +05:30
|
|
|
TOP_BUILDDIR:=@top_builddir@
|
2013-01-10 01:54:11 +05:30
|
|
|
CXXFLAGS+=-g -Wall -fno-strict-aliasing
|
2011-12-09 18:24:51 +05:30
|
|
|
CXXFLAGS+=@CXXOPTIMISE_FLAG@
|
|
|
|
CXXFLAGS+=@CXXDEBUG_FLAG@
|
2013-01-02 18:25:41 +05:30
|
|
|
INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
|
2011-12-21 15:34:00 +05:30
|
|
|
LIBS:=-lstdc++
|
|
|
|
LIBEXPAT:=-lexpat
|
|
|
|
INSTALL:=@INSTALL@
|
2013-01-10 01:54:11 +05:30
|
|
|
STRIP=strip
|
2012-03-15 17:35:37 +05:30
|
|
|
PREFIX:=@prefix@
|
|
|
|
BINDIR:=$(DESTDIR)$(PREFIX)/sbin
|
2011-12-21 15:34:00 +05:30
|
|
|
MANPATH:=$(DESTDIR)$(MANDIR)
|
|
|
|
|
|
|
|
vpath %.cc $(TOP_DIR)
|
|
|
|
|
|
|
|
INSTALL_DIR = $(INSTALL) -m 755 -d
|
|
|
|
INSTALL_PROGRAM = $(INSTALL) -m 755 $(STRIP)
|
|
|
|
INSTALL_DATA = $(INSTALL) -p -m 644
|
2011-06-16 12:46:10 +05:30
|
|
|
|
2011-12-21 16:01:56 +05:30
|
|
|
.PHONY: test-programs
|
2011-07-14 20:01:00 +05:30
|
|
|
|
2011-07-22 20:39:56 +05:30
|
|
|
test-programs: $(TEST_PROGRAMS)
|
|
|
|
|
2011-12-21 15:34:00 +05:30
|
|
|
.SUFFIXES: .d
|
2011-06-16 12:46:10 +05:30
|
|
|
|
2011-12-21 15:34:00 +05:30
|
|
|
%.d: %.cc
|
|
|
|
$(CXX) -MM -MT $(subst .cc,.o,$<) $(INCLUDES) $(CXXFLAGS) $< > $@.$$$$;\
|
|
|
|
sed 's,\([^ :]*\)\.o[ :]*,\1.o $@ : Makefile ,g' < $@.$$$$ > $@; \
|
|
|
|
$(RM) $@.$$$$
|
2011-06-16 12:46:10 +05:30
|
|
|
|
2011-12-21 15:34:00 +05:30
|
|
|
%.o: %.cc
|
|
|
|
$(CXX) -c $(INCLUDES) $(CXXFLAGS) -o $@ $<
|
2011-06-16 12:46:10 +05:30
|
|
|
|
2013-03-15 21:54:17 +05:30
|
|
|
#----------------------------------------------------------------
|
|
|
|
# Thin provisioning tools
|
2013-01-02 18:25:41 +05:30
|
|
|
|
2012-03-08 22:50:46 +05:30
|
|
|
THIN_DEBUG_SOURCE=$(SOURCE)
|
2011-12-15 19:23:07 +05:30
|
|
|
THIN_DUMP_SOURCE=$(SOURCE)
|
|
|
|
THIN_RESTORE_SOURCE=$(SOURCE)
|
2012-03-02 15:30:31 +05:30
|
|
|
THIN_CHECK_SOURCE=\
|
2013-01-02 18:25:41 +05:30
|
|
|
persistent-data/checksum.cc \
|
|
|
|
persistent-data/endian_utils.cc \
|
|
|
|
persistent-data/error_set.cc \
|
|
|
|
persistent-data/hex_dump.cc \
|
2013-01-07 20:29:41 +05:30
|
|
|
persistent-data/lock_tracker.cc \
|
2013-01-02 18:25:41 +05:30
|
|
|
persistent-data/space_map.cc \
|
2013-01-12 00:56:51 +05:30
|
|
|
persistent-data/space-maps/disk.cc \
|
|
|
|
persistent-data/space-maps/recursive.cc \
|
|
|
|
persistent-data/space-maps/careful_alloc.cc \
|
2013-01-02 18:25:41 +05:30
|
|
|
persistent-data/transaction_manager.cc \
|
|
|
|
thin-provisioning/metadata.cc \
|
|
|
|
thin-provisioning/metadata_checker.cc \
|
|
|
|
thin-provisioning/metadata_disk_structures.cc
|
|
|
|
|
2012-03-08 22:50:46 +05:30
|
|
|
THIN_DEBUG_OBJECTS=$(subst .cc,.o,$(THIN_DEBUG_SOURCE))
|
2011-12-15 19:23:07 +05:30
|
|
|
THIN_DUMP_OBJECTS=$(subst .cc,.o,$(THIN_DUMP_SOURCE))
|
|
|
|
THIN_RESTORE_OBJECTS=$(subst .cc,.o,$(THIN_RESTORE_SOURCE))
|
2012-03-02 15:30:31 +05:30
|
|
|
THIN_CHECK_OBJECTS=$(subst .cc,.o,$(THIN_CHECK_SOURCE))
|
2011-12-15 19:23:07 +05:30
|
|
|
|
2013-01-02 18:25:41 +05:30
|
|
|
thin_debug: $(THIN_DEBUG_OBJECTS) thin-provisioning/thin_debug.o
|
2012-03-08 22:50:46 +05:30
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
|
|
|
|
|
2013-01-02 18:25:41 +05:30
|
|
|
thin_dump: $(THIN_DUMP_OBJECTS) thin-provisioning/thin_dump.o
|
2011-12-21 15:34:00 +05:30
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
|
2011-12-15 19:23:07 +05:30
|
|
|
|
2013-01-02 18:25:41 +05:30
|
|
|
thin_restore: $(THIN_RESTORE_OBJECTS) thin-provisioning/thin_restore.o
|
2011-12-21 15:34:00 +05:30
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) $(LIBEXPAT)
|
2011-08-31 18:31:48 +05:30
|
|
|
|
2013-01-02 18:25:41 +05:30
|
|
|
thin_check: $(THIN_CHECK_OBJECTS) thin-provisioning/thin_check.o
|
2011-12-09 18:24:51 +05:30
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
|
2011-08-23 16:25:37 +05:30
|
|
|
|
2013-03-15 21:54:17 +05:30
|
|
|
#----------------------------------------------------------------
|
|
|
|
# Cache tools
|
|
|
|
|
|
|
|
CACHE_CHECK_SOURCE=\
|
|
|
|
persistent-data/checksum.cc \
|
|
|
|
persistent-data/endian_utils.cc \
|
|
|
|
persistent-data/error_set.cc \
|
|
|
|
persistent-data/hex_dump.cc \
|
|
|
|
persistent-data/lock_tracker.cc \
|
|
|
|
persistent-data/space_map.cc \
|
|
|
|
persistent-data/space-maps/disk.cc \
|
|
|
|
persistent-data/space-maps/recursive.cc \
|
|
|
|
persistent-data/space-maps/careful_alloc.cc \
|
|
|
|
persistent-data/transaction_manager.cc \
|
|
|
|
cache/metadata_disk_structures.cc
|
|
|
|
|
|
|
|
CACHE_CHECK_OBJECTS=$(subst .cc,.o,$(CACHE_CHECK_SOURCE))
|
|
|
|
|
|
|
|
cache_check: $(CACHE_CHECK_OBJECTS) cache/check.o
|
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
|
2013-01-02 18:25:41 +05:30
|
|
|
|
2011-12-06 21:17:24 +05:30
|
|
|
clean:
|
2013-01-07 22:09:02 +05:30
|
|
|
$(RM) *.o unit-tests/*.o *.d unit-tests/*.d $(TEST_PROGRAMS) $(PROGRAMS) $(OBJECTS)
|
2011-12-21 15:34:00 +05:30
|
|
|
distclean: clean
|
2011-12-21 15:38:37 +05:30
|
|
|
$(RM) config.cache config.log config.status configure.h version.h Makefile unit-tests/Makefile
|
2011-12-21 16:01:56 +05:30
|
|
|
.PHONY: clean distclean
|
2011-12-06 21:17:24 +05:30
|
|
|
|
2011-12-09 18:24:51 +05:30
|
|
|
install: $(PROGRAMS)
|
2011-12-21 15:34:00 +05:30
|
|
|
$(INSTALL_DIR) $(BINDIR)
|
2012-03-02 15:30:31 +05:30
|
|
|
$(INSTALL_PROGRAM) thin_check $(BINDIR)/thin_check
|
2011-12-21 15:34:00 +05:30
|
|
|
$(INSTALL_PROGRAM) thin_dump $(BINDIR)/thin_dump
|
|
|
|
$(INSTALL_PROGRAM) thin_restore $(BINDIR)/thin_restore
|
|
|
|
$(INSTALL_DIR) $(MANPATH)/man8
|
2012-03-02 15:30:31 +05:30
|
|
|
$(INSTALL_DATA) man8/thin_check.8 $(MANPATH)/man8/thin_check.8
|
2011-12-21 15:34:00 +05:30
|
|
|
$(INSTALL_DATA) man8/thin_dump.8 $(MANPATH)/man8/thin_dump.8
|
|
|
|
$(INSTALL_DATA) man8/thin_restore.8 $(MANPATH)/man8/thin_restore.8
|
2011-12-21 16:01:56 +05:30
|
|
|
.PHONY: install
|
2011-12-21 15:34:00 +05:30
|
|
|
|
|
|
|
ifeq ("@TESTING@", "yes")
|
2011-12-21 15:38:37 +05:30
|
|
|
include unit-tests/Makefile
|
2011-12-09 18:24:51 +05:30
|
|
|
endif
|
2013-01-15 10:59:40 +05:30
|
|
|
|
|
|
|
-include $(subst .cc,.d,$(SOURCE))
|
|
|
|
-include $(subst .cc,.d,$(TEST_SOURCE))
|
|
|
|
-include $(subst .cc,.d,$(PROGRAM_SOURCE))
|
|
|
|
|