forked from dcos/dcos-mesos-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
235 lines (187 loc) · 6.65 KB
/
Makefile.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
AUTOMAKE_OPTIONS = subdir-objects
ACLOCAL_AMFLAGS = -I m4
if SOURCE_PROVIDED
# Render path to Mesos bundled gmock.
BUNDLE_SUBDIR = 3rdparty
include $(MESOS_ROOT)/$(BUNDLE_SUBDIR)/versions.am
GMOCK = $(MESOS_BUILD_DIR)/$(BUNDLE_SUBDIR)/gmock-$(GMOCK_VERSION)
GTEST = $(GMOCK)/gtest
ZOOKEEPER = $(MESOS_BUILD_DIR)/$(BUNDLE_SUBDIR)/zookeeper-$(ZOOKEEPER_VERSION)/src/c
endif
# We want to install modules in mesos directory.
pkglibdir = $(libdir)/mesos
# Initialize variables here so we can use += operator everywhere else.
pkglib_LTLIBRARIES =
bin_PROGRAMS =
BUILT_SOURCES =
CLEANFILES =
# Add compiler and linker flags for pthreads.
AM_CXXFLAGS = $(PTHREAD_CFLAGS)
AM_LIBS = $(PTHREAD_LIBS)
# Add top-level include dir to our include path.
MESOS_CPPFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/src -Iinclude -I$(top_srcdir)
# Setup CPPFLAGS that are used for most source files.
AM_CPPFLAGS = $(MESOS_CPPFLAGS) -Wall -Werror
# Setup the protobuf compiler.
PROTOC = @PROTOCOMPILER@
PROTOCFLAGS = -I$(srcdir)
if SOURCE_PROVIDED
PROTOCFLAGS += -I$(MESOS_ROOT)/include
endif
###############################################################################
# Dockercfg Remover Hook.
###############################################################################
# Library with the .dockercfg remover hook.
pkglib_LTLIBRARIES += libremovedockercfg.la
libremovedockercfg_la_SOURCES = \
dockercfg/remover.cpp
libremovedockercfg_la_LDFLAGS = \
-release $(PACKAGE_VERSION) \
-shared $(MESOS_LDFLAGS)
###############################################################################
# Journald ContainerLogger Module.
###############################################################################
# Library with the ContainerLogger module.
pkglib_LTLIBRARIES += libjournaldlogger.la
libjournaldlogger_la_SOURCES = \
journald/journald.hpp \
journald/lib_journald.hpp \
journald/lib_journald.cpp
libjournaldlogger_la_LDFLAGS = \
-release $(PACKAGE_VERSION) \
-shared $(MESOS_LDFLAGS)
# Companion binary for the ContainerLogger module.
bin_PROGRAMS += mesos-journald-logger
mesos_journald_logger_SOURCES = \
journald/journald.hpp \
journald/journald.cpp
SYSTEMD_JOURNALD = `pkg-config --cflags --libs libsystemd`
mesos_journald_logger_LDFLAGS = \
$(MESOS_LDFLAGS) \
$(SYSTEMD_JOURNALD)
###############################################################################
# LogSink Anonymous Module.
###############################################################################
# Library with the LogSink module.
pkglib_LTLIBRARIES += liblogsink.la
liblogsink_la_SOURCES = \
logsink/logsink.hpp \
logsink/logsink.cpp
liblogsink_la_LDFLAGS = \
-release $(PACKAGE_VERSION) \
-shared $(MESOS_LDFLAGS)
###############################################################################
# Overlay Modules.
###############################################################################
OVERLAY_PROTOS = \
overlay/overlay.pb.cc \
overlay/overlay.pb.h \
overlay/messages.pb.cc \
overlay/messages.pb.h
# Targets for generating C++ protocol buffer code.
overlay/%.pb.cc overlay/%.pb.h: $(top_srcdir)/overlay/%.proto
$(PROTOC) $(PROTOCFLAGS) --cpp_out=. $^
BUILT_SOURCES += $(OVERLAY_PROTOS)
CLEANFILES += $(OVERLAY_PROTOS)
# Library with both master and agent anonymous modules.
pkglib_LTLIBRARIES += libmesos_network_overlay.la
libmesos_network_overlay_la_SOURCES = \
overlay/agent.cpp \
overlay/master.cpp \
${OVERLAY_PROTOS}
libmesos_network_overlay_la_LDFLAGS = \
-release $(PACKAGE_VERSION) \
-shared $(MESOS_LDFLAGS)
###############################################################################
# Unit tests.
###############################################################################
if SOURCE_PROVIDED
check_PROGRAMS=
pkglib_LTLIBRARIES += libmesos_tests.la
libmesos_tests_la_SOURCES = \
tests/main.cpp \
tests/cluster.cpp \
tests/containerizer.cpp \
tests/environment.cpp \
tests/flags.cpp \
tests/mesos.cpp \
tests/module.cpp \
tests/mock_registrar.cpp \
tests/script.cpp \
tests/utils.cpp \
tests/containerizer/launcher.cpp \
tests/containerizer/memory_test_helper.cpp
# Additional flags needed to build the Mesos test helpers.
libmesos_tests_la_CPPFLAGS = \
-I$(MESOS_BUILD_DIR)/include/mesos \
-I$(ZOOKEEPER)/include \
-I$(ZOOKEEPER)/generated \
-isystem $(GMOCK)/include \
-I$(GTEST)/include \
-DMODULES_BUILD_DIR=\"$(abs_top_builddir)\" \
-DSOURCE_DIR=\"$(MESOS_ROOT)\" \
-DBUILD_DIR=\"$(MESOS_BUILD_DIR)\" \
-DPKGMODULEDIR=\"nowhere\" \
-DLIBDIR=\"nowhere\" \
-DPKGLIBEXECDIR=\"nowhere\" \
-DTESTLIBEXECDIR=\"nowhere\" \
-DSBINDIR=\"nowhere\" \
-DPKGDATADIR=\"nowhere\" \
$(AM_CPPFLAGS)
libmesos_tests_la_LDFLAGS = \
-release $(PACKAGE_VERSION) \
-shared $(MESOS_LDFLAGS)
# Test (make check) binary for the dockercfg hook.
check_PROGRAMS += test-dockercfg
test_dockercfg_SOURCES = \
tests/dockercfg_tests.cpp
test_dockercfg_CPPFLAGS = \
$(libmesos_tests_la_CPPFLAGS)
test_dockercfg_LDADD = \
$(MESOS_LDFLAGS) \
$(MESOS_BUILD_DIR)/$(BUNDLE_SUBDIR)/.libs/libgmock.la \
$(MESOS_BUILD_DIR)/src/.libs/libmesos.la \
libmesos_tests.la \
libremovedockercfg.la
# Test (make check) binary for the journald module.
check_PROGRAMS += test-journald
test_journald_SOURCES = \
tests/journald_tests.cpp
test_journald_CPPFLAGS = \
$(libmesos_tests_la_CPPFLAGS)
test_journald_LDADD = \
$(MESOS_LDFLAGS) \
$(MESOS_BUILD_DIR)/$(BUNDLE_SUBDIR)/.libs/libgmock.la \
$(MESOS_BUILD_DIR)/src/.libs/libmesos.la \
libmesos_tests.la \
libjournaldlogger.la
# Test (make check) binary for the LogSink module.
check_PROGRAMS += test-logsink
test_logsink_SOURCES = \
tests/logsink_tests.cpp
test_logsink_CPPFLAGS = \
$(libmesos_tests_la_CPPFLAGS)
test_logsink_LDADD = \
$(MESOS_LDFLAGS) \
$(MESOS_BUILD_DIR)/$(BUNDLE_SUBDIR)/.libs/libgmock.la \
$(MESOS_BUILD_DIR)/src/.libs/libmesos.la \
libmesos_tests.la \
liblogsink.la
# Test (make check) binary for the overlay modules.
check_PROGRAMS += test-overlay
test_overlay_SOURCES = \
tests/overlay_tests.cpp
test_overlay_CPPFLAGS = \
$(libmesos_tests_la_CPPFLAGS)
test_overlay_LDADD = \
$(MESOS_LDFLAGS) \
$(MESOS_BUILD_DIR)/$(BUNDLE_SUBDIR)/.libs/libgmock.la \
$(MESOS_BUILD_DIR)/src/.libs/libmesos.la \
libmesos_tests.la \
libmesos_network_overlay.la
endif
check-local: $(check_PROGRAMS)
./test-dockercfg
./test-journald --verbose
./test-logsink --verbose
LIBPROCESS_IP=127.0.0.1 LIBPROCESS_PORT=5050 ./test-overlay --verbose