85 lines
1.7 KiB
Makefile
85 lines
1.7 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++ -lboost_program_options -lexpat
|
|
INSTALL=@INSTALL@
|
|
INSTALL_PROGRAM=$(INSTALL) -m 555
|
|
BINDIR=@prefix@/bin
|
|
|
|
.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: $(OBJECTS) thin_dump.o
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
|
|
|
|
thin_restore: $(OBJECTS) thin_restore.o
|
|
$(CXX) $(CXXFLAGS) -o $@ $+ $(LIBS)
|
|
|
|
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
|