1# Copyright 2015 The Weave 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.
4
5###
6# third_party/chromium/
7
8third_party_chromium_base_obj_files := $(THIRD_PARTY_CHROMIUM_BASE_SRC_FILES:%.cc=out/$(BUILD_MODE)/%.o)
9
10$(third_party_chromium_base_obj_files) : out/$(BUILD_MODE)/%.o : %.cc
11	mkdir -p $(dir $@)
12	$(CXX) $(DEFS_$(BUILD_MODE)) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $<
13
14third_party_chromium_base_unittest_obj_files := $(THIRD_PARTY_CHROMIUM_BASE_UNITTEST_SRC_FILES:%.cc=out/$(BUILD_MODE)/%.o)
15
16$(third_party_chromium_base_unittest_obj_files) : out/$(BUILD_MODE)/%.o : %.cc third_party/include/gtest/gtest.h
17	mkdir -p $(dir $@)
18	$(CXX) $(DEFS_TEST) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $<
19
20third_party_chromium_crypto_obj_files := $(THIRD_PARTY_CHROMIUM_CRYPTO_SRC_FILES:%.cc=out/$(BUILD_MODE)/%.o)
21
22$(third_party_chromium_crypto_obj_files) : out/$(BUILD_MODE)/%.o : %.cc
23	mkdir -p $(dir $@)
24	$(CXX) $(DEFS_$(BUILD_MODE)) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $<
25
26third_party_chromium_crypto_unittest_obj_files := $(THIRD_PARTY_CHROMIUM_CRYPTO_UNITTEST_SRC_FILES:%.cc=out/$(BUILD_MODE)/%.o)
27
28$(third_party_chromium_crypto_unittest_obj_files) : out/$(BUILD_MODE)/%.o : %.cc third_party/include/gtest/gtest.h
29	mkdir -p $(dir $@)
30	$(CXX) $(DEFS_TEST) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $<
31
32###
33# third_party/modp_b64/
34
35third_party_modp_b64_obj_files := $(THIRD_PARTY_MODP_B64_SRC_FILES:%.cc=out/$(BUILD_MODE)/%.o)
36
37$(third_party_modp_b64_obj_files) : out/$(BUILD_MODE)/%.o : %.cc
38	mkdir -p $(dir $@)
39	$(CXX) $(DEFS_$(BUILD_MODE)) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_CC) -c -o $@ $<
40
41###
42# third_party/libuweave/
43
44third_party_libuweave_obj_files := $(THIRD_PARTY_LIBUWEAVE_SRC_FILES:%.c=out/$(BUILD_MODE)/%.o)
45
46$(third_party_libuweave_obj_files) : out/$(BUILD_MODE)/%.o : %.c
47	mkdir -p $(dir $@)
48	$(CC) $(DEFS_$(BUILD_MODE)) $(INCLUDES) $(CFLAGS) $(CFLAGS_$(BUILD_MODE)) $(CFLAGS_C) -c -o $@ $<
49
50###
51# libgtest and libgmock (third_party, downloaded on build)
52
53third_party/lib/gtest.a: third_party/include/gtest/gtest.h
54third_party/lib/gmock.a: third_party/include/gtest/gtest.h
55
56third_party/include/gtest/gtest.h:
57	@echo Downloading and building libgtest and libgmock...
58	third_party/get_gtest.sh
59	@echo Finished downloading and building libgtest and libgmock.
60
61clean-gtest :
62	rm -rf third_party/include/gtest third_party/include/gmock
63	rm -rf third_party/lib/libgmock* third_party/lib/libgtest*
64	rm -rf third_party/googletest
65
66###
67# libevhtp (third_party, downloaded on build)
68
69third_party/lib/libevhtp.a : third_party/include/evhtp.h
70third_party/include/evhtp.h :
71	@echo Downloading and building libevhtp...
72	third_party/get_libevhtp.sh
73	@echo Finished downloading and building libevhtp.
74
75clean-libevhtp :
76	rm -rf third_party/include/evhtp.h third_party/include/evhtp-config.h third_party/include/evthr.h third_party/include/htparse.h
77	rm -rf third_party/lib/libevhtp.a
78	rm -rf third_party/libevhtp
79