1##
2## libmad - MPEG audio decoder library
3## Copyright (C) 2000-2004 Underbit Technologies, Inc.
4##
5## This program is free software; you can redistribute it and/or modify
6## it under the terms of the GNU General Public License as published by
7## the Free Software Foundation; either version 2 of the License, or
8## (at your option) any later version.
9##
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13## GNU General Public License for more details.
14##
15## You should have received a copy of the GNU General Public License
16## along with this program; if not, write to the Free Software
17## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18##
19## $Id: Makefile.am,v 1.23 2004/02/17 02:02:03 rob Exp $
20##
21
22## Process this file with automake to produce Makefile.in
23
24SUBDIRS =
25DIST_SUBDIRS =		msvc++
26
27lib_LTLIBRARIES =	libmad.la
28include_HEADERS =	mad.h
29
30EXTRA_PROGRAMS =	minimad
31
32minimad_SOURCES =	minimad.c
33minimad_INCLUDES =
34minimad_LDADD =		libmad.la
35
36EXTRA_DIST =		mad.h.sed  \
37			CHANGES COPYRIGHT CREDITS README TODO VERSION
38
39exported_headers =	version.h fixed.h bit.h timer.h stream.h frame.h  \
40			synth.h decoder.h
41
42headers =		$(exported_headers)  \
43			global.h layer12.h layer3.h huffman.h
44
45data_includes =		D.dat imdct_s.dat qc_table.dat rq_table.dat  \
46			sf_table.dat
47
48libmad_la_SOURCES =	version.c fixed.c bit.c timer.c stream.c frame.c  \
49			synth.c decoder.c layer12.c layer3.c huffman.c  \
50			$(headers) $(data_includes)
51
52EXTRA_libmad_la_SOURCES =	imdct_l_arm.S #synth_mmx.S
53
54libmad_la_DEPENDENCIES =	@ASO_OBJS@
55libmad_la_LIBADD =		@ASO_OBJS@
56
57INCLUDES =		$(FPM) $(ASO)
58
59BUILT_SOURCES =		mad.h
60CLEANFILES =		mad.h
61
62## From the libtool documentation on library versioning:
63##
64## CURRENT
65##      The most recent interface number that this library implements.
66##
67## REVISION
68##      The implementation number of the CURRENT interface.
69##
70## AGE
71##      The difference between the newest and oldest interfaces that this
72##      library implements.  In other words, the library implements all the
73##      interface numbers in the range from number `CURRENT - AGE' to
74##      `CURRENT'.
75##
76##    If two libraries have identical CURRENT and AGE numbers, then the
77## dynamic linker chooses the library with the greater REVISION number.
78##
79##   1. Start with version information of `0:0:0' for each libtool library.
80##
81##   2. Update the version information only immediately before a public
82##      release of your software.  More frequent updates are unnecessary,
83##      and only guarantee that the current interface number gets larger
84##      faster.
85##
86##   3. If the library source code has changed at all since the last
87##      update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
88##
89##   4. If any interfaces have been added, removed, or changed since the
90##      last update, increment CURRENT, and set REVISION to 0.
91##
92##   5. If any interfaces have been added since the last public release,
93##      then increment AGE.
94##
95##   6. If any interfaces have been removed since the last public release,
96##      then set AGE to 0.
97
98version_current =	2
99version_revision =	1
100version_age =		2
101
102version_info =		$(version_current):$(version_revision):$(version_age)
103
104libmad_la_LDFLAGS =	-version-info $(version_info)
105
106mad.h: config.status config.h Makefile.am  \
107		$(srcdir)/COPYRIGHT $(srcdir)/mad.h.sed $(exported_headers)
108	(sed -e '1s|.*|/*|' -e '1b' -e '$$s|.*| */|' -e '$$b'  \
109		-e 's/^.*/ *&/' $(srcdir)/COPYRIGHT; echo;  \
110	echo "# ifdef __cplusplus";  \
111	echo 'extern "C" {';  \
112	echo "# endif"; echo;  \
113	if [ ".$(FPM)" != "." ]; then  \
114		echo ".$(FPM)" | sed -e 's|^\.-D|# define |'; echo;  \
115	fi;  \
116	sed -ne 's/^# *define  *\(HAVE_.*_ASM\).*/# define \1/p'  \
117		config.h; echo;  \
118	sed -ne 's/^# *define  *OPT_\(SPEED\|ACCURACY\).*/# define OPT_\1/p'  \
119		config.h; echo;  \
120	sed -ne 's/^# *define  *\(SIZEOF_.*\)/# define \1/p'  \
121		config.h; echo;  \
122	for header in $(exported_headers); do  \
123		echo;  \
124		sed -n -f $(srcdir)/mad.h.sed $(srcdir)/$$header;  \
125	done; echo;  \
126	echo "# ifdef __cplusplus";  \
127	echo '}';  \
128	echo "# endif") >$@
129
130libtool: $(LIBTOOL_DEPS)
131	$(SHELL) ./config.status --recheck
132
133.c.s:
134	$(COMPILE) -S $<
135
136again:
137	$(MAKE) clean
138	$(MAKE)
139
140.PHONY: again
141