106 lines
2.2 KiB
Makefile
106 lines
2.2 KiB
Makefile
.PHONEY: all
|
|
|
|
PROGRAMS=\
|
|
thin_repair \
|
|
thin_dump \
|
|
thin_restore
|
|
|
|
all: $(PROGRAMS)
|
|
|
|
SOURCE=\
|
|
checksum.cc \
|
|
endian_utils.cc \
|
|
error_set.cc \
|
|
hex_dump.cc \
|
|
human_readable_format.cc \
|
|
metadata.cc \
|
|
metadata_checker.cc \
|
|
metadata_dumper.cc \
|
|
metadata_disk_structures.cc \
|
|
restore_emitter.cc \
|
|
space_map.cc \
|
|
space_map_disk.cc \
|
|
space_map_recursive.cc \
|
|
space_map_transactional.cc \
|
|
thin_pool.cc \
|
|
transaction_manager.cc \
|
|
xml_format.cc
|
|
|
|
PROGRAM_SOURCE=\
|
|
thin_dump.cc \
|
|
thin_repair.cc \
|
|
thin_restore.cc
|
|
|
|
CXX=g++
|
|
OBJECTS=$(subst .cc,.o,$(SOURCE))
|
|
TOP_DIR:=@top_srcdir@
|
|
CXXFLAGS=-Wall -I$(TOP_DIR)
|
|
CXXFLAGS+=@CXXOPTIMISE_FLAG@
|
|
CXXFLAGS+=@CXXDEBUG_FLAG@
|
|
LIBS=-lstdc++
|
|
INSTALL=@INSTALL@
|
|
INSTALL_PROGRAM=$(INSTALL) -m 555
|
|
DESTDIR=@prefix@
|
|
BINDIR=$(DESTDIR)/sbin
|
|
|
|
.PHONEY: test-programs
|
|
|
|
test-programs: $(TEST_PROGRAMS)
|
|
|
|
.SUFFIXES: .cc .o .d
|
|
|
|
%.d: %.cc
|
|
$(CXX) -MM -MT $(subst .cc,.o,$<) $(CXXFLAGS) $< > $@.$$$$; \
|
|
sed 's,\([^ :]*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
|
rm -f $@.$$$$
|
|
|
|
.cc.o:
|
|
$(CXX) -c $(CXXFLAGS) $(INCLUDES) -o $@ $<
|
|
|
|
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
|
|
|
|
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
|
|
|
|
thin_repair: $(THIN_REPAIR_OBJECTS) thin_repair.o
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
|
|
|
|
.PHONEY: clean
|
|
clean:
|
|
rm -f *.o unit-tests/*.o $(TEST_PROGRAMS) $(PROGRAMS)
|
|
|
|
.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
|
|
|
|
include $(subst .cc,.d,$(SOURCE))
|
|
include $(subst .cc,.d,$(TEST_SOURCE))
|
|
include $(subst .cc,.d,$(PROGRAM_SOURCE))
|
|
|
|
ifeq ("$(TESTING)", "yes")
|
|
include unit-tests/Makefile.in
|
|
endif
|