blob: 7928abfd2aabfe1a3689891cafefd12a2a1c718a [file] [log] [blame]
Josh Coalson6b05bc52001-06-08 00:13:21 +00001# libFLAC - Free Lossless Audio Codec library
Josh Coalsondea0f5a2009-01-07 07:31:28 +00002# Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
Josh Coalson6b05bc52001-06-08 00:13:21 +00003#
Josh Coalsonafd81072003-01-31 23:34:56 +00004# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions
6# are met:
Josh Coalson6b05bc52001-06-08 00:13:21 +00007#
Josh Coalsonafd81072003-01-31 23:34:56 +00008# - Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer.
Josh Coalson6b05bc52001-06-08 00:13:21 +000010#
Josh Coalsonafd81072003-01-31 23:34:56 +000011# - 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#
15# - Neither the name of the Xiph.org Foundation nor the names of its
16# contributors may be used to endorse or promote products derived from
17# this software without specific prior written permission.
18#
19# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
23# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Josh Coalson6b05bc52001-06-08 00:13:21 +000030
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -030031AM_CPPFLAGS = -I$(top_builddir) -I$(srcdir)/include -I$(top_srcdir)/include
Josh Coalson9f429ba2001-01-19 22:39:39 +000032lib_LTLIBRARIES = libFLAC.la
Miroslav Lichvar19c78e52012-12-03 21:04:57 +010033noinst_LTLIBRARIES = libFLAC-static.la
Josh Coalson9f429ba2001-01-19 22:39:39 +000034if DEBUG
Josh Coalson4e003c62001-10-19 18:24:33 +000035DEBUGCFLAGS = -DFLAC__OVERFLOW_DETECT
Josh Coalson9f429ba2001-01-19 22:39:39 +000036endif
Max Horn66c0a582012-12-12 21:33:52 +010037
38# FIXME: The following logic should be part of configure, not of Makefile.am
39
Josh Coalson663c5992005-01-21 01:53:02 +000040if FLaC__CPU_PPC
41# The -force_cpusubtype_ALL is needed to insert a ppc64 instruction
42# into cpu.c with an asm().
43if FLaC__SYS_DARWIN
Josh Coalson59717c22006-10-10 00:35:35 +000044#@@@ PPC optimizations temporarily disabled
Josh Coalson63d489a2005-01-29 06:10:58 +000045CPUCFLAGS = -faltivec -force_cpusubtype_ALL -DFLAC__NO_ASM
Josh Coalson663c5992005-01-21 01:53:02 +000046else
Josh Coalson2499c562005-01-31 04:35:26 +000047# Linux-gcc for PPC does not have -force_cpusubtype_ALL, it is Darwin-specific
Erik de Castro Lopob6e64af2012-02-13 19:46:32 +110048CPUCFLAGS =
49if FLaC__CPU_PPC_SPE
50else
51CPUCFLAGS += -maltivec -mabi=altivec
52endif
Josh Coalson59717c22006-10-10 00:35:35 +000053#@@@ PPC optimizations temporarily disabled
Erik de Castro Lopob6e64af2012-02-13 19:46:32 +110054CPUCFLAGS += -DFLAC__NO_ASM
Josh Coalson663c5992005-01-21 01:53:02 +000055endif
56endif
Josh Coalson05a39842005-01-30 18:44:46 +000057
Josh Coalsond351d042006-12-14 07:23:48 +000058AM_CFLAGS = $(DEBUGCFLAGS) $(CPUCFLAGS) @OGG_CFLAGS@
Josh Coalson9f429ba2001-01-19 22:39:39 +000059
Josh Coalsonc8ef8352001-05-25 00:06:33 +000060if FLaC__NO_ASM
61else
Josh Coalsoncd66fc02001-06-18 02:34:09 +000062if FLaC__CPU_IA32
Josh Coalsone02e8ba2001-05-23 20:58:14 +000063if FLaC__HAS_NASM
Josh Coalson4c8f73a2001-07-22 07:27:45 +000064ARCH_SUBDIRS = ia32
Josh Coalsond351d042006-12-14 07:23:48 +000065LOCAL_EXTRA_LIBADD = ia32/libFLAC-asm.la
Josh Coalsonc8ef8352001-05-25 00:06:33 +000066endif
67endif
Josh Coalson31bdd702004-07-25 20:34:40 +000068if FLaC__CPU_PPC
69ARCH_SUBDIRS = ppc
Josh Coalson16eded52005-02-03 04:29:52 +000070if FLaC__HAS_AS__TEMPORARILY_DISABLED
Erik de Castro Lopob6e64af2012-02-13 19:46:32 +110071if FLaC__CPU_PPC_SPE
72else
Josh Coalsond351d042006-12-14 07:23:48 +000073LOCAL_EXTRA_LIBADD = ppc/as/libFLAC-asm.la
Josh Coalsona02b73f2005-03-02 05:21:06 +000074LOCAL_EXTRA_LDFLAGS = "-Wl,-read_only_relocs,warning"
Josh Coalsonb9900222004-12-30 01:13:03 +000075else
Josh Coalson16eded52005-02-03 04:29:52 +000076if FLaC__HAS_GAS__TEMPORARILY_DISABLED
Josh Coalsond351d042006-12-14 07:23:48 +000077LOCAL_EXTRA_LIBADD = ppc/gas/libFLAC-asm.la
Josh Coalsona02b73f2005-03-02 05:21:06 +000078LOCAL_EXTRA_LDFLAGS = ""
Josh Coalsonb9900222004-12-30 01:13:03 +000079endif
80endif
Josh Coalson31bdd702004-07-25 20:34:40 +000081endif
Josh Coalsonc8ef8352001-05-25 00:06:33 +000082endif
Erik de Castro Lopob6e64af2012-02-13 19:46:32 +110083endif
Josh Coalsonc8ef8352001-05-25 00:06:33 +000084
Cristian Rodríguez9b7cb222012-04-07 19:24:21 -030085libFLAC_la_LIBADD = $(LOCAL_EXTRA_LIBADD) @OGG_LIBS@ -lm
Josh Coalsond351d042006-12-14 07:23:48 +000086
Josh Coalson4c8f73a2001-07-22 07:27:45 +000087SUBDIRS = $(ARCH_SUBDIRS) include .
88
Josh Coalsonbfeec742002-06-28 23:45:53 +000089m4datadir = $(datadir)/aclocal
90m4data_DATA = libFLAC.m4
91
Josh Coalson07e89cc2007-02-07 01:24:15 +000092pkgconfigdir = $(libdir)/pkgconfig
93pkgconfig_DATA = flac.pc
94
Josh Coalsoncd443f62002-07-09 06:27:07 +000095EXTRA_DIST = \
96 Makefile.lite \
Josh Coalson07e89cc2007-02-07 01:24:15 +000097 flac.pc.in \
Josh Coalson4fb61322007-07-11 04:13:09 +000098 libFLAC_dynamic.vcproj \
Josh Coalson4fb61322007-07-11 04:13:09 +000099 libFLAC_static.vcproj \
Josh Coalsoncd443f62002-07-09 06:27:07 +0000100 libFLAC.m4
Josh Coalsonbfeec742002-06-28 23:45:53 +0000101
Josh Coalson8da98c82006-10-15 04:24:05 +0000102if FLaC__HAS_OGG
103extra_ogg_sources = \
104 ogg_decoder_aspect.c \
105 ogg_encoder_aspect.c \
106 ogg_helper.c \
107 ogg_mapping.c
108endif
Erik de Castro Lopod9fde552012-05-07 19:45:23 +1000109# see 'http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning' for numbering convention
Miroslav Lichvara43f56c2012-12-03 21:04:59 +0100110libFLAC_la_LDFLAGS = -version-info 11:0:3 $(LOCAL_EXTRA_LDFLAGS) @LT_NO_UNDEFINED@
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100111
112libFLAC_sources = \
Josh Coalson673976d2001-03-30 00:45:52 +0000113 bitmath.c \
Josh Coalson423f8042007-01-28 17:40:26 +0000114 bitreader.c \
115 bitwriter.c \
Josh Coalsone02e8ba2001-05-23 20:58:14 +0000116 cpu.c \
Josh Coalsonc8ef8352001-05-25 00:06:33 +0000117 crc.c \
Josh Coalsone02e8ba2001-05-23 20:58:14 +0000118 fixed.c \
Josh Coalson29a6a9d2004-11-09 01:25:44 +0000119 float.c \
Josh Coalsone02e8ba2001-05-23 20:58:14 +0000120 format.c \
121 lpc.c \
122 md5.c \
Josh Coalsonc8ef8352001-05-25 00:06:33 +0000123 memory.c \
Josh Coalson90ced912002-05-30 05:23:38 +0000124 metadata_iterators.c \
125 metadata_object.c \
Josh Coalson0a15c142001-06-13 17:59:57 +0000126 stream_decoder.c \
127 stream_encoder.c \
Josh Coalson6c088862006-05-18 07:36:34 +0000128 stream_encoder_framing.c \
Josh Coalson8da98c82006-10-15 04:24:05 +0000129 window.c \
130 $(extra_ogg_sources)
Miroslav Lichvar19c78e52012-12-03 21:04:57 +0100131
132libFLAC_la_SOURCES = $(libFLAC_sources)
133
134# needed for test_libFLAC
135libFLAC_static_la_LIBADD = $(LOCAL_EXTRA_LIBADD)
136libFLAC_static_la_SOURCES = $(libFLAC_sources)