Jorge Lucangeli Obes | fc8ab53 | 2012-03-20 10:14:31 -0700 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
Elly Jones | cd7a904 | 2011-07-22 13:56:51 -0400 | [diff] [blame] | 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
Kees Cook | ddb7970 | 2017-04-12 16:36:45 -0700 | [diff] [blame] | 5 | BASE_VER=0 |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 6 | include common.mk |
| 7 | |
Luis Hector Chavez | f6423bb | 2018-10-05 14:20:29 -0700 | [diff] [blame] | 8 | LIBDIR ?= /lib |
Jorge Lucangeli Obes | df4bd35 | 2012-08-29 19:12:28 -0700 | [diff] [blame] | 9 | PRELOADNAME = libminijailpreload.so |
Luis Hector Chavez | f6423bb | 2018-10-05 14:20:29 -0700 | [diff] [blame] | 10 | PRELOADPATH = \"$(LIBDIR)/$(PRELOADNAME)\" |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 11 | CPPFLAGS += -DPRELOADPATH="$(PRELOADPATH)" |
Elly Jones | cd7a904 | 2011-07-22 13:56:51 -0400 | [diff] [blame] | 12 | |
Lei Zhang | eee3155 | 2012-10-17 21:27:10 -0700 | [diff] [blame] | 13 | ifneq ($(HAVE_SECUREBITS_H),no) |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 14 | CPPFLAGS += -DHAVE_SECUREBITS_H |
Lei Zhang | eee3155 | 2012-10-17 21:27:10 -0700 | [diff] [blame] | 15 | endif |
Jorge Lucangeli Obes | 6a600a4 | 2017-04-07 15:53:06 -0400 | [diff] [blame] | 16 | |
| 17 | ifeq ($(USE_seccomp),no) |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 18 | CPPFLAGS += -DUSE_SECCOMP_SOFTFAIL |
Utkarsh Sanghi | 0ef8a66 | 2014-08-18 15:50:11 -0700 | [diff] [blame] | 19 | endif |
Lei Zhang | eee3155 | 2012-10-17 21:27:10 -0700 | [diff] [blame] | 20 | |
Mike Frysinger | 916c6c3 | 2018-09-27 14:17:53 -0400 | [diff] [blame] | 21 | # Allow people to use -L and related flags. |
| 22 | ALLOW_DEBUG_LOGGING ?= yes |
| 23 | ifeq ($(ALLOW_DEBUG_LOGGING),yes) |
| 24 | CPPFLAGS += -DALLOW_DEBUG_LOGGING |
| 25 | endif |
| 26 | |
Luis Hector Chavez | daa0371 | 2017-09-06 08:10:33 -0700 | [diff] [blame] | 27 | ifeq ($(USE_ASAN),yes) |
| 28 | CPPFLAGS += -fsanitize=address |
| 29 | LDFLAGS += -fsanitize=address |
| 30 | USE_EXIT_ON_DIE = yes |
| 31 | endif |
| 32 | |
| 33 | # Setting this flag can be useful for both AddressSanitizer builds and running |
| 34 | # fuzzing tools, which do not expect crashes on gracefully-handled malformed |
| 35 | # inputs. |
| 36 | ifeq ($(USE_EXIT_ON_DIE),yes) |
| 37 | CPPFLAGS += -DUSE_EXIT_ON_DIE |
| 38 | endif |
| 39 | |
Mike Frysinger | e131e13 | 2017-10-04 13:27:55 -0400 | [diff] [blame] | 40 | MJ_COMMON_FLAGS = -Wunused-parameter -Wextra -Wno-missing-field-initializers |
| 41 | CFLAGS += $(MJ_COMMON_FLAGS) |
| 42 | CXXFLAGS += $(MJ_COMMON_FLAGS) |
Jorge Lucangeli Obes | ce2c3ff | 2017-02-01 18:04:36 -0500 | [diff] [blame] | 43 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 44 | USE_SYSTEM_GTEST ?= no |
| 45 | ifeq ($(USE_SYSTEM_GTEST),no) |
Mike Frysinger | e1f046a | 2017-10-04 13:27:18 -0400 | [diff] [blame] | 46 | GTEST_CXXFLAGS := -std=gnu++14 |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 47 | GTEST_LIBS := gtest.a |
| 48 | else |
Luis Hector Chavez | 9131f6c | 2017-09-15 13:31:09 -0700 | [diff] [blame] | 49 | GTEST_CXXFLAGS := $(shell gtest-config --cxxflags) |
| 50 | GTEST_LIBS := $(shell gtest-config --libs) |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 51 | endif |
| 52 | |
Jorge Lucangeli Obes | 0b20877 | 2017-04-19 14:15:46 -0400 | [diff] [blame] | 53 | CORE_OBJECT_FILES := libminijail.o syscall_filter.o signal_handler.o \ |
| 54 | bpf.o util.o system.o syscall_wrapper.o \ |
| 55 | libconstants.gen.o libsyscalls.gen.o |
| 56 | |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 57 | all: CC_BINARY(minijail0) CC_LIBRARY(libminijail.so) \ |
Zach Reizner | 2a93cee | 2019-02-01 15:13:09 -0800 | [diff] [blame^] | 58 | CC_LIBRARY(libminijailpreload.so) |
Elly Jones | cd7a904 | 2011-07-22 13:56:51 -0400 | [diff] [blame] | 59 | |
Jorge Lucangeli Obes | f16d6d1 | 2016-09-29 20:25:27 -0400 | [diff] [blame] | 60 | parse_seccomp_policy: CXX_BINARY(parse_seccomp_policy) |
Luis Hector Chavez | f7b2018 | 2018-10-28 21:39:32 -0700 | [diff] [blame] | 61 | dump_constants: CXX_BINARY(dump_constants) |
Jorge Lucangeli Obes | f16d6d1 | 2016-09-29 20:25:27 -0400 | [diff] [blame] | 62 | |
Jorge Lucangeli Obes | e0c5a76 | 2017-02-02 15:17:08 -0500 | [diff] [blame] | 63 | tests: TEST(CXX_BINARY(libminijail_unittest)) \ |
Mike Frysinger | 4d2a81e | 2018-01-22 16:43:33 -0500 | [diff] [blame] | 64 | TEST(CXX_BINARY(minijail0_cli_unittest)) \ |
Mike Frysinger | 0b5cffa | 2017-08-15 18:06:18 -0400 | [diff] [blame] | 65 | TEST(CXX_BINARY(syscall_filter_unittest)) \ |
Mike Frysinger | 32c3992 | 2018-01-17 17:09:54 -0500 | [diff] [blame] | 66 | TEST(CXX_BINARY(system_unittest)) \ |
| 67 | TEST(CXX_BINARY(util_unittest)) \ |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 68 | |
Will Drewry | 6ac9112 | 2011-10-21 16:38:58 -0500 | [diff] [blame] | 69 | |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 70 | CC_BINARY(minijail0): LDLIBS += -lcap -ldl |
Mike Frysinger | 5ef22ca | 2018-01-20 13:42:10 -0500 | [diff] [blame] | 71 | CC_BINARY(minijail0): $(CORE_OBJECT_FILES) \ |
| 72 | elfparse.o minijail0.o minijail0_cli.o |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 73 | clean: CLEAN(minijail0) |
Elly Jones | cd7a904 | 2011-07-22 13:56:51 -0400 | [diff] [blame] | 74 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 75 | |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 76 | CC_LIBRARY(libminijail.so): LDLIBS += -lcap |
Jorge Lucangeli Obes | 0b20877 | 2017-04-19 14:15:46 -0400 | [diff] [blame] | 77 | CC_LIBRARY(libminijail.so): $(CORE_OBJECT_FILES) |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 78 | clean: CLEAN(libminijail.so) |
Ben Chan | 4539701 | 2011-08-23 08:15:03 -0700 | [diff] [blame] | 79 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 80 | |
| 81 | CXX_BINARY(libminijail_unittest): CXXFLAGS += -Wno-write-strings \ |
| 82 | $(GTEST_CXXFLAGS) |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 83 | CXX_BINARY(libminijail_unittest): LDLIBS += -lcap $(GTEST_LIBS) |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 84 | ifeq ($(USE_SYSTEM_GTEST),no) |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 85 | CXX_BINARY(libminijail_unittest): $(GTEST_LIBS) |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 86 | endif |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 87 | CXX_BINARY(libminijail_unittest): libminijail_unittest.o $(CORE_OBJECT_FILES) \ |
| 88 | testrunner.o |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 89 | clean: CLEAN(libminijail_unittest) |
Will Drewry | decdfdc | 2011-09-27 15:13:54 -0500 | [diff] [blame] | 90 | |
Luis Hector Chavez | 9acba45 | 2018-10-11 10:13:25 -0700 | [diff] [blame] | 91 | TEST(CXX_BINARY(libminijail_unittest)): CC_LIBRARY(libminijailpreload.so) |
| 92 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 93 | |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 94 | CC_LIBRARY(libminijailpreload.so): LDLIBS += -lcap -ldl |
Jorge Lucangeli Obes | 0b20877 | 2017-04-19 14:15:46 -0400 | [diff] [blame] | 95 | CC_LIBRARY(libminijailpreload.so): libminijailpreload.o $(CORE_OBJECT_FILES) |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 96 | clean: CLEAN(libminijailpreload.so) |
Elly Jones | cd7a904 | 2011-07-22 13:56:51 -0400 | [diff] [blame] | 97 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 98 | |
Mike Frysinger | 4d2a81e | 2018-01-22 16:43:33 -0500 | [diff] [blame] | 99 | CXX_BINARY(minijail0_cli_unittest): CXXFLAGS += $(GTEST_CXXFLAGS) |
| 100 | CXX_BINARY(minijail0_cli_unittest): LDLIBS += -lcap $(GTEST_LIBS) |
| 101 | ifeq ($(USE_SYSTEM_GTEST),no) |
| 102 | CXX_BINARY(minijail0_cli_unittest): $(GTEST_LIBS) |
| 103 | endif |
| 104 | CXX_BINARY(minijail0_cli_unittest): minijail0_cli_unittest.o \ |
| 105 | $(CORE_OBJECT_FILES) minijail0_cli.o elfparse.o testrunner.o |
| 106 | clean: CLEAN(minijail0_cli_unittest) |
| 107 | |
| 108 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 109 | CXX_BINARY(syscall_filter_unittest): CXXFLAGS += -Wno-write-strings \ |
| 110 | $(GTEST_CXXFLAGS) |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 111 | CXX_BINARY(syscall_filter_unittest): LDLIBS += -lcap $(GTEST_LIBS) |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 112 | ifeq ($(USE_SYSTEM_GTEST),no) |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 113 | CXX_BINARY(syscall_filter_unittest): $(GTEST_LIBS) |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 114 | endif |
| 115 | CXX_BINARY(syscall_filter_unittest): syscall_filter_unittest.o \ |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 116 | $(CORE_OBJECT_FILES) testrunner.o |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 117 | clean: CLEAN(syscall_filter_unittest) |
Jorge Lucangeli Obes | fc8ab53 | 2012-03-20 10:14:31 -0700 | [diff] [blame] | 118 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 119 | |
Mike Frysinger | 0b5cffa | 2017-08-15 18:06:18 -0400 | [diff] [blame] | 120 | CXX_BINARY(system_unittest): CXXFLAGS += $(GTEST_CXXFLAGS) |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 121 | CXX_BINARY(system_unittest): LDLIBS += -lcap $(GTEST_LIBS) |
Mike Frysinger | 0b5cffa | 2017-08-15 18:06:18 -0400 | [diff] [blame] | 122 | ifeq ($(USE_SYSTEM_GTEST),no) |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 123 | CXX_BINARY(system_unittest): $(GTEST_LIBS) |
Mike Frysinger | 0b5cffa | 2017-08-15 18:06:18 -0400 | [diff] [blame] | 124 | endif |
Luis Hector Chavez | 114a930 | 2017-09-05 20:36:58 -0700 | [diff] [blame] | 125 | CXX_BINARY(system_unittest): system_unittest.o \ |
| 126 | $(CORE_OBJECT_FILES) testrunner.o |
Mike Frysinger | 0b5cffa | 2017-08-15 18:06:18 -0400 | [diff] [blame] | 127 | clean: CLEAN(system_unittest) |
| 128 | |
| 129 | |
Mike Frysinger | 32c3992 | 2018-01-17 17:09:54 -0500 | [diff] [blame] | 130 | CXX_BINARY(util_unittest): CXXFLAGS += $(GTEST_CXXFLAGS) |
| 131 | CXX_BINARY(util_unittest): LDLIBS += -lcap $(GTEST_LIBS) |
| 132 | ifeq ($(USE_SYSTEM_GTEST),no) |
| 133 | CXX_BINARY(util_unittest): $(GTEST_LIBS) |
| 134 | endif |
| 135 | CXX_BINARY(util_unittest): util_unittest.o \ |
| 136 | $(CORE_OBJECT_FILES) testrunner.o |
| 137 | clean: CLEAN(util_unittest) |
| 138 | |
| 139 | |
Jorge Lucangeli Obes | f16d6d1 | 2016-09-29 20:25:27 -0400 | [diff] [blame] | 140 | CXX_BINARY(parse_seccomp_policy): parse_seccomp_policy.o syscall_filter.o \ |
| 141 | bpf.o util.o libconstants.gen.o libsyscalls.gen.o |
Jorge Lucangeli Obes | a1f4e0a | 2017-09-05 10:06:55 -0400 | [diff] [blame] | 142 | clean: CLEAN(parse_seccomp_policy) |
Jorge Lucangeli Obes | f16d6d1 | 2016-09-29 20:25:27 -0400 | [diff] [blame] | 143 | |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 144 | |
Luis Hector Chavez | f7b2018 | 2018-10-28 21:39:32 -0700 | [diff] [blame] | 145 | CXX_BINARY(dump_constants): dump_constants.o \ |
| 146 | libconstants.gen.o libsyscalls.gen.o |
| 147 | clean: CLEAN(dump_constants) |
| 148 | |
| 149 | |
| 150 | constants.json: CXX_BINARY(dump_constants) |
| 151 | ./dump_constants > $@ |
| 152 | clean: CLEANFILE(constants.json) |
| 153 | |
| 154 | |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 155 | libsyscalls.gen.o: CPPFLAGS += -I$(SRC) |
Jorge Lucangeli Obes | fc8ab53 | 2012-03-20 10:14:31 -0700 | [diff] [blame] | 156 | |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 157 | libsyscalls.gen.o.depends: libsyscalls.gen.c |
Lee Campbell | 1e4fc6a | 2014-06-06 17:40:02 -0700 | [diff] [blame] | 158 | |
Will Drewry | 32ac9f5 | 2011-08-18 21:36:27 -0500 | [diff] [blame] | 159 | # Only regenerate libsyscalls.gen.c if the Makefile or header changes. |
| 160 | # NOTE! This will not detect if the file is not appropriate for the target. |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 161 | libsyscalls.gen.c: $(SRC)/Makefile $(SRC)/libsyscalls.h |
Jorge Lucangeli Obes | ae57f09 | 2016-11-23 15:04:55 -0500 | [diff] [blame] | 162 | @printf "Generating target-arch specific $@...\n" |
Dan Willemsen | 2acbec5 | 2017-09-14 17:28:36 -0700 | [diff] [blame] | 163 | $(QUIET)CC="$(CC)" $(SRC)/gen_syscalls.sh "$@" |
Jorge Lucangeli Obes | ae57f09 | 2016-11-23 15:04:55 -0500 | [diff] [blame] | 164 | @printf "$@ done.\n" |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 165 | clean: CLEAN(libsyscalls.gen.c) |
Will Drewry | 32ac9f5 | 2011-08-18 21:36:27 -0500 | [diff] [blame] | 166 | |
Jorge Lucangeli Obes | bc9dc1c | 2014-08-25 09:12:36 -0700 | [diff] [blame] | 167 | $(eval $(call add_object_rules,libsyscalls.gen.o,CC,c,CFLAGS)) |
Luis Hector Chavez | 40b2574 | 2013-09-22 19:44:06 -0700 | [diff] [blame] | 168 | |
| 169 | libconstants.gen.o: CPPFLAGS += -I$(SRC) |
| 170 | |
| 171 | libconstants.gen.o.depends: libconstants.gen.c |
| 172 | |
| 173 | # Only regenerate libconstants.gen.c if the Makefile or header changes. |
| 174 | # NOTE! This will not detect if the file is not appropriate for the target. |
Luis Hector Chavez | 40b2574 | 2013-09-22 19:44:06 -0700 | [diff] [blame] | 175 | libconstants.gen.c: $(SRC)/Makefile $(SRC)/libconstants.h |
Jorge Lucangeli Obes | ae57f09 | 2016-11-23 15:04:55 -0500 | [diff] [blame] | 176 | @printf "Generating target-arch specific $@...\n" |
Dan Willemsen | 2acbec5 | 2017-09-14 17:28:36 -0700 | [diff] [blame] | 177 | $(QUIET)CC="$(CC)" $(SRC)/gen_constants.sh "$@" |
Jorge Lucangeli Obes | ae57f09 | 2016-11-23 15:04:55 -0500 | [diff] [blame] | 178 | @printf "$@ done.\n" |
Luis Hector Chavez | 40b2574 | 2013-09-22 19:44:06 -0700 | [diff] [blame] | 179 | clean: CLEAN(libconstants.gen.c) |
| 180 | |
| 181 | $(eval $(call add_object_rules,libconstants.gen.o,CC,c,CFLAGS)) |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 182 | |
| 183 | |
| 184 | ################################################################################ |
| 185 | # Google Test |
| 186 | |
| 187 | ifeq ($(USE_SYSTEM_GTEST),no) |
| 188 | # Points to the root of Google Test, relative to where this file is. |
| 189 | # Remember to tweak this if you move this file. |
| 190 | GTEST_DIR = googletest-release-1.8.0/googletest |
| 191 | |
| 192 | # Flags passed to the preprocessor. |
| 193 | # Set Google Test's header directory as a system directory, such that |
| 194 | # the compiler doesn't generate warnings in Google Test headers. |
| 195 | CPPFLAGS += -isystem $(GTEST_DIR)/include |
| 196 | |
| 197 | # Flags passed to the C++ compiler. |
Jorge Lucangeli Obes | e0c5a76 | 2017-02-02 15:17:08 -0500 | [diff] [blame] | 198 | GTEST_CXXFLAGS += -pthread |
Jorge Lucangeli Obes | 9bd316b | 2017-01-26 17:21:16 -0500 | [diff] [blame] | 199 | |
| 200 | # All Google Test headers. Usually you shouldn't change this |
| 201 | # definition. |
| 202 | GTEST_HEADERS = $(GTEST_DIR)/include/gtest/*.h \ |
| 203 | $(GTEST_DIR)/include/gtest/internal/*.h |
| 204 | |
| 205 | # House-keeping build targets. |
| 206 | clean: clean_gtest |
| 207 | |
| 208 | clean_gtest: |
| 209 | rm -f gtest.a gtest_main.a *.o |
| 210 | |
| 211 | # Builds gtest.a and gtest_main.a. |
| 212 | |
| 213 | # Usually you shouldn't tweak such internal variables, indicated by a |
| 214 | # trailing _. |
| 215 | GTEST_SRCS_ = $(GTEST_DIR)/src/*.cc $(GTEST_DIR)/src/*.h $(GTEST_HEADERS) |
| 216 | |
| 217 | # For simplicity and to avoid depending on Google Test's |
| 218 | # implementation details, the dependencies specified below are |
| 219 | # conservative and not optimized. This is fine as Google Test |
| 220 | # compiles fast and for ordinary users its source rarely changes. |
| 221 | gtest-all.o : $(GTEST_SRCS_) |
| 222 | $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) $(GTEST_CXXFLAGS) -c \ |
| 223 | $(GTEST_DIR)/src/gtest-all.cc -o $@ |
| 224 | |
| 225 | gtest_main.o : $(GTEST_SRCS_) |
| 226 | $(CXX) $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) $(GTEST_CXXFLAGS) -c \ |
| 227 | $(GTEST_DIR)/src/gtest_main.cc -o $@ |
| 228 | |
| 229 | gtest.a : gtest-all.o |
| 230 | $(AR) $(ARFLAGS) $@ $^ |
| 231 | |
| 232 | gtest_main.a : gtest-all.o gtest_main.o |
| 233 | $(AR) $(ARFLAGS) $@ $^ |
| 234 | |
| 235 | endif |
| 236 | ################################################################################ |