2011-08-31 18:31:48 +05:30
|
|
|
.PHONEY: all
|
|
|
|
|
2011-12-06 21:17:24 +05:30
|
|
|
PROGRAMS=\
|
|
|
|
thin_repair \
|
|
|
|
thin_dump \
|
|
|
|
thin_restore
|
|
|
|
|
|
|
|
all: $(PROGRAMS)
|
2011-08-31 18:31:48 +05:30
|
|
|
|
2011-06-16 12:46:10 +05:30
|
|
|
SOURCE=\
|
2011-09-12 16:19:42 +05:30
|
|
|
checksum.cc \
|
2011-08-22 15:12:13 +05:30
|
|
|
endian_utils.cc \
|
2011-08-24 15:15:39 +05:30
|
|
|
error_set.cc \
|
2011-09-16 14:36:37 +05:30
|
|
|
hex_dump.cc \
|
2011-10-10 18:40:30 +05:30
|
|
|
human_readable_format.cc \
|
2011-10-28 16:55:06 +05:30
|
|
|
metadata.cc \
|
2011-10-28 16:37:21 +05:30
|
|
|
metadata_checker.cc \
|
2011-10-28 16:43:03 +05:30
|
|
|
metadata_dumper.cc \
|
2011-08-31 17:18:41 +05:30
|
|
|
metadata_disk_structures.cc \
|
2011-10-28 18:31:44 +05:30
|
|
|
restore_emitter.cc \
|
2011-11-08 16:38:16 +05:30
|
|
|
space_map.cc \
|
2011-08-31 17:18:41 +05:30
|
|
|
space_map_disk.cc \
|
2011-11-09 15:51:25 +05:30
|
|
|
space_map_recursive.cc \
|
2011-11-16 18:47:49 +05:30
|
|
|
space_map_transactional.cc \
|
2011-10-28 16:51:58 +05:30
|
|
|
thin_pool.cc \
|
2011-10-10 19:36:07 +05:30
|
|
|
transaction_manager.cc \
|
|
|
|
xml_format.cc
|
2011-08-22 15:12:13 +05:30
|
|
|
|
2011-11-03 20:14:00 +05:30
|
|
|
PROGRAM_SOURCE=\
|
|
|
|
thin_dump.cc \
|
|
|
|
thin_repair.cc \
|
|
|
|
thin_restore.cc
|
|
|
|
|
2011-12-09 18:24:51 +05:30
|
|
|
CXX=g++
|
2011-06-16 12:46:10 +05:30
|
|
|
OBJECTS=$(subst .cc,.o,$(SOURCE))
|
2011-12-09 18:24:51 +05:30
|
|
|
TOP_DIR:=@top_srcdir@
|
|
|
|
CXXFLAGS=-Wall -I$(TOP_DIR)
|
|
|
|
CXXFLAGS+=@CXXOPTIMISE_FLAG@
|
|
|
|
CXXFLAGS+=@CXXDEBUG_FLAG@
|
2011-12-15 19:23:07 +05:30
|
|
|
LIBS=-lstdc++
|
2011-12-09 18:24:51 +05:30
|
|
|
INSTALL=@INSTALL@
|
|
|
|
INSTALL_PROGRAM=$(INSTALL) -m 555
|
2011-12-15 19:05:47 +05:30
|
|
|
DESTDIR=@prefix@
|
2011-12-15 20:14:43 +05:30
|
|
|
BINDIR=$(DESTDIR)/sbin
|
2011-06-16 12:46:10 +05:30
|
|
|
|
2011-08-31 18:23:46 +05:30
|
|
|
.PHONEY: test-programs
|
2011-07-14 20:01:00 +05:30
|
|
|
|
2011-07-22 20:39:56 +05:30
|
|
|
test-programs: $(TEST_PROGRAMS)
|
|
|
|
|
2011-06-27 15:15:30 +05:30
|
|
|
.SUFFIXES: .cc .o .d
|
2011-06-16 12:46:10 +05:30
|
|
|
|
2011-12-15 20:47:40 +05:30
|
|
|
.cc.d:
|
2011-12-09 18:24:51 +05:30
|
|
|
$(CXX) -MM -MT $(subst .cc,.o,$<) $(CXXFLAGS) $< > $@.$$$$; \
|
2011-10-24 22:34:19 +05:30
|
|
|
sed 's,\([^ :]*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
2011-06-27 15:15:30 +05:30
|
|
|
rm -f $@.$$$$
|
2011-06-16 12:46:10 +05:30
|
|
|
|
|
|
|
.cc.o:
|
2011-12-09 18:24:51 +05:30
|
|
|
$(CXX) -c $(CXXFLAGS) $(INCLUDES) -o $@ $<
|
2011-06-16 12:46:10 +05:30
|
|
|
|
2011-12-15 19:23:07 +05:30
|
|
|
THIN_DUMP_SOURCE=$(SOURCE)
|
|
|
|
THIN_RESTORE_SOURCE=$(SOURCE)
|
|
|
|
THIN_REPAIR_SOURCE=\
|
|
|
|
checksum.cc \
|
|
|
|
endian_utils.cc \
|
|
|
|
error_set.cc \
|
|
|
|
hex_dump.cc \
|
|
|
|
metadata.cc \
|
|
|
|
metadata_checker.cc \
|
|
|
|
metadata_disk_structures.cc \
|
|
|
|
space_map.cc \
|
|
|
|
space_map_disk.cc \
|
|
|
|
space_map_recursive.cc \
|
|
|
|
space_map_transactional.cc \
|
|
|
|
transaction_manager.cc
|
2011-08-23 16:25:37 +05:30
|
|
|
|
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))
|
|
|
|
THIN_REPAIR_OBJECTS=$(subst .cc,.o,$(THIN_REPAIR_SOURCE))
|
|
|
|
|
|
|
|
thin_dump: $(THIN_DUMP_OBJECTS) thin_dump.o
|
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) -lexpat
|
|
|
|
|
|
|
|
thin_restore: $(THIN_RESTORE_OBJECTS) thin_restore.o
|
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS) -lexpat
|
2011-08-31 18:31:48 +05:30
|
|
|
|
2011-12-15 19:23:07 +05:30
|
|
|
thin_repair: $(THIN_REPAIR_OBJECTS) thin_repair.o
|
2011-12-09 18:24:51 +05:30
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
|
2011-08-23 16:25:37 +05:30
|
|
|
|
2011-12-06 21:17:24 +05:30
|
|
|
.PHONEY: clean
|
|
|
|
clean:
|
|
|
|
rm -f *.o unit-tests/*.o $(TEST_PROGRAMS) $(PROGRAMS)
|
|
|
|
|
2011-12-09 18:24:51 +05:30
|
|
|
.PHONEY: install
|
|
|
|
install: $(PROGRAMS)
|
|
|
|
$(INSTALL_PROGRAM) -D thin_repair $(BINDIR)/thin_repair
|
|
|
|
$(INSTALL_PROGRAM) -D thin_dump $(BINDIR)/thin_dump
|
|
|
|
$(INSTALL_PROGRAM) -D thin_restore $(BINDIR)/thin_restore
|
|
|
|
|
2011-12-15 20:47:40 +05:30
|
|
|
-include $(subst .cc,.d,$(SOURCE))
|
|
|
|
-include $(subst .cc,.d,$(TEST_SOURCE))
|
|
|
|
-include $(subst .cc,.d,$(PROGRAM_SOURCE))
|
2011-12-09 18:24:51 +05:30
|
|
|
|
|
|
|
ifeq ("$(TESTING)", "yes")
|
|
|
|
include unit-tests/Makefile.in
|
|
|
|
endif
|