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