1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17tlsdate_tlsdated_sources := \
18    src/conf.c \
19    src/dbus.c \
20    src/events/check_continuity.c \
21    src/events/kickoff_time_sync.c \
22    src/events/route_up.c \
23    src/events/run_tlsdate.c \
24    src/events/save.c \
25    src/events/sigchld.c \
26    src/events/sigterm.c \
27    src/events/time_set.c \
28    src/events/tlsdate_status.c \
29    src/platform-cros.c \
30    src/routeup.c \
31    src/seccomp.c \
32    src/tlsdate-monitor.c \
33    src/tlsdate-setter.c \
34    src/tlsdated.c \
35    src/util.c \
36
37tlsdate_common_shared_libs := libcrypto libdbus libevent
38
39define tlsdate_common
40  LOCAL_CFLAGS += \
41      -DWITH_EVENTS -DHAVE_DBUS -DHAVE_CROS -DHAVE_PV_UIO \
42      -DRECENT_COMPILE_DATE=$$$(BUILD_DATETIME_FROM_FILE)L \
43      -DTARGET_OS_LINUX -Wall -Werror -Wno-unused-parameter
44endef
45
46
47include $(CLEAR_VARS)
48LOCAL_MODULE := tlsdate
49LOCAL_SRC_FILES := src/tlsdate.c
50$(eval $(tlsdate_common))
51include $(BUILD_EXECUTABLE)
52
53
54include $(CLEAR_VARS)
55LOCAL_MODULE := tlsdate-helper
56LOCAL_SRC_FILES := \
57    src/compat/clock-linux.c \
58    src/proxy-bio.c \
59    src/seccomp.c \
60    src/tlsdate-helper.c \
61    src/util.c
62LOCAL_SHARED_LIBRARIES := libcrypto libevent libssl
63$(eval $(tlsdate_common))
64include $(BUILD_EXECUTABLE)
65
66
67include $(CLEAR_VARS)
68LOCAL_MODULE := tlsdate_proxy-bio_unittest
69LOCAL_SRC_FILES := \
70    src/proxy-bio-unittest.c \
71    src/proxy-bio.c \
72    src/seccomp.c \
73    src/test-bio.c \
74    src/util.c
75LOCAL_SHARED_LIBRARIES := $(tlsdate_common_shared_libs)
76$(eval $(tlsdate_common))
77include $(BUILD_NATIVE_TEST)
78
79
80include $(CLEAR_VARS)
81LOCAL_MODULE := tlsdated
82LOCAL_INIT_RC := init/tlsdated.rc
83LOCAL_REQUIRED_MODULES := tlsdated.rc
84LOCAL_SRC_FILES := $(tlsdate_tlsdated_sources)
85LOCAL_CFLAGS := -DTLSDATED_MAIN
86LOCAL_SHARED_LIBRARIES := $(tlsdate_common_shared_libs)
87$(eval $(tlsdate_common))
88include $(BUILD_EXECUTABLE)
89
90
91include $(CLEAR_VARS)
92LOCAL_MODULE := tlsdated_unittest
93LOCAL_SRC_FILES := \
94    src/tlsdated-unittest.c \
95    $(tlsdate_tlsdated_sources)
96LOCAL_SHARED_LIBRARIES := $(tlsdate_common_shared_libs)
97$(eval $(tlsdate_common))
98include $(BUILD_NATIVE_TEST)
99