OLD | NEW |
1 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2011 The Native Client Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 # | 4 # |
5 # A Makefile for running nacl-mounts tests | 5 # A Makefile for running nacl-mounts tests |
6 # usage: 'make all' | 6 # usage: 'make all' |
7 # './tests_out/nacl_mounts_tests' | 7 # './tests_out/nacl_mounts_tests' |
8 | 8 |
9 # location of gtest | 9 # location of gtest |
10 GTEST_DIR = ../../testing/gtest | 10 GTEST_DIR = ../../testing/gtest |
11 | 11 |
12 CPPFLAGS += -I$(GTEST_DIR) -I$(GTEST_DIR)/include | 12 CPPFLAGS += -I$(GTEST_DIR) -I$(GTEST_DIR)/include |
13 CXXFLAGS += -pthread -g -Wall -Werror -I$(GTEST_DIR) | 13 CXXFLAGS += -pthread -g -Wall -Werror -I$(GTEST_DIR) |
14 | 14 |
15 # All gtest headers | 15 # All gtest headers |
16 GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \ | 16 GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \ |
17 $(GTEST_DIR)/include/gtest/internal/*.h | 17 $(GTEST_DIR)/include/gtest/internal/*.h |
18 | 18 |
19 # Add root of nacl-mounts to the include path | 19 # Add root of nacl-mounts to the include path |
20 CPPFLAGS += -I. | 20 CPPFLAGS += -I. |
21 | 21 |
22 UTIL_SOURCES = $(addprefix util/, Path.cc SimpleAutoLock.cc) | 22 UTIL_SOURCES = $(addprefix util/, Path.cc SimpleAutoLock.cc) |
23 BASE_SOURCES = $(addprefix base/, MountManager.cc KernelProxy.cc \ | 23 BASE_SOURCES = $(addprefix base/, MountManager.cc KernelProxy.cc \ |
24 MainThreadRunner.cc) | 24 MainThreadRunner.cc) |
25 MEM_SOURCES = $(addprefix memory/, MemMount.cc MemNode.cc) | 25 MEM_SOURCES = $(addprefix memory/, MemMount.cc MemNode.cc) |
26 CONSOLE_SOURCES = $(addprefix console/, ConsoleMount.cc JSPipeMount.cc) | 26 CONSOLE_SOURCES = $(addprefix console/, ConsoleMount.cc JSPipeMount.cc) |
27 BUFFER_SOURCES = $(addprefix buffer/, BufferMount.cc) | 27 BUFFER_SOURCES = $(addprefix buffer/, BufferMount.cc) |
| 28 DEV_SOURCES = $(addprefix dev/, DevMount.cc RandomDevice.cc NullDevice.cc) |
28 TEST_SOURCES = $(addprefix test/, SlotAllocatorTest.cc \ | 29 TEST_SOURCES = $(addprefix test/, SlotAllocatorTest.cc \ |
29 PathTest.cc BaseMountTest.cc MemMountTest.cc \ | 30 PathTest.cc BaseMountTest.cc MemMountTest.cc \ |
30 MemNodeTest.cc MountManagerTest.cc KernelProxyTest.cc \ | 31 MemNodeTest.cc MountManagerTest.cc KernelProxyTest.cc \ |
31 JSPipeMountTest.cc MainThreadRunnerTest.cc \ | 32 JSPipeMountTest.cc MainThreadRunnerTest.cc \ |
32 BufferMountTest.cc MockMount.cc) | 33 DevMountTest.cc BufferMountTest.cc MockMount.cc) |
33 | 34 |
34 SOURCES = $(UTIL_SOURCES) $(BASE_SOURCES) $(MEM_SOURCES) \ | 35 SOURCES = $(UTIL_SOURCES) $(BASE_SOURCES) $(MEM_SOURCES) \ |
35 $(CONSOLE_SOURCES) $(BUFFER_SOURCES) $(TEST_SOURCES) | 36 $(CONSOLE_SOURCES) $(BUFFER_SOURCES) $(DEV_SOURCES) $(TEST_SOURCES) |
36 TESTS_OUT = tests_out | 37 TESTS_OUT = tests_out |
37 OBJECTS = $(addprefix $(TESTS_OUT)/, $(SOURCES:.cc=.o)) | 38 OBJECTS = $(addprefix $(TESTS_OUT)/, $(SOURCES:.cc=.o)) |
38 OUTPUT = $(addprefix $(TESTS_OUT)/, base buffer util test memory console) | 39 OUTPUT = $(addprefix $(TESTS_OUT)/, base buffer util test memory console) |
39 | 40 |
40 # House-keeping build targets | 41 # House-keeping build targets |
41 all: $(TESTS_OUT)/nacl_mounts_tests | 42 all: $(TESTS_OUT)/nacl_mounts_tests |
42 | 43 |
43 clean: | 44 clean: |
44 rm -rf $(TESTS_OUT) | 45 rm -rf $(TESTS_OUT) |
45 | 46 |
(...skipping 17 matching lines...) Expand all Loading... |
63 mkdir -p $(dir $@) | 64 mkdir -p $(dir $@) |
64 $(AR) $(ARFLAGS) $@ $^ | 65 $(AR) $(ARFLAGS) $@ $^ |
65 | 66 |
66 $(TESTS_OUT)/%.o: %.cc | 67 $(TESTS_OUT)/%.o: %.cc |
67 mkdir -p $(dir $@) | 68 mkdir -p $(dir $@) |
68 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ | 69 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ |
69 | 70 |
70 $(TESTS_OUT)/nacl_mounts_tests: $(OBJECTS) $(TESTS_OUT)/gtest_main.a | 71 $(TESTS_OUT)/nacl_mounts_tests: $(OBJECTS) $(TESTS_OUT)/gtest_main.a |
71 mkdir -p $(dir $@) | 72 mkdir -p $(dir $@) |
72 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ | 73 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -lpthread $^ -o $@ |
OLD | NEW |