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