o Added support for SMPTE RDD 47 "ISXD Track File"
[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         AS_DCP_internal.h \
77         AS_DCP_DCData_internal.h
78
79 endif
80
81 if USE_AS_02
82 include_HEADERS         += AS_02.h
83 endif
84
85 if USE_PHDR
86 include_HEADERS         += AS_02_PHDR.h
87 endif
88
89 # list of the libraries to build and install
90
91 lib_LTLIBRARIES = libkumu.la libasdcp.la
92
93 if USE_AS_02
94 lib_LTLIBRARIES         += libas02.la
95 endif
96
97 if USE_PHDR
98 lib_LTLIBRARIES         += libphdr.la
99 endif
100
101 # sources for kumu library
102 libkumu_la_SOURCES = KM_error.h KM_fileio.cpp KM_fileio.h KM_log.cpp KM_log.h \
103                 KM_memio.h KM_mutex.h KM_platform.h KM_prng.cpp KM_prng.h KM_util.cpp \
104                 KM_util.h KM_xml.cpp KM_xml.h KM_tai.h KM_tai.cpp
105
106 # linker flags (*not* including libraries to link against) for a library
107 libkumu_la_LDFLAGS = -release @VERSION@
108
109
110 # sources for asdcp library that don't get added to a distribution
111 nodist_libasdcp_la_SOURCES = Metadata_h.tt2 Metadata_cpp.tt2 \
112                 mxfgen.pl MXF_def.pl ullist.pl ULList.xml dict.xml DMS_Crypto.xml
113 # sources for asdcp library
114 libasdcp_la_SOURCES = MPEG2_Parser.cpp MPEG.cpp JP2K_Codestream_Parser.cpp \
115         JP2K_Sequence_Parser.cpp JP2K.cpp PCM_Parser.cpp Wav.cpp \
116         TimedText_Parser.cpp KLV.cpp Dict.cpp MXFTypes.cpp MXF.cpp \
117         Index.cpp Metadata.cpp AS_DCP.cpp AS_DCP_MXF.cpp AS_DCP_AES.cpp \
118         h__Reader.cpp h__Writer.cpp AS_DCP_MPEG2.cpp AS_DCP_JP2K.cpp \
119         AS_DCP_PCM.cpp AS_DCP_TimedText.cpp PCMParserList.cpp \
120         Wav.h WavFileWriter.h MXF.h Metadata.h \
121         JP2K.h AS_DCP.h AS_DCP_internal.h KLV.h MPEG.h MXFTypes.h MDD.h \
122         PCMParserList.h S12MTimecode.h MDD.cpp \
123         AS_DCP_ATMOS.cpp  AS_DCP_DCData.cpp info.in \
124         DCData_ByteStream_Parser.cpp DCData_Sequence_Parser.cpp \
125         AtmosSyncChannel_Generator.cpp AtmosSyncChannel_Generator.h \
126         AtmosSyncChannel_Mixer.cpp AtmosSyncChannel_Mixer.h \
127         PCMDataProviders.cpp PCMDataProviders.h \
128         SyncEncoder.c SyncEncoder.h SyncCommon.h CRC16.c CRC16.h \
129         UUIDInformation.c UUIDInformation.h \
130         ST2095_PinkNoise.cpp
131
132
133 libasdcp_la_LDFLAGS = -release @VERSION@
134 # additional libraries to link against for a library
135 libasdcp_la_LIBADD = libkumu.la
136 libasdcp_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
137
138 if USE_AS_02
139 # sources for as-02 library
140 libas02_la_SOURCES      = \
141         AS_02.h \
142         AS_02_internal.h \
143         h__02_Reader.cpp \
144         h__02_Writer.cpp \
145         AS_02_JP2K.cpp \
146         AS_02_PCM.cpp \
147         AS_02_ISXD.cpp \
148         ST2052_TextParser.cpp \
149         AS_02_TimedText.cpp
150
151 libas02_la_LDFLAGS = -release @VERSION@
152 libas02_la_LIBADD = libasdcp.la libkumu.la
153 libas02_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
154 endif
155
156
157 if USE_PHDR
158 # sources for PHDR library
159 libphdr_la_SOURCES      = \
160         AS_02_PHDR.h \
161         PHDR_Sequence_Parser.cpp \
162         AS_02_PHDR.cpp \
163         AS_02_PIDM.cpp
164
165 libphdr_la_LDFLAGS = -release @VERSION@
166 libphdr_la_LIBADD = libasdcp.la libkumu.la
167 libphdr_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
168 endif
169
170 # Python extension
171 if PYTHON_USE
172 lib_LTLIBRARIES += libpyasdcp.la
173
174 nodist_libpyasdcp_la_SOURCES = \
175         kumu_python.cpp \
176         kumu_python_list.cpp \
177         kumu_python.h \
178         asdcp_python.cpp \
179         asdcp_python.h \
180         asdcp_python_descriptor.cpp \
181         asdcp_python_misc.cpp \
182         asdcp_python_writerinfo.h \
183         asdcp_wrappers.h \
184         asdcp_python_mxf.cpp \
185         asdcp_python_mxf.h \
186         asdcp_python_mxf_text.cpp \
187         asdcp_python_mxf_metadata.cpp
188
189
190 libpyasdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
191 libpyasdcp_la_LDFLAGS = @PYTHON_LSPEC@  -release @VERSION@
192 libpyasdcp_la_LIBADD = libkumu.la libasdcp.la
193
194 if USE_AS_02
195 libpyasdcp_la_LIBADD    += libas02.la
196 endif
197
198 pyexecdir = @PYTHON_EXECDIR@
199 pyexec_includedir = $(prefix)/include
200 nodist_pyexec_include_HEADERS = kumu_python.h asdcp_python.h asdcp_wrappers.h
201 pyexec_LTLIBRARIES = kumu.la asdcp.la
202
203 nodist_kumu_la_SOURCES = pykumu.cpp kumu_python.h
204 kumu_la_CPPFLAGS = @PYTHON_CPPFLAGS@
205 kumu_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
206 kumu_la_LIBADD = libpyasdcp.la
207
208 nodist_asdcp_la_SOURCES = pyasdcp.cpp kumu_python.h asdcp_python.h asdcp_wrappers.h
209 asdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
210 asdcp_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
211 asdcp_la_LIBADD = libpyasdcp.la
212 endif
213
214 # list of programs to be built and installed
215 bin_PROGRAMS = \
216         asdcp-wrap \
217         asdcp-unwrap \
218         asdcp-util \
219         asdcp-info \
220         asdcp-test \
221         j2c-test \
222         blackwave \
223         pinkwave \
224         klvwalk \
225         wavesplit \
226         klvsplit \
227         kmfilegen \
228         kmrandgen \
229         kmuuidgen
230
231 if USE_AS_02
232 bin_PROGRAMS += \
233         as-02-wrap \
234         as-02-unwrap \
235         as-02-info
236 endif
237
238 if USE_PHDR
239 bin_PROGRAMS += \
240         phdr-wrap \
241         phdr-unwrap
242 endif
243
244 # sources and linkage for CLI utilities
245 asdcp_test_SOURCES = asdcp-test.cpp
246 asdcp_test_LDADD = libasdcp.la libkumu.la
247
248 asdcp_wrap_SOURCES = asdcp-wrap.cpp
249 asdcp_wrap_LDADD = libasdcp.la libkumu.la
250
251 asdcp_unwrap_SOURCES = asdcp-unwrap.cpp
252 asdcp_unwrap_LDADD = libasdcp.la libkumu.la
253
254 asdcp_util_SOURCES = asdcp-util.cpp
255 asdcp_util_LDADD = libasdcp.la libkumu.la
256
257 asdcp_info_SOURCES = asdcp-info.cpp
258 asdcp_info_LDADD = libasdcp.la libkumu.la
259
260 kmfilegen_SOURCES = kmfilegen.cpp
261 kmfilegen_LDADD = libkumu.la 
262
263 kmrandgen_SOURCES = kmrandgen.cpp
264 kmrandgen_LDADD = libkumu.la 
265
266 kmuuidgen_SOURCES = kmuuidgen.cpp
267 kmuuidgen_LDADD = libkumu.la 
268
269 blackwave_SOURCES = blackwave.cpp
270 blackwave_LDADD = libasdcp.la  libkumu.la
271
272 pinkwave_SOURCES = pinkwave.cpp
273 pinkwave_LDADD = libasdcp.la  libkumu.la
274
275 klvwalk_SOURCES = klvwalk.cpp
276 klvwalk_LDADD = libasdcp.la libkumu.la
277
278 wavesplit_SOURCES = wavesplit.cpp
279 wavesplit_LDADD = libasdcp.la libkumu.la
280
281 j2c_test_SOURCES = j2c-test.cpp
282 j2c_test_LDADD = libasdcp.la libkumu.la
283
284 klvsplit_SOURCES = klvsplit.cpp
285 klvsplit_LDADD = libasdcp.la libkumu.la
286
287 if USE_AS_02
288 as_02_wrap_SOURCES = as-02-wrap.cpp
289 as_02_wrap_LDADD = libas02.la libasdcp.la libkumu.la
290
291 as_02_unwrap_SOURCES = as-02-unwrap.cpp
292 as_02_unwrap_LDADD = libas02.la libasdcp.la libkumu.la
293
294 as_02_info_SOURCES = as-02-info.cpp
295 as_02_info_LDADD = libas02.la libasdcp.la libkumu.la
296 endif
297
298 if USE_PHDR
299 phdr_wrap_SOURCES = phdr-wrap.cpp
300 phdr_wrap_LDADD = libphdr.la libas02.la libasdcp.la libkumu.la
301
302 phdr_unwrap_SOURCES = phdr-unwrap.cpp
303 phdr_unwrap_LDADD = libphdr.la libas02.la libasdcp.la libkumu.la
304 endif
305
306 # list of programs that need to be compiled for use in test suite
307 check_PROGRAMS = asdcp-mem-test path-test \
308         fips-186-rng-test asdcp-version
309 if DEV_HEADERS
310 check_PROGRAMS += tt-xform
311 endif
312
313 # sources for a test program
314 # list of libraries to link against for a test program
315 asdcp_mem_test_SOURCES = asdcp-mem-test.cpp
316 asdcp_mem_test_LDADD = libasdcp.la
317
318 path_test_SOURCES = path-test.cpp
319 path_test_LDADD = libkumu.la
320
321 fips_186_rng_test_SOURCES = fips-186-rng-test.cpp
322 fips_186_rng_test_LDADD = libasdcp.la
323
324 asdcp_version_SOURCES = asdcp-version.cpp
325 asdcp_version_LDADD = libkumu.la 
326
327 if DEV_HEADERS
328 nodist_tt_xform_SOURCES = tt-xform.cpp TimedText_Transform.h
329 tt_xform_LDADD = libasdcp.la
330 endif
331
332
333 # list of test scripts to execute during "make check"
334 TESTS = rng-tst.sh gen-tst.sh \
335         jp2k-tst.sh jp2k-crypt-tst.sh jp2k-stereo-tst.sh jp2k-stereo-crypt-tst.sh \
336         wav-tst.sh wav-crypt-tst.sh mpeg-tst.sh mpeg-crypt-tst.sh
337
338 # environment variables to pass to above tests
339 TESTS_ENVIRONMENT = BUILD_DIR="." TEST_FILES=../tests TEST_FILE_PREFIX=DCPd1-M1 \
340         CRYPT_KEY=70e0de21c98fbd455ad5b8042edb41a6 CRYPT_KEY_B=aa2d05475d568cd52cb3415e65cba76f \
341         JP2K_PREFIX=MM_2k_XYZ_
342
343 # files to include in the distribution that automake doesn't automatically include
344 EXTRA_DIST = fips-186-test-harness.pl $(TESTS) ../README.cmake ../CMakeLists.txt  CMakeLists.txt dirent_win.h
345 if !FREEDIST
346 if DEV_HEADERS
347 EXTRA_DIST += $(nodist_libasdcp_la_SOURCES) $(nodist_tt_xform_SOURCES)
348 endif
349 if PYTHON_USE
350 EXTRA_DIST += $(nodist_pyexec_include_HEADERS) $(nodist_libpyasdcp_la_SOURCES) $(nodist_kumu_la_SOURCES) $(nodist_asdcp_la_SOURCES)
351 endif
352 endif
353
354 # source files that are themselves built
355 BUILT_SOURCES = Metadata.h Metadata.cpp MDD.h MDD.cpp
356 # files to be removed with "make maintainer-clean"
357 MAINTAINERCLEANFILES = Metadata.h Metadata.cpp MDD.h MDD.cpp
358
359 # build commands for built sources
360 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
361 MDD.h:
362         $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.h
363 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
364 MDD.cpp:
365         $(srcdir)/ullist.pl -s $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.cpp
366 # dependencies: $(srcdir)/Metadata_h.tt2 $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl
367 Metadata.h:
368         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_h.tt2 > Metadata.h
369 # dependencies:  Metadata.h $(srcdir)/Metadata_cpp.tt2
370 Metadata.cpp:
371         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_cpp.tt2 > Metadata.cpp
372
373 #
374 #
375 #