Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Side by Side Diff: ports/nacl-spawn/Makefile

Issue 1555913002: Build gtest from source rather than using SDK-provided version (Closed) Base URL: https://chromium.googlesource.com/webports.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ports/mingn/build.sh ('k') | ports/nacl-spawn/build.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2014 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 # TODO(hamaji): include $NACL_SDK_ROOT/tools/common.mk. 5 # TODO(hamaji): include $NACL_SDK_ROOT/tools/common.mk.
6 6
7 NACL_SPAWN_OBJS = nacl_spawn.o nacl_setup_env.o path_util.o elf_reader.o \ 7 NACL_SPAWN_OBJS = nacl_spawn.o nacl_setup_env.o path_util.o elf_reader.o \
8 library_dependencies.o nacl_apipe.o nacl_pp_helpers.o 8 library_dependencies.o nacl_apipe.o nacl_pp_helpers.o
9 9
10 TEST_EXES = test/unittests 10 TEST_EXES = test/unittests
11 LIBRARIES = libcli_main.a libnacl_spawn.a 11 LIBRARIES = libcli_main.a libnacl_spawn.a
12 12
13 CFLAGS += -std=gnu99 13 CFLAGS += -std=gnu99
14 CPPFLAGS += -Wall -Werror -Iinclude 14 CPPFLAGS += -Wall -Werror -Iinclude
15 CPPFLAGS += -I$(GTEST_DIR)/include
15 LDFLAGS += -lnacl_io 16 LDFLAGS += -lnacl_io
16 17
17 ifeq ($(NACL_SHARED),1) 18 ifeq ($(NACL_SHARED),1)
18 LIBRARIES += libnacl_spawn.so 19 LIBRARIES += libnacl_spawn.so
19 endif 20 endif
20 21
21 ifeq ($(TOOLCHAIN),glibc) 22 ifeq ($(TOOLCHAIN),glibc)
22 TEST_EXES += test/elf_reader test/library_dependencies 23 TEST_EXES += test/elf_reader test/library_dependencies
23 TEST_BINARIES = test/test_exe test/libtest1.so test/libtest2.so test/libtest3.so 24 TEST_BINARIES = test/test_exe test/libtest1.so test/libtest2.so test/libtest3.so
24 endif 25 endif
(...skipping 16 matching lines...) Expand all
41 libnacl_spawn.so: $(NACL_SPAWN_OBJS) 42 libnacl_spawn.so: $(NACL_SPAWN_OBJS)
42 $(CXX) $(LDFLAGS) -shared $^ -o $@ 43 $(CXX) $(LDFLAGS) -shared $^ -o $@
43 44
44 libnacl_spawn.a: $(NACL_SPAWN_OBJS) 45 libnacl_spawn.a: $(NACL_SPAWN_OBJS)
45 rm -f $@ 46 rm -f $@
46 $(AR) rcs $@ $^ 47 $(AR) rcs $@ $^
47 48
48 %.o: %.cc 49 %.o: %.cc
49 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ 50 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
50 51
52 %.o: $(GTEST_DIR)/src/%.cc
53 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@ -I$(GTEST_DIR)
54
51 # Targets for tests 55 # Targets for tests
52 56
53 LIBS=-Xlinker -uPSUserMainGet -lcli_main -lnacl_spawn 57 LIBS=-Xlinker -uPSUserMainGet -lcli_main -lnacl_spawn
54 LIBS+=-lgtest -lppapi_simple_cpp -lnacl_io -lppapi_cpp -lppapi 58 LIBS+=-lppapi_simple_cpp -lnacl_io -lppapi_cpp -lppapi
55 59
56 test/unittests: nacl_spawn_test.o $(LIBRARIES) 60 test/unittests: nacl_spawn_test.o $(LIBRARIES) gtest-all.o
57 » $(CXX) -L. $(LDFLAGS) $< -o $@ $(LIBS) 61 » $(CXX) -L. $(LDFLAGS) $< gtest-all.o -o $@ $(LIBS)
58 62
59 63
60 ifeq ($(TOOLCHAIN),glibc) 64 ifeq ($(TOOLCHAIN),glibc)
61 test: 65 test:
62 ./test/run_test.sh 66 ./test/run_test.sh
63 67
64 test/elf_reader: elf_reader.cc 68 test/elf_reader: elf_reader.cc
65 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DDEFINE_ELF_READER_MAIN $< -o $@ 69 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DDEFINE_ELF_READER_MAIN $< -o $@
66 test/library_dependencies: elf_reader.o path_util.o library_dependencies.cc 70 test/library_dependencies: elf_reader.o path_util.o library_dependencies.cc
67 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DDEFINE_LIBRARY_DEPENDENCIES_ MAIN $^ -o $@ 71 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -DDEFINE_LIBRARY_DEPENDENCIES_ MAIN $^ -o $@
68 72
69 # We use -nostdlib not to have libc.so in their dependencies. 73 # We use -nostdlib not to have libc.so in their dependencies.
70 test/test_exe: test/test_exe.c test/libtest1.so test/libtest2.so 74 test/test_exe: test/test_exe.c test/libtest1.so test/libtest2.so
71 $(CC) $(CPPFLAGS) $(CFLAGS) $< -nostdlib -Wl,-rpath-link=test -Ltest -lt est1 -ltest2 -o $@ 75 $(CC) $(CPPFLAGS) $(CFLAGS) $< -nostdlib -Wl,-rpath-link=test -Ltest -lt est1 -ltest2 -o $@
72 test/libtest1.so: test/libtest1.c test/libtest3.so 76 test/libtest1.so: test/libtest1.c test/libtest3.so
73 $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -Ltest -ltest3 -o $@ 77 $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -Ltest -ltest3 -o $@
74 test/libtest2.so: test/libtest2.c test/libtest3.so 78 test/libtest2.so: test/libtest2.c test/libtest3.so
75 $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -Ltest -ltest3 -o $@ 79 $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -Ltest -ltest3 -o $@
76 test/libtest3.so: test/libtest3.c 80 test/libtest3.so: test/libtest3.c
77 $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -o $@ 81 $(CC) $(CPPFLAGS) $(CFLAGS) $< -fPIC -nostdlib -shared -o $@
78 endif 82 endif
79 83
80 clean: 84 clean:
81 rm -f *.a *.o *.so $(TEST_EXES) $(TEST_BINARIES) 85 rm -f *.a *.o *.so $(TEST_EXES) $(TEST_BINARIES)
82 86
83 .PHONY: clean all test 87 .PHONY: clean all test
OLDNEW
« no previous file with comments | « ports/mingn/build.sh ('k') | ports/nacl-spawn/build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698