1# Makefile.am for the traffic/iocore/cache hierarchy
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#      http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing, software
14#  distributed under the License is distributed on an "AS IS" BASIS,
15#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16#  See the License for the specific language governing permissions and
17#  limitations under the License.
18
19AM_CPPFLAGS += \
20	$(iocore_include_dirs) \
21	-I$(abs_top_srcdir)/include \
22	-I$(abs_top_srcdir)/lib \
23	-I$(abs_top_srcdir)/proxy \
24	-I$(abs_top_srcdir)/proxy/hdrs \
25	-I$(abs_top_srcdir)/proxy/http \
26	-I$(abs_top_srcdir)/proxy/shared \
27	-I$(abs_top_srcdir)/proxy/http/remap \
28	-I$(abs_top_srcdir)/mgmt \
29	-I$(abs_top_srcdir)/mgmt/utils \
30	$(TS_INCLUDES)
31
32noinst_LIBRARIES = libinkcache.a
33
34libinkcache_a_SOURCES = \
35	Cache.cc \
36	CacheDir.cc \
37	CacheDisk.cc \
38	CacheHosting.cc \
39	CacheHttp.cc \
40	CacheLink.cc \
41	CachePages.cc \
42	CachePagesInternal.cc \
43	CacheRead.cc \
44	CacheVol.cc \
45	CacheWrite.cc \
46	I_Cache.h \
47	I_CacheDefs.h \
48	I_Store.h \
49	Inline.cc \
50	P_Cache.h \
51	P_CacheArray.h \
52	P_CacheDir.h \
53	P_CacheDisk.h \
54	P_CacheHosting.h \
55	P_CacheHttp.h \
56	P_CacheInternal.h \
57	P_CacheVol.h \
58	P_RamCache.h \
59	RamCacheCLFUS.cc \
60	RamCacheLRU.cc \
61	Store.cc
62
63if BUILD_TESTS
64libinkcache_a_SOURCES += \
65	CacheTest.cc \
66	P_CacheTest.h
67endif
68
69TESTS = $(check_PROGRAMS)
70
71test_CPPFLAGS = \
72	$(AM_CPPFLAGS) \
73	$(iocore_include_dirs) \
74	-I$(abs_top_srcdir)/include \
75	-I$(abs_top_srcdir)/lib \
76	-I$(abs_top_srcdir)/proxy \
77	-I$(abs_top_srcdir)/proxy/http \
78	-I$(abs_top_srcdir)/proxy/http2 \
79	-I$(abs_top_srcdir)/proxy/http3 \
80	-I$(abs_top_srcdir)/proxy/logging \
81	-I$(abs_top_srcdir)/proxy/http/remap \
82	-I$(abs_top_srcdir)/proxy/hdrs \
83	-I$(abs_top_srcdir)/proxy/shared \
84	-I$(abs_top_srcdir)/mgmt \
85	-I$(abs_top_srcdir)/mgmt/utils \
86	-I$(abs_top_srcdir)/tests/include \
87	$(TS_INCLUDES) \
88	@OPENSSL_INCLUDES@
89
90test_LDADD = \
91	$(top_builddir)/src/tscpp/util/libtscpputil.la \
92	$(top_builddir)/iocore/cache/libinkcache.a \
93	$(top_builddir)/proxy/libproxy.a \
94	$(top_builddir)/proxy/http/libhttp.a \
95	$(top_builddir)/proxy/http/remap/libhttp_remap.a \
96	$(top_builddir)/proxy/libproxy.a \
97	$(top_builddir)/iocore/net/libinknet.a \
98	$(top_builddir)/iocore/dns/libinkdns.a \
99	$(top_builddir)/iocore/hostdb/libinkhostdb.a \
100	$(top_builddir)/proxy/logging/liblogging.a \
101	$(top_builddir)/proxy/hdrs/libhdrs.a \
102	$(top_builddir)/proxy/shared/libdiagsconfig.a \
103	$(top_builddir)/mgmt/libmgmt_p.la \
104	$(top_builddir)/iocore/utils/libinkutils.a \
105	$(top_builddir)/iocore/aio/libinkaio.a \
106	$(top_builddir)/src/tscore/libtscore.la \
107	$(top_builddir)/lib/records/librecords_p.a \
108	$(top_builddir)/iocore/eventsystem/libinkevent.a \
109	@HWLOC_LIBS@ \
110	@LIBPCRE@ \
111	@LIBRESOLV@ \
112	@LIBZ@ \
113	@LIBLZMA@ \
114	@LIBPROFILER@ \
115	@OPENSSL_LIBS@ \
116	@YAMLCPP_LIBS@ \
117	-lm
118
119if EXPENSIVE_TESTS
120check_PROGRAMS = \
121  test_Cache \
122  test_RWW \
123  test_Alternate_L_to_S \
124  test_Alternate_S_to_L \
125  test_Alternate_L_to_S_remove_L \
126  test_Alternate_L_to_S_remove_S \
127  test_Alternate_S_to_L_remove_S \
128  test_Alternate_S_to_L_remove_L \
129  test_Update_L_to_S \
130  test_Update_S_to_L \
131  test_Update_header
132endif
133
134test_main_SOURCES = \
135  ./test/main.cc \
136  ./test/stub.cc \
137  ./test/CacheTestHandler.cc
138
139test_Cache_CPPFLAGS = $(test_CPPFLAGS)
140test_Cache_LDFLAGS = @AM_LDFLAGS@
141test_Cache_LDADD = $(test_LDADD)
142test_Cache_SOURCES = \
143  $(test_main_SOURCES) \
144  ./test/test_Cache.cc
145
146test_RWW_CPPFLAGS = $(test_CPPFLAGS)
147test_RWW_LDFLAGS = @AM_LDFLAGS@
148test_RWW_LDADD = $(test_LDADD)
149test_RWW_SOURCES = \
150  $(test_main_SOURCES) \
151  ./test/test_RWW.cc
152
153test_Alternate_L_to_S_CPPFLAGS = $(test_CPPFLAGS)
154test_Alternate_L_to_S_LDFLAGS = @AM_LDFLAGS@
155test_Alternate_L_to_S_LDADD = $(test_LDADD)
156test_Alternate_L_to_S_SOURCES = \
157  $(test_main_SOURCES) \
158  ./test/test_Alternate_L_to_S.cc
159
160test_Alternate_S_to_L_CPPFLAGS = $(test_CPPFLAGS)
161test_Alternate_S_to_L_LDFLAGS = @AM_LDFLAGS@
162test_Alternate_S_to_L_LDADD = $(test_LDADD)
163test_Alternate_S_to_L_SOURCES = \
164  $(test_main_SOURCES) \
165  ./test/test_Alternate_S_to_L.cc
166
167test_Alternate_L_to_S_remove_L_CPPFLAGS = $(test_CPPFLAGS)
168test_Alternate_L_to_S_remove_L_LDFLAGS = @AM_LDFLAGS@
169test_Alternate_L_to_S_remove_L_LDADD = $(test_LDADD)
170test_Alternate_L_to_S_remove_L_SOURCES = \
171  $(test_main_SOURCES) \
172  ./test/test_Alternate_L_to_S_remove_L.cc
173
174test_Alternate_L_to_S_remove_S_CPPFLAGS = $(test_CPPFLAGS)
175test_Alternate_L_to_S_remove_S_LDFLAGS = @AM_LDFLAGS@
176test_Alternate_L_to_S_remove_S_LDADD = $(test_LDADD)
177test_Alternate_L_to_S_remove_S_SOURCES = \
178  $(test_main_SOURCES) \
179  ./test/test_Alternate_L_to_S_remove_S.cc
180
181test_Alternate_S_to_L_remove_S_CPPFLAGS = $(test_CPPFLAGS)
182test_Alternate_S_to_L_remove_S_LDFLAGS = @AM_LDFLAGS@
183test_Alternate_S_to_L_remove_S_LDADD = $(test_LDADD)
184test_Alternate_S_to_L_remove_S_SOURCES = \
185  $(test_main_SOURCES) \
186  ./test/test_Alternate_S_to_L_remove_S.cc
187
188test_Alternate_S_to_L_remove_L_CPPFLAGS = $(test_CPPFLAGS)
189test_Alternate_S_to_L_remove_L_LDFLAGS = @AM_LDFLAGS@
190test_Alternate_S_to_L_remove_L_LDADD = $(test_LDADD)
191test_Alternate_S_to_L_remove_L_SOURCES = \
192  $(test_main_SOURCES) \
193  ./test/test_Alternate_S_to_L_remove_L.cc
194
195test_Update_L_to_S_CPPFLAGS = $(test_CPPFLAGS)
196test_Update_L_to_S_LDFLAGS = @AM_LDFLAGS@
197test_Update_L_to_S_LDADD = $(test_LDADD)
198test_Update_L_to_S_SOURCES = \
199  $(test_main_SOURCES) \
200  ./test/test_Update_L_to_S.cc
201
202test_Update_S_to_L_CPPFLAGS = $(test_CPPFLAGS)
203test_Update_S_to_L_LDFLAGS = @AM_LDFLAGS@
204test_Update_S_to_L_LDADD = $(test_LDADD)
205test_Update_S_to_L_SOURCES = \
206  $(test_main_SOURCES) \
207  ./test/test_Update_S_to_L.cc
208
209test_Update_header_CPPFLAGS = $(test_CPPFLAGS)
210test_Update_header_LDFLAGS = @AM_LDFLAGS@
211test_Update_header_LDADD = $(test_LDADD)
212test_Update_header_SOURCES = \
213  $(test_main_SOURCES) \
214  ./test/test_Update_header.cc
215
216include $(top_srcdir)/build/tidy.mk
217
218clang-tidy-local: $(DIST_SOURCES)
219	$(CXX_Clang_Tidy)
220