udpated readme for changes; added BSD license to fips-testharness; removed tt-xform...
[asdcplib.git] / src / Makefile.am
1 ## Makefile.am -- Process this file with automake to produce Makefile.in
2 #
3 # $Id$
4 # Copyright (c) 2007-2009 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_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 endif
48
49 # list of the libraries to build and install
50 lib_LTLIBRARIES = libkumu.la libasdcp.la
51 # sources for a library
52 libkumu_la_SOURCES = KM_error.h KM_fileio.cpp KM_fileio.h KM_log.cpp KM_log.h \
53                 KM_memio.h KM_mutex.h KM_platform.h KM_prng.cpp KM_prng.h KM_util.cpp \
54                 KM_util.h KM_xml.cpp KM_xml.h KM_tai.h KM_tai.cpp
55
56 # linker flags (*not* including libraries to link against) for a library
57 libkumu_la_LDFLAGS = -release @VERSION@
58
59 # sources for a library that don't get added to a distribution
60 nodist_libasdcp_la_SOURCES = Metadata_h.tt2 Metadata_cpp.tt2 \
61                 mxfgen.pl MXF_def.pl ullist.pl ULList.xml dict.xml DMS_Crypto.xml
62
63 libasdcp_la_SOURCES = MPEG2_Parser.cpp MPEG.cpp JP2K_Codestream_Parser.cpp \
64                 JP2K_Sequence_Parser.cpp JP2K.cpp PCM_Parser.cpp Wav.cpp \
65                 TimedText_Parser.cpp KLV.cpp Dict.cpp MXFTypes.cpp MXF.cpp \
66                 Index.cpp Metadata.cpp AS_DCP.cpp AS_DCP_MXF.cpp AS_DCP_AES.cpp \
67                 h__Reader.cpp h__Writer.cpp AS_DCP_MPEG2.cpp AS_DCP_JP2K.cpp \
68                 AS_DCP_PCM.cpp AS_DCP_TimedText.cpp PCMParserList.cpp \
69                 Wav.h WavFileWriter.h MXF.h Metadata.h \
70                 JP2K.h AS_DCP.h AS_DCP_internal.h KLV.h MPEG.h MXFTypes.h MDD.h \
71                 PCMParserList.h S12MTimecode.h MDD.cpp
72
73 libasdcp_la_LDFLAGS = -release @VERSION@
74
75 # additional libraries to link against for a library
76 libasdcp_la_LIBADD = libkumu.la
77 libasdcp_la_CPPFLAGS = -DASDCP_PLATFORM=\"@host@\"
78
79 # Python extension
80 if PYTHON_USE
81 lib_LTLIBRARIES += libpyasdcp.la
82
83 nodist_libpyasdcp_la_SOURCES = asdcp_python.cpp asdcp_python.h \
84                 asdcp_python_writerinfo.h asdcp_python_misc.cpp \
85                 asdcp_python_reader.cpp asdcp_python_writer.cpp asdcp_wrappers.h \
86                 kumu_python.cpp kumu_python.h
87
88 libpyasdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
89 libpyasdcp_la_LDFLAGS = @PYTHON_LSPEC@
90 libpyasdcp_la_LIBADD = libkumu.la libasdcp.la
91
92 pyexecdir = @PYTHON_EXECDIR@
93 pyexec_includedir = $(PYTHON_PREFIX)/include/python$(PYTHON_SHORTVERSION)
94 nodist_pyexec_include_HEADERS = kumu_python.h asdcp_python.h asdcp_wrappers.h
95 pyexec_LTLIBRARIES = kumu.la asdcp.la
96
97 nodist_kumu_la_SOURCES = pykumu.cpp kumu_python.h
98 kumu_la_CPPFLAGS = @PYTHON_CPPFLAGS@
99 kumu_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
100 kumu_la_LIBADD = libpyasdcp.la
101
102 nodist_asdcp_la_SOURCES = pyasdcp.cpp asdcp_python.h asdcp_wrappers.h
103 asdcp_la_CPPFLAGS = @PYTHON_CPPFLAGS@
104 asdcp_la_LDFLAGS = @PYTHON_LSPEC@ -avoid-version -module
105 asdcp_la_LIBADD = libpyasdcp.la
106 endif
107
108 # list of programs to be built and installed
109 bin_PROGRAMS = asdcp-test blackwave klvwalk kmfilegen kmrandgen \
110                 kmuuidgen wavesplit
111
112 # sources for a program
113 asdcp_test_SOURCES = asdcp-test.cpp
114
115 # list of libraries to link against for a program
116 asdcp_test_LDADD = libasdcp.la
117 kmfilegen_SOURCES = kmfilegen.cpp
118 kmfilegen_LDADD = libkumu.la
119 kmrandgen_SOURCES = kmrandgen.cpp
120 kmrandgen_LDADD = libkumu.la
121 kmuuidgen_SOURCES = kmuuidgen.cpp
122 kmuuidgen_LDADD = libkumu.la
123 blackwave_SOURCES = blackwave.cpp
124 blackwave_LDADD = libasdcp.la
125 klvwalk_SOURCES = klvwalk.cpp
126 klvwalk_LDADD = libasdcp.la
127 wavesplit_SOURCES = wavesplit.cpp
128 wavesplit_LDADD = libasdcp.la
129
130 # list of programs that need to be compiled for use in test suite
131 check_PROGRAMS = asdcp-mem-test path-test jp2k-test S429-5-cgi \
132         fips-186-rng-test asdcp-version 
133
134 # sources for a test program
135 # list of libraries to link against for a test program
136 asdcp_mem_test_SOURCES = asdcp-mem-test.cpp
137 asdcp_mem_test_LDADD = libasdcp.la
138 path_test_SOURCES = path-test.cpp
139 path_test_LDADD = libkumu.la
140 jp2k_test_SOURCES = jp2k-test.cpp
141 jp2k_test_LDADD = libasdcp.la
142 S429_5_cgi_SOURCES = S429-5-cgi.cpp
143 S429_5_cgi_LDADD = libasdcp.la
144 fips_186_rng_test_SOURCES = fips-186-rng-test.cpp
145 fips_186_rng_test_LDADD = libasdcp.la
146 asdcp_version_SOURCES = asdcp-version.cpp
147 asdcp_version_LDADD = libkumu.la
148
149
150
151 # list of test scripts to execute during "make check"
152 TESTS = rng-tst.sh gen-tst.sh \
153         jp2k-tst.sh jp2k-crypt-tst.sh jp2k-stereo-tst.sh jp2k-stereo-crypt-tst.sh \
154         wav-tst.sh wav-crypt-tst.sh mpeg-tst.sh mpeg-crypt-tst.sh
155
156 # environment variables to pass to above tests
157 TESTS_ENVIRONMENT = BUILD_DIR="." TEST_FILES=../tests TEST_FILE_PREFIX=DCPd1-M1 \
158         CRYPT_KEY=70e0de21c98fbd455ad5b8042edb41a6 CRYPT_KEY_B=aa2d05475d568cd52cb3415e65cba76f \
159         JP2K_PREFIX=MM_2k_XYZ_
160
161 # files to include in the distribution that automake doesn't automatically include
162 EXTRA_DIST = fips-186-test-harness.pl $(TESTS)
163 if PYTHON_USE
164 if !FREEDIST
165 EXTRA_DIST += $(nodist_pyexec_include_HEADERS) $(nodist_libpyasdcp_la_SOURCES) $(nodist_kumu_la_SOURCES) $(nodist_asdcp_la_SOURCES)
166 endif
167 endif
168
169 # source files that are themselves built
170 BUILT_SOURCES = Metadata.h Metadata.cpp MDD.h MDD.cpp
171 # files to be removed with "make maintainer-clean"
172 MAINTAINERCLEANFILES = Metadata.h Metadata.cpp MDD.h MDD.cpp
173
174 # build commands for built sources
175 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
176 MDD.h:
177         $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.h
178 # dependencies: $(srcdir)/ullist.pl $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml
179 MDD.cpp:
180         $(srcdir)/ullist.pl -s $(srcdir)/ULList.xml $(srcdir)/dict.xml $(srcdir)/DMS_Crypto.xml > MDD.cpp
181 # dependencies: $(srcdir)/Metadata_h.tt2 $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl
182 Metadata.h:
183         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_h.tt2 > Metadata.h
184 # dependencies:  Metadata.h $(srcdir)/Metadata_cpp.tt2
185 Metadata.cpp:
186         $(srcdir)/mxfgen.pl $(srcdir)/MXF_def.pl $(srcdir)/Metadata_cpp.tt2 > Metadata.cpp
187
188 #
189 #
190 #