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