You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 line
3.6 KiB

  1. # Copyright (c) 2011 The LevelDB Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file. See the AUTHORS file for names of contributors.
  4. CC = g++
  5. # Uncomment one of the following to switch between debug and opt mode
  6. #OPT = -O2 -DNDEBUG
  7. OPT = -g2
  8. CFLAGS = -c -DLEVELDB_PLATFORM_POSIX -I. -I./include -std=c++0x $(OPT)
  9. LDFLAGS=-lpthread
  10. LIBOBJECTS = \
  11. ./db/builder.o \
  12. ./db/db_impl.o \
  13. ./db/db_iter.o \
  14. ./db/filename.o \
  15. ./db/dbformat.o \
  16. ./db/log_reader.o \
  17. ./db/log_writer.o \
  18. ./db/memtable.o \
  19. ./db/repair.o \
  20. ./db/table_cache.o \
  21. ./db/version_edit.o \
  22. ./db/version_set.o \
  23. ./db/write_batch.o \
  24. ./port/port_posix.o \
  25. ./table/block.o \
  26. ./table/block_builder.o \
  27. ./table/format.o \
  28. ./table/iterator.o \
  29. ./table/merger.o \
  30. ./table/table.o \
  31. ./table/table_builder.o \
  32. ./table/two_level_iterator.o \
  33. ./util/arena.o \
  34. ./util/cache.o \
  35. ./util/coding.o \
  36. ./util/comparator.o \
  37. ./util/crc32c.o \
  38. ./util/env.o \
  39. ./util/env_posix.o \
  40. ./util/hash.o \
  41. ./util/histogram.o \
  42. ./util/logging.o \
  43. ./util/options.o \
  44. ./util/status.o
  45. TESTUTIL = ./util/testutil.o
  46. TESTHARNESS = ./util/testharness.o $(TESTUTIL)
  47. TESTS = \
  48. arena_test \
  49. cache_test \
  50. coding_test \
  51. corruption_test \
  52. crc32c_test \
  53. db_test \
  54. dbformat_test \
  55. env_test \
  56. filename_test \
  57. log_test \
  58. skiplist_test \
  59. table_test \
  60. version_edit_test \
  61. write_batch_test
  62. PROGRAMS = db_bench $(TESTS)
  63. all: $(PROGRAMS)
  64. check: $(TESTS)
  65. for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done
  66. clean:
  67. rm -f $(PROGRAMS) */*.o
  68. db_bench: db/db_bench.o $(LIBOBJECTS) $(TESTUTIL)
  69. $(CC) $(LDFLAGS) db/db_bench.o $(LIBOBJECTS) $(TESTUTIL) -o $@
  70. arena_test: util/arena_test.o $(LIBOBJECTS) $(TESTHARNESS)
  71. $(CC) $(LDFLAGS) util/arena_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  72. cache_test: util/cache_test.o $(LIBOBJECTS) $(TESTHARNESS)
  73. $(CC) $(LDFLAGS) util/cache_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  74. coding_test: util/coding_test.o $(LIBOBJECTS) $(TESTHARNESS)
  75. $(CC) $(LDFLAGS) util/coding_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  76. corruption_test: db/corruption_test.o $(LIBOBJECTS) $(TESTHARNESS)
  77. $(CC) $(LDFLAGS) db/corruption_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  78. crc32c_test: util/crc32c_test.o $(LIBOBJECTS) $(TESTHARNESS)
  79. $(CC) $(LDFLAGS) util/crc32c_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  80. db_test: db/db_test.o $(LIBOBJECTS) $(TESTHARNESS)
  81. $(CC) $(LDFLAGS) db/db_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  82. dbformat_test: db/dbformat_test.o $(LIBOBJECTS) $(TESTHARNESS)
  83. $(CC) $(LDFLAGS) db/dbformat_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  84. env_test: util/env_test.o $(LIBOBJECTS) $(TESTHARNESS)
  85. $(CC) $(LDFLAGS) util/env_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  86. filename_test: db/filename_test.o $(LIBOBJECTS) $(TESTHARNESS)
  87. $(CC) $(LDFLAGS) db/filename_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  88. log_test: db/log_test.o $(LIBOBJECTS) $(TESTHARNESS)
  89. $(CC) $(LDFLAGS) db/log_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  90. table_test: table/table_test.o $(LIBOBJECTS) $(TESTHARNESS)
  91. $(CC) $(LDFLAGS) table/table_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  92. skiplist_test: db/skiplist_test.o $(LIBOBJECTS) $(TESTHARNESS)
  93. $(CC) $(LDFLAGS) db/skiplist_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  94. version_edit_test: db/version_edit_test.o $(LIBOBJECTS) $(TESTHARNESS)
  95. $(CC) $(LDFLAGS) db/version_edit_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  96. write_batch_test: db/write_batch_test.o $(LIBOBJECTS) $(TESTHARNESS)
  97. $(CC) $(LDFLAGS) db/write_batch_test.o $(LIBOBJECTS) $(TESTHARNESS) -o $@
  98. .cc.o:
  99. $(CC) $(CFLAGS) $< -o $@
  100. # TODO(gabor): dependencies for .o files
  101. # TODO(gabor): Build library