ACES contribution from AMPAS/Ruppel
[asdcplib.git] / src / Makefile.am
1 ## Makefile.am -- Process this file with automake to produce Makefile.in
2 #
3 # $Id$
4 #
5 # Copyright (c) 2007-2018 John Hurst. All rights reserved.
6 #
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
9 # are met:
10 # 1. Redistributions of source code must retain the above copyright
11 #    notice, this list of conditions and the following disclaimer.
12 # 2. Redistributions in binary form must reproduce the above copyright
13 #    notice, this list of conditions and the following disclaimer in the
14 #    documentation and/or other materials provided with the distribution.
15 # 3. The name of the author may not be used to endorse or promote products
16 #    derived from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 # Allow for configure's changes to this makefile
30 AM_CPPFLAGS =
31 AM_LDFLAGS =
32
33 if OPENBSD_HOST
34 AM_CPPFLAGS += -I/var/local/include -I/usr/local/include
35 AM_LDFLAGS += -L./.libs -L/var/local/lib -L/usr/local/lib
36 endif
37
38 if ENABLE_RANDOM_UUID
39 AM_CPPFLAGS += -DCONFIG_RANDOM_UUID
40 endif
41
42 AM_CPPFLAGS += -g
43
44 # list of all the header files that should be installed
45 include_HEADERS = \
46         KM_error.h \
47         KM_fileio.h \
48         KM_log.h \
49         KM_memio.h \
50         KM_mutex.h \
51         KM_platform.h \
52         KM_prng.h \
53         KM_util.h \
54         KM_tai.h \
55         KM_xml.h \
56         AS_DCP.h
57
58 if DEV_HEADERS
59 include_HEADERS += \
60         S12MTimecode.h \
61         ST2095_PinkNoise.h \
62         MDD.h \
63         Metadata.h \
64         KLV.h \
65         JP2K.h \
66         MXFTypes.h \
67         MXF.h \
68         Wav.h \
69         PCMParserList.h \
70         AtmosSyncChannel_Mixer.h \
71         AtmosSyncChannel_Generator.h \
72         PCMDataProviders.h \
73         SyncCommon.h \
74         SyncEncoder.h \
75         UUIDInformation.h \
76         WavFileWriter.h \
77         AS_DCP_internal.h \
78         AS_DCP_DCData_internal.h
79
80 endif
81
82 if USE_AS_02
83 include_HEADERS         += AS_02.h
84 endif
85
86 if USE_PHDR
87 include_HEADERS         += AS_02_PHDR.h
88 endif
89
90 # list of the libraries to build and install
91
92 lib_LTLIBRARIES = libkumu.la libasdcp.la
93
94 if USE_AS_02
95 lib_LTLIBRARIES         += libas02.la
96 endif
97
98 if USE_PHDR
99 lib_LTLIBRARIES         += libphdr.la
100 endif
101
102 # sources for kumu library
103 libkumu_la_SOURCES = KM_error.h KM_fileio.cpp KM_fileio.h KM_log.cpp KM_log.h \
104                 KM_memio.h KM_mutex.h KM_platform.h KM_prng.cpp KM_prng.h KM_util.cpp \
105                 KM_util.h KM_xml.cpp KM_xml.h KM_tai.h KM_tai.cpp
106
107 # linker flags (*not* including libraries to link against) for a library
108 libkumu_la_LDFLAGS = -release @VERSION@
109
110
111 # sources for asdcp library that don't get added to a distribution
112 nodist_libasdcp_la_SOURCES = Metadata_h.tt2 Metadata_cpp.tt2 \
113                 mxfgen.pl MXF_def.pl ullist.pl ULList.xml dict.xml DMS_Crypto.xml
114 # sources for asdcp library
115 libasdcp_la_SOURCES = MPEG2_Parser.cpp MPEG.cpp JP2K_Codestream_Parser.cpp \
116         JP2K_Sequence_Parser.cpp JP2K.cpp PCM_Parser.cpp Wav.cpp \
117         TimedText_Parser.cpp KLV.cpp Dict.cpp MXFTypes.cpp MXF.cpp \
118         Index.cpp Metadata.cpp AS_DCP.cpp AS_DCP_MXF.cpp AS_DCP_AES.cpp \
119         h__Reader.cpp h__Writer.cpp AS_DCP_MPEG2.cpp AS_DCP_JP2K.cpp \
120         AS_DCP_PCM.cpp AS_DCP_TimedText.cpp PCMParserList.cpp \
121         Wav.h WavFileWriter.h MXF.h Metadata.h \
122         JP2K.h AS_DCP.h AS_DCP_internal.h KLV.h MPEG.h MXFTypes.h MDD.h \
123         PCMParserList.h S12MTimecode.h MDD.cpp \
124         AS_DCP_ATMOS.cpp  AS_DCP_DCData.cpp info.in \
125         DCData_ByteStream_Parser.cpp DCData_Sequence_Parser.cpp \
126         AtmosSyncChannel_Generator.cpp AtmosSyncChannel_Generator.h \
127         AtmosSyncChannel_Mixer.cpp AtmosSyncChannel_Mixer.h \
128         PCMDataProviders.cpp PCMDataProviders.h \
129         SyncEncoder.c SyncEncoder.h SyncCommon.h CRC16.c CRC16.h \
130         UUIDInformation.c UUIDInformation.h \
131         ST2095_PinkNoise.cpp
132
133
134 libasdcp_la_LDFLAGS = -release @VERSION@
135 # additional libraries to link against for a library
136 libasdcp_la_LIBADD = libkumu.la
137 libasdcp_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
138
139 if USE_AS_02
140 # sources for as-02 library
141 libas02_la_SOURCES      = \
142         AS_02.h \
143         AS_02_internal.h \
144         ACES.h \
145         AS_02_ACES.h \
146         h__02_Reader.cpp \
147         h__02_Writer.cpp \
148         AS_02_JP2K.cpp \
149         AS_02_PCM.cpp \
150         AS_02_ISXD.cpp \
151         ST2052_TextParser.cpp \
152         AS_02_TimedText.cpp \
153         ACES.cpp \
154         ACES_Codestream_Parser.cpp \
155         ACES_Sequence_Parser.cpp \
156         AS_02_ACES.cpp
157
158 libas02_la_LDFLAGS = -release @VERSION@
159 libas02_la_LIBADD = libasdcp.la libkumu.la
160 libas02_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
161 endif
162
163
164 if USE_PHDR
165 # sources for PHDR library
166 libphdr_la_SOURCES      = \
167         AS_02_PHDR.h \
168         PHDR_Sequence_Parser.cpp \
169         AS_02_PHDR.cpp \
170         AS_02_PIDM.cpp
171
172 libphdr_la_LDFLAGS = -release @VERSION@
173 libphdr_la_LIBADD = libasdcp.la libkumu.la
174 libphdr_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
175 endif
176
177 # Python extension
178 if PYTHON_USE
179 lib_LTLIBRARIES += libpyasdcp.la
180
181 nodist_libpyasdcp_la_SOURCES = \
182         kumu_python.cpp \
183         kumu_python_list.cpp \
184         kumu_python.h \
185         asdcp_python.cpp \
186         asdcp_python.h \
187         asdcp_python_descriptor.cpp \
188         asdcp_python_misc.cpp \
189         asdcp_python_writerinfo.h \
190         asdcp_wrappers.h \
191         asdcp_python_mxf.cpp \
192         asdcp_python_mxf.h \
193         asdcp_python_mxf_text.cpp \
194         asdcp_python_mxf_metadata.cpp
195
196
197 libpyasdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
198 libpyasdcp_la_LDFLAGS = @PYTHON_LSPEC@  -release @VERSION@
199 libpyasdcp_la_LIBADD = libkumu.la libasdcp.la
200
201 if USE_AS_02
202 libpyasdcp_la_LIBADD    += libas02.la
203 endif
204
205 pyexecdir = @PYTHON_EXECDIR@
206 pyexec_includedir = $(prefix)/include
207 nodist_pyexec_include_HEADERS = kumu_python.h asdcp_python.h asdcp_wrappers.h
208 pyexec_LTLIBRARIES = kumu.la asdcp.la
209
210 nodist_kumu_la_SOURCES = pykumu.cpp kumu_python.h
211 kumu_la_CPPFLAGS = @PYTHON_CPPFLAGS@
212 kumu_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
213 kumu_la_LIBADD = libpyasdcp.la
214
215 nodist_asdcp_la_SOURCES = pyasdcp.cpp kumu_python.h asdcp_python.h asdcp_wrappers.h
216 asdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
217 asdcp_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
218 asdcp_la_LIBADD = libpyasdcp.la
219 endif
220
221 # list of programs to be built and installed
222 bin_PROGRAMS = \
223         asdcp-wrap \
224         asdcp-unwrap \
225         asdcp-util \
226         asdcp-info \
227         asdcp-test \
228         j2c-test \
229         blackwave \
230         pinkwave \
231         klvwalk \
232         wavesplit \
233         klvsplit \
234         kmfilegen \
235         kmrandgen \
236         kmuuidgen
237
238 if USE_AS_02
239 bin_PROGRAMS += \
240         as-02-wrap \
241         as-02-unwrap \
242         as-02-info
243 endif
244
245 if USE_PHDR
246 bin_PROGRAMS += \
247         phdr-wrap \
248         phdr-unwrap
249 endif
250
251 # sources and linkage for CLI utilities
252 asdcp_test_SOURCES = asdcp-test.cpp
253 asdcp_test_LDADD = libasdcp.la libkumu.la
254
255 asdcp_wrap_SOURCES = asdcp-wrap.cpp
256 asdcp_wrap_LDADD = libasdcp.la libkumu.la
257
258 asdcp_unwrap_SOURCES = asdcp-unwrap.cpp
259 asdcp_unwrap_LDADD = libasdcp.la libkumu.la
260
261 asdcp_util_SOURCES = asdcp-util.cpp
262 asdcp_util_LDADD = libasdcp.la libkumu.la
263
264 asdcp_info_SOURCES = asdcp-info.cpp
265 asdcp_info_LDADD = libasdcp.la libkumu.la
266
267 kmfilegen_SOURCES = kmfilegen.cpp
268 kmfilegen_LDADD = libkumu.la 
269
270 kmrandgen_SOURCES = kmrandgen.cpp
271 kmrandgen_LDADD = libkumu.la 
272
273 kmuuidgen_SOURCES = kmuuidgen.cpp
274 kmuuidgen_LDADD = libkumu.la 
275
276 blackwave_SOURCES = blackwave.cpp
277 blackwave_LDADD = libasdcp.la  libkumu.la
278
279 pinkwave_SOURCES = pinkwave.cpp
280 pinkwave_LDADD = libasdcp.la  libkumu.la
281
282 klvwalk_SOURCES = klvwalk.cpp
283 klvwalk_LDADD = libasdcp.la libkumu.la
284
285 wavesplit_SOURCES = wavesplit.cpp
286 wavesplit_LDADD = libasdcp.la libkumu.la
287
288 j2c_test_SOURCES = j2c-test.cpp
289 j2c_test_LDADD = libasdcp.la libkumu.la
290
291 klvsplit_SOURCES = klvsplit.cpp
292 klvsplit_LDADD = libasdcp.la libkumu.la
293
294 if USE_AS_02
295 as_02_wrap_SOURCES = as-02-wrap.cpp
296 as_02_wrap_LDADD = libas02.la libasdcp.la libkumu.la
297
298 as_02_unwrap_SOURCES = as-02-unwrap.cpp
299 as_02_unwrap_LDADD = libas02.la libasdcp.la libkumu.la
300
301 as_02_info_SOURCES = as-02-info.cpp
302 as_02_info_LDADD = libas02.la libasdcp.la libkumu.la
303 endif
304
305 if USE_PHDR
306 phdr_wrap_SOURCES = phdr-wrap.cpp
307 phdr_wrap_LDADD = libphdr.la libas02.la libasdcp.la libkumu.la
308
309 phdr_unwrap_SOURCES = phdr-unwrap.cpp
310 phdr_unwrap_LDADD = libphdr.la libas02.la libasdcp.la libkumu.la
311 endif
312
313 # list of programs that need to be compiled for use in test suite
314 check_PROGRAMS = asdcp-mem-test path-test \
315         fips-186-rng-test asdcp-version
316 if DEV_HEADERS
317 check_PROGRAMS += tt-xform
318 endif
319
320 # sources for a test program
321 # list of libraries to link against for a test program
322 asdcp_mem_test_SOURCES = asdcp-mem-test.cpp
323 asdcp_mem_test_LDADD = libasdcp.la
324
325 path_test_SOURCES = path-test.cpp
326 path_test_LDADD = libkumu.la
327
328 fips_186_rng_test_SOURCES = fips-186-rng-test.cpp
329 fips_186_rng_test_LDADD = libasdcp.la
330
331 asdcp_version_SOURCES = asdcp-version.cpp
332 asdcp_version_LDADD = libkumu.la 
333
334 if DEV_HEADERS
335 nodist_tt_xform_SOURCES = tt-xform.cpp TimedText_Transform.h
336 tt_xform_LDADD = libasdcp.la
337 endif
338
339
340 # list of test scripts to execute during "make check"
341 TESTS = rng-tst.sh gen-tst.sh \
342         jp2k-tst.sh jp2k-crypt-tst.sh jp2k-stereo-tst.sh jp2k-stereo-crypt-tst.sh \
343         wav-tst.sh wav-crypt-tst.sh mpeg-tst.sh mpeg-crypt-tst.sh
344
345 # environment variables to pass to above tests
346 TESTS_ENVIRONMENT = BUILD_DIR="." TEST_FILES=../tests TEST_FILE_PREFIX=DCPd1-M1 \
347         CRYPT_KEY=70e0de21c98fbd455ad5b8042edb41a6 CRYPT_KEY_B=aa2d05475d568cd52cb3415e65cba76f \
348         JP2K_PREFIX=MM_2k_XYZ_
349
350 # files to include in the distribution that automake doesn't automatically include
351 EXTRA_DIST = fips-186-test-harness.pl $(TESTS) ../README.cmake ../CMakeLists.txt  CMakeLists.txt dirent_win.h
352 if !FREEDIST
353 if DEV_HEADERS
354 EXTRA_DIST += $(nodist_libasdcp_la_SOURCES) $(nodist_tt_xform_SOURCES)
355 endif
356 if PYTHON_USE
357 EXTRA_DIST += $(nodist_pyexec_include_HEADERS) $(nodist_libpyasdcp_la_SOURCES) $(nodist_kumu_la_SOURCES) $(nodist_asdcp_la_SOURCES)
358 endif
359 endif
360
361 # source files that are themselves built
362 BUILT_SOURCES = Metadata.h Metadata.cpp MDD.h MDD.cpp
363 # files to be removed with "make maintainer-clean"
364 MAINTAINERCLEANFILES = Metadata.h Metadata.cpp MDD.h MDD.cpp
365
366 # build commands for built sources
367 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
368 MDD.h:
369         $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.h
370 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
371 MDD.cpp:
372         $(srcdir)/ullist.pl -s $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.cpp
373 # dependencies: $(srcdir)/Metadata_h.tt2 $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl
374 Metadata.h:
375         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_h.tt2 > Metadata.h
376 # dependencies:  Metadata.h $(srcdir)/Metadata_cpp.tt2
377 Metadata.cpp:
378         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_cpp.tt2 > Metadata.cpp
379
380 #
381 #
382 #