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