A common init function for binaries and a default main function for tests
[folly.git] / folly / Makefile.am
1 if HAVE_LINUX
2 SUBDIRS = . experimental init test
3 else
4 SUBDIRS = . test
5 endif
6
7 ACLOCAL_AMFLAGS = -I m4
8
9 CLEANFILES =
10
11 noinst_PROGRAMS = generate_fingerprint_tables
12 generate_fingerprint_tables_SOURCES = build/GenerateFingerprintTables.cpp
13 generate_fingerprint_tables_LDADD = libfollybase.la
14
15 noinst_LTLIBRARIES = \
16         libfollybase.la
17
18 lib_LTLIBRARIES = \
19         libfolly.la \
20         libfollybenchmark.la
21
22 follyincludedir = $(includedir)/folly
23
24 nobase_follyinclude_HEADERS = \
25         ApplyTuple.h \
26         Arena.h \
27         Arena-inl.h \
28         Assume.h \
29         AtomicBitSet.h \
30         AtomicHashArray.h \
31         AtomicHashArray-inl.h \
32         AtomicHashMap.h \
33         AtomicHashMap-inl.h \
34         AtomicIntrusiveLinkedList.h \
35         AtomicLinkedList.h \
36         AtomicStruct.h \
37         AtomicUnorderedMap.h \
38         CppAttributes.h \
39         Baton.h \
40         Benchmark.h \
41         Bits.h \
42         Checksum.h \
43         ConcurrentSkipList.h \
44         ConcurrentSkipList-inl.h \
45         ContainerTraits.h \
46         Conv.h \
47         CpuId.h \
48         CPortability.h \
49         detail/AtomicHashUtils.h \
50         detail/AtomicUnorderedMapUtils.h \
51         detail/BitIteratorDetail.h \
52         detail/BitsDetail.h \
53         detail/CacheLocality.h \
54         detail/ChecksumDetail.h \
55         detail/Clock.h \
56         detail/DiscriminatedPtrDetail.h \
57         detail/ExceptionWrapper.h \
58         detail/FileUtilDetail.h \
59         detail/FingerprintPolynomial.h \
60         detail/FunctionalExcept.h \
61         detail/Futex.h \
62         detail/GroupVarintDetail.h \
63         detail/IPAddress.h \
64         detail/Malloc.h \
65         detail/MemoryIdler.h \
66         detail/MPMCPipelineDetail.h \
67         detail/RangeCommon.h \
68         detail/RangeSse42.h \
69         detail/Sleeper.h \
70         detail/SlowFingerprint.h \
71         detail/SpinLockImpl.h \
72         detail/Stats.h \
73         detail/ThreadLocalDetail.h \
74         detail/TurnSequencer.h \
75         detail/UncaughtExceptionCounter.h \
76         Demangle.h \
77         DiscriminatedPtr.h \
78         DynamicConverter.h \
79         dynamic.h \
80         dynamic-inl.h \
81         Exception.h \
82         ExceptionWrapper.h \
83         Executor.h \
84         EvictingCacheMap.h \
85         experimental/AutoTimer.h \
86         experimental/Bits.h \
87         experimental/BitVectorCoding.h \
88         experimental/ExecutionObserver.h \
89         experimental/EliasFanoCoding.h \
90         experimental/EventCount.h \
91         experimental/Instructions.h \
92         experimental/fibers/AddTasks.h \
93         experimental/fibers/AddTasks-inl.h \
94         experimental/fibers/Baton.h \
95         experimental/fibers/Baton-inl.h \
96         experimental/fibers/BoostContextCompatibility.h \
97         experimental/fibers/EventBaseLoopController.h \
98         experimental/fibers/EventBaseLoopController-inl.h \
99         experimental/fibers/Fiber.h \
100         experimental/fibers/Fiber-inl.h \
101         experimental/fibers/FiberManager.h \
102         experimental/fibers/FiberManager-inl.h \
103         experimental/fibers/FiberManagerMap.h \
104         experimental/fibers/ForEach.h \
105         experimental/fibers/ForEach-inl.h \
106         experimental/fibers/GenericBaton.h \
107         experimental/fibers/GuardPageAllocator.h \
108         experimental/fibers/LoopController.h \
109         experimental/fibers/Promise.h \
110         experimental/fibers/Promise-inl.h \
111         experimental/fibers/SimpleLoopController.h \
112         experimental/fibers/TimedMutex.h \
113         experimental/fibers/TimedMutex-inl.h \
114         experimental/fibers/TimeoutController.h \
115         experimental/fibers/traits.h \
116         experimental/fibers/WhenN.h \
117         experimental/fibers/WhenN-inl.h \
118         experimental/FunctionScheduler.h \
119         experimental/FutureDAG.h \
120         experimental/io/FsUtil.h \
121         experimental/JSONSchema.h \
122         experimental/LockFreeRingBuffer.h \
123         experimental/NestedCommandLineApp.h \
124         experimental/ProgramOptions.h \
125         experimental/ReadMostlySharedPtr.h \
126         experimental/symbolizer/Elf.h \
127         experimental/symbolizer/ElfCache.h \
128         experimental/symbolizer/Dwarf.h \
129         experimental/symbolizer/LineReader.h \
130         experimental/symbolizer/SignalHandler.h \
131         experimental/symbolizer/StackTrace.cpp \
132         experimental/symbolizer/Symbolizer.h \
133         experimental/Select64.h \
134         experimental/StringKeyedCommon.h \
135         experimental/StringKeyedUnorderedMap.h \
136         experimental/StringKeyedUnorderedSet.h \
137         experimental/TestUtil.h \
138         experimental/TLRefCount.h \
139         experimental/TupleOps.h \
140         SparseByteSet.h \
141         FBString.h \
142         FBVector.h \
143         File.h \
144         FileUtil.h \
145         Fingerprint.h \
146         folly-config.h \
147         Foreach.h \
148         FormatArg.h \
149         FormatTraits.h \
150         Format.h \
151         Format-inl.h \
152         futures/Barrier.h \
153         futures/ThreadedExecutor.h \
154         futures/DrivableExecutor.h \
155         futures/Future-pre.h \
156         futures/helpers.h \
157         futures/Future.h \
158         futures/Future-inl.h \
159         futures/FutureException.h \
160         futures/InlineExecutor.h \
161         futures/ManualExecutor.h \
162         futures/OpaqueCallbackShunt.h \
163         futures/Promise-inl.h \
164         futures/Promise.h \
165         futures/QueuedImmediateExecutor.h \
166         futures/ScheduledExecutor.h \
167         futures/SharedPromise.h \
168         futures/SharedPromise-inl.h \
169         futures/ThreadWheelTimekeeper.h \
170         futures/Timekeeper.h \
171         futures/Try-inl.h \
172         futures/Try.h \
173         futures/Unit.h \
174         futures/detail/Core.h \
175         futures/detail/FSM.h \
176         futures/detail/Types.h \
177         gen/Base.h \
178         gen/Base-inl.h \
179         gen/Combine.h \
180         gen/Combine-inl.h \
181         gen/Core.h \
182         gen/Core-inl.h \
183         gen/File.h \
184         gen/File-inl.h \
185         gen/Parallel.h \
186         gen/Parallel-inl.h \
187         gen/ParallelMap.h \
188         gen/ParallelMap-inl.h \
189         gen/String.h \
190         gen/String-inl.h \
191         GroupVarint.h \
192         Hash.h \
193         IPAddress.h \
194         IPAddressV4.h \
195         IPAddressV6.h \
196         IPAddressException.h \
197         IndexedMemPool.h \
198         init/Init.h \
199         IntrusiveList.h \
200         io/Compression.h \
201         io/Cursor.h \
202         io/IOBuf.h \
203         io/IOBufQueue.h \
204         io/RecordIO.h \
205         io/RecordIO-inl.h \
206         io/TypedIOBuf.h \
207         io/ShutdownSocketSet.h \
208         io/async/AsyncPipe.h \
209         io/async/AsyncTimeout.h \
210         io/async/AsyncTransport.h \
211         io/async/AsyncUDPServerSocket.h \
212         io/async/AsyncUDPSocket.h \
213         io/async/AsyncServerSocket.h \
214         io/async/AsyncSignalHandler.h \
215         io/async/AsyncSocket.h \
216         io/async/AsyncSocketBase.h \
217         io/async/AsyncSSLSocket.h \
218         io/async/AsyncSocketException.h \
219         io/async/DelayedDestructionBase.h \
220         io/async/DelayedDestruction.h \
221         io/async/EventBase.h \
222         io/async/EventBaseLocal.h \
223         io/async/EventBaseManager.h \
224         io/async/EventFDWrapper.h \
225         io/async/EventHandler.h \
226         io/async/EventUtil.h \
227         io/async/NotificationQueue.h \
228         io/async/HHWheelTimer.h \
229         io/async/OpenSSLPtrTypes.h \
230         io/async/Request.h \
231         io/async/SSLContext.h \
232         io/async/ScopedEventBaseThread.h \
233         io/async/TimeoutManager.h \
234         io/async/test/AsyncSSLSocketTest.h \
235         io/async/test/BlockingSocket.h \
236         io/async/test/MockAsyncSocket.h \
237         io/async/test/MockAsyncServerSocket.h \
238         io/async/test/MockAsyncSSLSocket.h \
239         io/async/test/MockAsyncTransport.h \
240         io/async/test/MockAsyncUDPSocket.h \
241         io/async/test/SocketPair.h \
242         io/async/test/TimeUtil.h \
243         io/async/test/UndelayedDestruction.h \
244         io/async/test/Util.h \
245         json.h \
246         Lazy.h \
247         LifoSem.h \
248         Likely.h \
249         Logging.h \
250         MacAddress.h \
251         Malloc.h \
252         MapUtil.h \
253         Memory.h \
254         MemoryMapping.h \
255         MicroSpinLock.h \
256         MoveWrapper.h \
257         MPMCPipeline.h \
258         MPMCQueue.h \
259         Optional.h \
260         PackedSyncPtr.h \
261         Padded.h \
262         PicoSpinLock.h \
263         Portability.h \
264         portability/Syscall.h \
265         Preprocessor.h \
266         ProducerConsumerQueue.h \
267         Random.h \
268         Random-inl.h \
269         Range.h \
270         RWSpinLock.h \
271         ScopeGuard.h \
272         SharedMutex.h \
273         Singleton.h \
274         Singleton-inl.h \
275         SmallLocks.h \
276         small_vector.h \
277         SocketAddress.h \
278         sorted_vector_types.h \
279         SpinLock.h \
280         SpookyHashV1.h \
281         SpookyHashV2.h \
282         stats/BucketedTimeSeries-defs.h \
283         stats/BucketedTimeSeries.h \
284         stats/Histogram-defs.h \
285         stats/Histogram.h \
286         stats/MultiLevelTimeSeries-defs.h \
287         stats/MultiLevelTimeSeries.h \
288         stats/TimeseriesHistogram-defs.h \
289         stats/TimeseriesHistogram.h \
290         String.h \
291         String-inl.h \
292         Subprocess.h \
293         Synchronized.h \
294         test/FBStringTestBenchmarks.cpp.h \
295         test/FBVectorTestBenchmarks.cpp.h \
296         test/function_benchmark/benchmark_impl.h \
297         test/function_benchmark/test_functions.h \
298         test/SynchronizedTestLib.h \
299         test/SynchronizedTestLib-inl.h \
300         test/TestUtils.h \
301         ThreadCachedArena.h \
302         ThreadCachedInt.h \
303         ThreadLocal.h \
304         ThreadName.h \
305         TimeoutQueue.h \
306         Traits.h \
307         Unicode.h \
308         Uri.h \
309         Uri-inl.h \
310         Varint.h \
311         VersionCheck.h
312
313 FormatTables.cpp: build/generate_format_tables.py
314         $(PYTHON) build/generate_format_tables.py
315 CLEANFILES += FormatTables.cpp
316
317 EscapeTables.cpp: build/generate_escape_tables.py
318         $(PYTHON) build/generate_escape_tables.py
319 CLEANFILES += EscapeTables.cpp
320
321 GroupVarintTables.cpp: build/generate_varint_tables.py
322         $(PYTHON) build/generate_varint_tables.py
323 CLEANFILES += GroupVarintTables.cpp
324
325 libfollybase_la_SOURCES = \
326         Conv.cpp \
327         Demangle.cpp \
328         detail/RangeCommon.cpp \
329         detail/RangeSse42.cpp \
330         EscapeTables.cpp \
331         Format.cpp \
332         FormatTables.cpp \
333         StringBase.cpp \
334         String.cpp \
335         Unicode.cpp
336
337 libfolly_la_SOURCES = \
338         Bits.cpp \
339         Checksum.cpp \
340         detail/CacheLocality.cpp \
341         dynamic.cpp \
342         File.cpp \
343         FileUtil.cpp \
344         FingerprintTables.cpp \
345         futures/Barrier.cpp \
346         futures/ThreadedExecutor.cpp \
347         futures/Future.cpp \
348         futures/InlineExecutor.cpp \
349         futures/ManualExecutor.cpp \
350         futures/QueuedImmediateExecutor.cpp \
351         futures/ThreadWheelTimekeeper.cpp \
352         detail/Futex.cpp \
353         detail/ThreadLocalDetail.cpp \
354         GroupVarint.cpp \
355         GroupVarintTables.cpp \
356         IPAddress.cpp \
357         IPAddressV4.cpp \
358         IPAddressV6.cpp \
359         LifoSem.cpp \
360         io/Compression.cpp \
361         io/IOBuf.cpp \
362         io/IOBufQueue.cpp \
363         io/RecordIO.cpp \
364         io/ShutdownSocketSet.cpp \
365         io/async/AsyncPipe.cpp \
366         io/async/AsyncTimeout.cpp \
367         io/async/AsyncUDPSocket.cpp \
368         io/async/AsyncServerSocket.cpp \
369         io/async/AsyncSignalHandler.cpp \
370         io/async/AsyncSocket.cpp \
371         io/async/AsyncSSLSocket.cpp \
372         io/async/EventBase.cpp \
373         io/async/EventBaseLocal.cpp \
374         io/async/EventBaseManager.cpp \
375         io/async/EventHandler.cpp \
376         io/async/SSLContext.cpp \
377         io/async/ScopedEventBaseThread.cpp \
378         io/async/HHWheelTimer.cpp \
379         io/async/test/SocketPair.cpp \
380         io/async/test/TimeUtil.cpp \
381         json.cpp \
382         detail/MemoryIdler.cpp \
383         MacAddress.cpp \
384         MemoryMapping.cpp \
385         Random.cpp \
386         SafeAssert.cpp \
387         SharedMutex.cpp \
388         Singleton.cpp \
389         SocketAddress.cpp \
390         SpookyHashV1.cpp \
391         SpookyHashV2.cpp \
392         stats/Instantiations.cpp \
393         Subprocess.cpp \
394         ThreadCachedArena.cpp \
395         TimeoutQueue.cpp \
396         Uri.cpp \
397         Version.cpp \
398         experimental/fibers/Baton.cpp \
399         experimental/fibers/Fiber.cpp \
400         experimental/fibers/FiberManager.cpp \
401         experimental/fibers/FiberManagerMap.cpp \
402         experimental/fibers/GuardPageAllocator.cpp \
403         experimental/fibers/TimeoutController.cpp \
404         experimental/FunctionScheduler.cpp \
405         experimental/io/FsUtil.cpp \
406         experimental/JSONSchema.cpp \
407         experimental/NestedCommandLineApp.cpp \
408         experimental/ProgramOptions.cpp \
409         experimental/Select64.cpp \
410         experimental/TestUtil.cpp
411
412 if HAVE_LINUX
413 nobase_follyinclude_HEADERS += \
414         experimental/io/HugePages.h
415 libfolly_la_SOURCES += \
416         experimental/io/HugePages.cpp
417 endif
418
419 if !HAVE_LINUX
420 libfollybase_la_SOURCES += detail/Clock.cpp
421 endif
422
423 if !HAVE_WEAK_SYMBOLS
424 libfollybase_la_SOURCES += detail/MallocImpl.cpp
425 endif
426
427 if !HAVE_BITS_FUNCTEXCEPT
428 libfollybase_la_SOURCES += detail/FunctionalExcept.cpp
429 endif
430
431 libfollybase_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
432
433 libfolly_la_LIBADD = libfollybase.la
434 libfolly_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION) -lssl
435
436 FingerprintTables.cpp: generate_fingerprint_tables
437         ./generate_fingerprint_tables
438 CLEANFILES += FingerprintTables.cpp
439
440 libfollybenchmark_la_SOURCES = Benchmark.cpp
441 libfollybenchmark_la_LIBADD = libfolly.la
442 libfollybenchmark_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)