70 lines
1.7 KiB
Makefile
Raw Normal View History

2011-06-16 08:16:10 +01:00
SOURCE=\
2011-08-22 10:42:13 +01:00
endian_utils.cc \
error_set.cc \
2011-08-23 11:55:37 +01:00
metadata.cc \
2011-08-22 10:42:13 +01:00
metadata_disk_structures.cc
2011-07-22 16:09:56 +01:00
TEST_SOURCE=\
2011-08-22 10:42:13 +01:00
unit-tests/block_t.cc \
unit-tests/btree_t.cc \
unit-tests/endian_t.cc \
unit-tests/space_map_t.cc \
unit-tests/space_map_disk_t.cc \
unit-tests/transaction_manager_t.cc \
2011-06-16 08:16:10 +01:00
OBJECTS=$(subst .cc,.o,$(SOURCE))
2011-07-22 16:09:56 +01:00
TEST_PROGRAMS=$(subst .cc,,$(TEST_SOURCE))
2011-08-22 10:42:13 +01:00
TOP_DIR:=$(PWD)
2011-08-25 10:54:43 +01:00
#CPPFLAGS=-Wall -g -I$(TOP_DIR)
CPPFLAGS=-Wall -std=c++0x -g -I$(TOP_DIR)
2011-06-16 08:16:10 +01:00
LIBS=-lstdc++
2011-07-22 16:09:56 +01:00
.PHONEY: unit-tests test-programs
2011-07-22 16:09:56 +01:00
test-programs: $(TEST_PROGRAMS)
2011-08-22 10:42:13 +01:00
unit-test: $(TEST_PROGRAMS)
2011-07-22 16:09:56 +01:00
for p in $(TEST_PROGRAMS); do echo Running $$p; ./$$p; done
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-08-22 10:42:13 +01:00
g++ -MM $(CPPFLAGS) $< > $@.$$$$; \
2011-06-27 10:45:30 +01:00
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
2011-06-16 08:16:10 +01:00
.cc.o:
g++ -c $(CPPFLAGS) $(INCLUDES) -o $@ $<
2011-07-13 15:09:33 +01:00
multisnap_display: $(OBJECTS) main.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-07-13 15:09:33 +01:00
2011-08-23 11:55:37 +01:00
thin_dump: $(OBJECTS) thin_dump.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
thin_repair: $(OBJECTS) thin_repair.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-08-22 10:42:13 +01:00
unit-tests/block_t: unit-tests/block_t.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-08-22 10:42:13 +01:00
unit-tests/btree_t: unit-tests/btree_t.o
2011-07-15 15:21:28 +01:00
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-08-22 10:42:13 +01:00
unit-tests/space_map_t: unit-tests/space_map_t.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-08-22 10:42:13 +01:00
unit-tests/space_map_disk_t: unit-tests/space_map_disk_t.o $(OBJECTS)
2011-07-22 16:09:56 +01:00
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-08-22 10:42:13 +01:00
unit-tests/transaction_manager_t: unit-tests/transaction_manager_t.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-07-13 16:59:12 +01:00
2011-08-22 10:42:13 +01:00
unit-tests/metadata_t: unit-tests/metadata_t.o $(OBJECTS)
2011-07-22 16:09:56 +01:00
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-08-22 10:42:13 +01:00
unit-tests/endian_t: unit-tests/endian_t.o $(OBJECTS)
2011-07-22 16:09:56 +01:00
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-07-13 15:09:33 +01:00
include $(subst .cc,.d,$(SOURCE))
2011-07-22 16:09:56 +01:00
include $(subst .cc,.d,$(TEST_SOURCE))