64 lines
1.3 KiB
Makefile
Raw Normal View History

2011-06-16 08:16:10 +01:00
SOURCE=\
2011-07-22 16:09:56 +01:00
endian.cc \
metadata.cc \
metadata_disk_structures.cc \
space_map_disk.cc \
2011-06-16 08:16:10 +01:00
2011-07-22 16:09:56 +01:00
TEST_SOURCE=\
2011-07-13 16:59:12 +01:00
block_t.cc \
2011-07-15 15:21:28 +01:00
btree_t.cc \
2011-07-22 16:09:56 +01:00
endian_t.cc \
metadata_t.cc \
space_map_t.cc \
2011-07-22 16:09:56 +01:00
space_map_disk_t.cc \
transaction_manager_t.cc \
2011-07-13 15:09:33 +01:00
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-07-15 15:21:28 +01:00
CPPFLAGS=-Wall -std=c++0x -g
2011-06-16 08:16:10 +01:00
INCLUDES=
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)
unit-tests: $(TEST_PROGRAMS)
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
$(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \
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
block_t: block_t.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-07-15 15:21:28 +01:00
btree_t: btree_t.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-07-13 16:59:12 +01:00
space_map_t: space_map_t.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-07-22 16:09:56 +01:00
space_map_disk_t: space_map_disk_t.o $(OBJECTS)
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
transaction_manager_t: transaction_manager_t.o
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
2011-07-13 16:59:12 +01:00
2011-07-22 16:09:56 +01:00
metadata_t: metadata_t.o $(OBJECTS)
g++ $(CPPFLAGS) -o $@ $+ $(LIBS)
endian_t: endian_t.o $(OBJECTS)
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))