megachanges
[asdcplib.git] / src / Makefile.am
1 ## Makefile.am -- Process this file with automake to produce Makefile.in
2 #
3 # $Id$
4 # Copyright (c) 2007-2011 John Hurst. All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 #    notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 #    notice, this list of conditions and the following disclaimer in the
13 #    documentation and/or other materials provided with the distribution.
14 # 3. The name of the author may not be used to endorse or promote products
15 #    derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28 # Allow for configure's changes to this makefile
29 AM_CPPFLAGS =
30 AM_LDFLAGS =
31
32 if OPENBSD_HOST
33 AM_CPPFLAGS += -I/var/local/include -I/usr/local/include
34 AM_LDFLAGS += -L./.libs -L/var/local/lib -L/usr/local/lib
35 endif
36
37 if ENABLE_RANDOM_UUID
38 AM_CPPFLAGS += -DCONFIG_RANDOM_UUID
39 endif
40
41 # list of all the header files that should be installed
42 include_HEADERS = KM_error.h KM_fileio.h KM_log.h KM_memio.h KM_mutex.h \
43                 KM_platform.h KM_prng.h KM_util.h KM_tai.h KM_xml.h AS_DCP.h
44 if DEV_HEADERS
45 include_HEADERS += S12MTimecode.h MDD.h Metadata.h KLV.h MXFTypes.h MXF.h Wav.h \
46                 PCMParserList.h
47 nodist_include_HEADERS = TimedText_Transform.h
48 endif
49
50 # list of the libraries to build and install
51 lib_LTLIBRARIES = libkumu.la libasdcp.la
52 # sources for a library
53 libkumu_la_SOURCES = KM_error.h KM_fileio.cpp KM_fileio.h KM_log.cpp KM_log.h \
54                 KM_memio.h KM_mutex.h KM_platform.h KM_prng.cpp KM_prng.h KM_util.cpp \
55                 KM_util.h KM_xml.cpp KM_xml.h KM_tai.h KM_tai.cpp
56
57 # linker flags (*not* including libraries to link against) for a library
58 libkumu_la_LDFLAGS = -release @VERSION@
59
60 # sources for a library that don't get added to a distribution
61 nodist_libasdcp_la_SOURCES = Metadata_h.tt2 Metadata_cpp.tt2 \
62                 mxfgen.pl MXF_def.pl ullist.pl ULList.xml dict.xml DMS_Crypto.xml
63
64 libasdcp_la_SOURCES = MPEG2_Parser.cpp MPEG.cpp JP2K_Codestream_Parser.cpp \
65                 JP2K_Sequence_Parser.cpp JP2K.cpp PCM_Parser.cpp Wav.cpp \
66                 TimedText_Parser.cpp KLV.cpp Dict.cpp MXFTypes.cpp MXF.cpp \
67                 Index.cpp Metadata.cpp AS_DCP.cpp AS_DCP_MXF.cpp AS_DCP_AES.cpp \
68                 h__Reader.cpp h__Writer.cpp AS_DCP_MPEG2.cpp AS_DCP_JP2K.cpp \
69                 AS_DCP_PCM.cpp AS_DCP_TimedText.cpp PCMParserList.cpp \
70                 Wav.h WavFileWriter.h MXF.h Metadata.h \
71                 JP2K.h AS_DCP.h AS_DCP_internal.h KLV.h MPEG.h MXFTypes.h MDD.h \
72                 PCMParserList.h S12MTimecode.h MDD.cpp
73
74 if DEV_HEADERS
75 nodist_libasdcp_la_SOURCES += TimedText_Transform.h TimedText_Transform.cpp
76 endif
77
78 libasdcp_la_LDFLAGS = -release @VERSION@
79
80 # additional libraries to link against for a library
81 libasdcp_la_LIBADD = libkumu.la
82 libasdcp_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
83
84 # Python extension
85 if PYTHON_USE
86 lib_LTLIBRARIES += libpyasdcp.la libnapali.la
87
88 nodist_libpyasdcp_la_SOURCES = \
89         kumu_python.cpp kumu_python.h \
90         asdcp_python.cpp asdcp_python.h \
91         asdcp_python_descriptor.cpp \
92         asdcp_python_misc.cpp asdcp_python_writerinfo.h \
93         asdcp_wrappers.h asdcp_python_mxf.cpp asdcp_python_mxf_text.cpp
94
95 nodist_libnapali_la_SOURCES = \
96         napali_python.cpp napali_python.h
97
98 libpyasdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
99 libpyasdcp_la_LDFLAGS = @PYTHON_LSPEC@  -release @VERSION@
100 libpyasdcp_la_LIBADD = libkumu.la libasdcp.la
101
102 libnapali_la_CPPFLAGS = @PYTHON_CPPFLAGS@
103 libnapali_la_LDFLAGS = @PYTHON_LSPEC@  -release @VERSION@
104 libnapali_la_LIBADD = libkumu.la libasdcp.la
105
106 pyexecdir = @PYTHON_EXECDIR@
107 pyexec_includedir = $(PYTHON_PREFIX)/include/python$(PYTHON_SHORTVERSION)
108 nodist_pyexec_include_HEADERS = kumu_python.h asdcp_python.h napali_python.h asdcp_wrappers.h
109 pyexec_LTLIBRARIES = kumu.la asdcp.la napali.la
110
111 nodist_kumu_la_SOURCES = pykumu.cpp kumu_python.h
112 kumu_la_CPPFLAGS = @PYTHON_CPPFLAGS@
113 kumu_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
114 kumu_la_LIBADD = libpyasdcp.la
115
116 nodist_asdcp_la_SOURCES = pyasdcp.cpp kumu_python.h asdcp_python.h asdcp_wrappers.h
117 asdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
118 asdcp_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
119 asdcp_la_LIBADD = libpyasdcp.la
120
121 nodist_napali_la_SOURCES = pynapali.cpp kumu_python.h napali_python.h
122 napali_la_CPPFLAGS = @PYTHON_CPPFLAGS@
123 napali_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
124 napali_la_LIBADD = libnapali.la libpyasdcp.la
125 endif
126
127 # list of programs to be built and installed
128 bin_PROGRAMS = \
129         asdcp-wrap asdcp-unwrap asdcp-util asdcp-info asdcp-test \
130         j2c-test blackwave klvwalk wavesplit \
131         kmfilegen kmrandgen kmuuidgen
132
133 # sources and linkage for CLI utilities
134 asdcp_test_SOURCES = asdcp-test.cpp
135 asdcp_test_LDADD = libasdcp.la
136
137 asdcp_wrap_SOURCES = asdcp-wrap.cpp
138 asdcp_wrap_LDADD = libasdcp.la
139
140 asdcp_unwrap_SOURCES = asdcp-unwrap.cpp
141 asdcp_unwrap_LDADD = libasdcp.la
142
143 asdcp_util_SOURCES = asdcp-util.cpp
144 asdcp_util_LDADD = libasdcp.la
145
146 asdcp_info_SOURCES = asdcp-info.cpp
147 asdcp_info_LDADD = libasdcp.la
148
149 kmfilegen_SOURCES = kmfilegen.cpp
150 kmfilegen_LDADD = libkumu.la
151
152 kmrandgen_SOURCES = kmrandgen.cpp
153 kmrandgen_LDADD = libkumu.la
154
155 kmuuidgen_SOURCES = kmuuidgen.cpp
156 kmuuidgen_LDADD = libkumu.la
157
158 blackwave_SOURCES = blackwave.cpp
159 blackwave_LDADD = libasdcp.la
160
161 klvwalk_SOURCES = klvwalk.cpp
162 klvwalk_LDADD = libasdcp.la
163
164 wavesplit_SOURCES = wavesplit.cpp
165 wavesplit_LDADD = libasdcp.la
166
167 j2c_test_SOURCES = j2c-test.cpp
168 j2c_test_LDADD = libasdcp.la
169
170 # list of programs that need to be compiled for use in test suite
171 check_PROGRAMS = asdcp-mem-test path-test \
172         fips-186-rng-test asdcp-version
173 if DEV_HEADERS
174 check_PROGRAMS += tt-xform
175 endif
176
177 # sources for a test program
178 # list of libraries to link against for a test program
179 asdcp_mem_test_SOURCES = asdcp-mem-test.cpp
180 asdcp_mem_test_LDADD = libasdcp.la
181
182 path_test_SOURCES = path-test.cpp
183 path_test_LDADD = libkumu.la
184
185 fips_186_rng_test_SOURCES = fips-186-rng-test.cpp
186 fips_186_rng_test_LDADD = libasdcp.la
187
188 asdcp_version_SOURCES = asdcp-version.cpp
189 asdcp_version_LDADD = libkumu.la
190
191 if DEV_HEADERS
192 nodist_tt_xform_SOURCES = tt-xform.cpp
193 tt_xform_LDADD = libasdcp.la
194 endif
195
196
197 # list of test scripts to execute during "make check"
198 TESTS = rng-tst.sh gen-tst.sh \
199         jp2k-tst.sh jp2k-crypt-tst.sh jp2k-stereo-tst.sh jp2k-stereo-crypt-tst.sh \
200         wav-tst.sh wav-crypt-tst.sh mpeg-tst.sh mpeg-crypt-tst.sh
201
202 # environment variables to pass to above tests
203 TESTS_ENVIRONMENT = BUILD_DIR="." TEST_FILES=../tests TEST_FILE_PREFIX=DCPd1-M1 \
204         CRYPT_KEY=70e0de21c98fbd455ad5b8042edb41a6 CRYPT_KEY_B=aa2d05475d568cd52cb3415e65cba76f \
205         JP2K_PREFIX=MM_2k_XYZ_
206
207 # files to include in the distribution that automake doesn't automatically include
208 EXTRA_DIST = fips-186-test-harness.pl $(TESTS)
209 if !FREEDIST
210 if DEV_HEADERS
211 EXTRA_DIST += $(nodist_libasdcp_la_SOURCES) $(nodist_tt_xform_SOURCES) $(nodist_napali_la_SOURCES) $(nodist_libnapali_la_SOURCES)
212 endif
213 if PYTHON_USE
214 EXTRA_DIST += $(nodist_pyexec_include_HEADERS) $(nodist_libpyasdcp_la_SOURCES) $(nodist_kumu_la_SOURCES) $(nodist_asdcp_la_SOURCES) $(nodist_napali_la_SOURCES) $(nodist_libnapali_la_SOURCES)
215 endif
216 endif
217
218 # source files that are themselves built
219 BUILT_SOURCES = Metadata.h Metadata.cpp MDD.h MDD.cpp
220 # files to be removed with "make maintainer-clean"
221 MAINTAINERCLEANFILES = Metadata.h Metadata.cpp MDD.h MDD.cpp
222
223 # build commands for built sources
224 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
225 MDD.h:
226         $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.h
227 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
228 MDD.cpp:
229         $(srcdir)/ullist.pl -s $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.cpp
230 # dependencies: $(srcdir)/Metadata_h.tt2 $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl
231 Metadata.h:
232         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_h.tt2 > Metadata.h
233 # dependencies:  Metadata.h $(srcdir)/Metadata_cpp.tt2
234 Metadata.cpp:
235         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_cpp.tt2 > Metadata.cpp
236
237 #
238 #
239 #