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

Side by Side Diff: ports/glibc-compat/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/devenv/pkg_info ('k') | ports/glibc-compat/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) 2012 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2012 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 ifneq ($(TOOLCHAIN),glibc) 5 ifneq ($(TOOLCHAIN),glibc)
6 LIBC = newlib 6 LIBC = newlib
7 endif 7 endif
8 8
9 CFLAGS += -Wno-implicit-function-declaration 9 CFLAGS += -Wno-implicit-function-declaration
10 CPPFLAGS += -Werror -Wno-unused-value -pthread 10 CPPFLAGS += -Werror -Wno-unused-value -pthread
11 CPPFLAGS += -DNACL_SDK_VERSION=$(NACL_SDK_VERSION) 11 CPPFLAGS += -DNACL_SDK_VERSION=$(NACL_SDK_VERSION)
12 CPPFLAGS += -I$(GTEST_DIR)/include
12 OUT := out 13 OUT := out
13 SOURCES := \ 14 SOURCES := \
14 src/alarm.c \ 15 src/alarm.c \
15 src/getpass.c \ 16 src/getpass.c \
16 src/err.c \ 17 src/err.c \
17 src/fpending.c \ 18 src/fpending.c \
18 src/dirfd.c \ 19 src/dirfd.c \
19 src/flock.c \ 20 src/flock.c \
20 src/fts.c \ 21 src/fts.c \
21 src/getprotobyname_r.c \ 22 src/getprotobyname_r.c \
(...skipping 30 matching lines...) Expand all
52 ifeq ($(V),1) 53 ifeq ($(V),1)
53 CXX_PREFIX = 54 CXX_PREFIX =
54 CC_PREFIX = 55 CC_PREFIX =
55 AR_PREFIX = 56 AR_PREFIX =
56 else 57 else
57 CXX_PREFIX = @echo " CXX $@"; 58 CXX_PREFIX = @echo " CXX $@";
58 CC_PREFIX = @echo " CC $@"; 59 CC_PREFIX = @echo " CC $@";
59 AR_PREFIX = @echo " AR $@"; 60 AR_PREFIX = @echo " AR $@";
60 endif 61 endif
61 62
62
63 ifeq ($(LIBC),newlib) 63 ifeq ($(LIBC),newlib)
64 LIB = $(OUT)/libglibc-compat.a 64 LIB = $(OUT)/libglibc-compat.a
65 CPPFLAGS += -Iinclude -Isrc -D_LIBC 65 CPPFLAGS += -Iinclude -Isrc -D_LIBC
66 endif 66 endif
67 67
68 all: $(LIB) $(OUT)/glibc_compat_test
69
68 $(OUT)/%.o : src/%.c 70 $(OUT)/%.o : src/%.c
69 @mkdir -p $(OUT) 71 @mkdir -p $(OUT)
70 $(CC_PREFIX)$(CC) -o $@ -c $< $(CFLAGS) $(CPPFLAGS) 72 $(CC_PREFIX)$(CC) -o $@ -c $< $(CFLAGS) $(CPPFLAGS)
71 73
74 $(OUT)/gtest-all.o : $(GTEST_DIR)/src/gtest-all.cc
75 @mkdir -p $(OUT)
76 $(CXX_PREFIX)$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) -I$(GTEST_DIR)
77
72 $(OUT)/%.o : src/%.cc 78 $(OUT)/%.o : src/%.cc
73 @mkdir -p $(OUT) 79 @mkdir -p $(OUT)
74 $(CXX_PREFIX)$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS) 80 $(CXX_PREFIX)$(CXX) -o $@ -c $< $(CXXFLAGS) $(CPPFLAGS)
75 81
76 all: $(LIB) $(OUT)/glibc_compat_test
77
78 $(OUT)/libglibc-compat.a: $(OBJS) 82 $(OUT)/libglibc-compat.a: $(OBJS)
79 $(AR_PREFIX)$(AR) rcs $@ $^ 83 $(AR_PREFIX)$(AR) rcs $@ $^
80 84
81 TEST_LIBS=$(LIB) -lgtest -lpthread 85 TEST_LIBS=$(LIB) $(OUT)/gtest-all.o -lpthread
82 86
83 $(OUT)/glibc_compat_test: $(OUT)/test.o $(LIB) 87 $(OUT)/glibc_compat_test: $(OUT)/test.o $(OUT)/gtest-all.o $(LIB)
84 @mkdir -p $(OUT) 88 @mkdir -p $(OUT)
85 » $(CXX_PREFIX)$(CXX) -o $@ $< -L$(OUT) $(LDFLAGS) $(TEST_LIBS) 89 » $(CXX_PREFIX)$(CXX) -o $@ $^ -L$(OUT) $(LDFLAGS) -pthread
86 90
87 test: $(OUT)/glibc_compat_test 91 test: $(OUT)/glibc_compat_test
88 92
89 clean: 93 clean:
90 rm -rf $(OUT) 94 rm -rf $(OUT)
91 95
92 .PHONY: test clean all 96 .PHONY: test clean all
OLDNEW
« no previous file with comments | « ports/devenv/pkg_info ('k') | ports/glibc-compat/build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698