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