2007-09-12 02:42:05 +00:00
|
|
|
# example_c_decode_file - Simple FLAC file decoder using libFLAC
|
2013-05-25 17:11:19 +10:00
|
|
|
# Copyright (C) 2007-2009 Josh Coalson
|
2014-11-24 22:07:15 +11:00
|
|
|
# Copyright (C) 2011-2014 Xiph.Org Foundation
|
2007-09-12 02:42:05 +00:00
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
|
# of the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
2012-12-04 17:36:05 +01:00
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2007-09-12 02:42:05 +00:00
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# GNU makefile
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
topdir = ../../../..
|
2015-10-29 14:22:12 +01:00
|
|
|
|
|
|
|
|
include $(topdir)/build/config.mk
|
2013-01-02 22:37:42 +11:00
|
|
|
libdir = $(topdir)/objs/$(BUILD)/lib
|
2007-09-12 02:42:05 +00:00
|
|
|
|
|
|
|
|
PROGRAM_NAME = example_c_decode_file
|
|
|
|
|
|
2007-09-12 05:34:36 +00:00
|
|
|
INCLUDES = -I$(topdir)/include
|
2007-09-12 02:42:05 +00:00
|
|
|
|
2008-09-14 19:59:52 +00:00
|
|
|
ifeq ($(OS),Darwin)
|
Fix building with MSYS and MinGW(-w64); Improve Makefile.lite build system
This is a patch to allow building of the project using MSYS, MinGW, and MinGW-w64 with the following invocation:
make -f Makefile.lite libFLAC libFLAC++ flac metaflac test_libs_common test_libFLAC test_libFLAC++ test_grabbag test_seeking test_streams utils examples
This patch addresses eight points:
1. `uname -p` in MSYS returns "unknown" so we must use `gcc -dumpmachine` to gain information about the target, 32-bit or 64-bit.
2. MinGW-w64 does not ship with a working iconv.h, so we must disable it under this specific compiler.
3. The code requires <inttypes.h> in a handful of C files, but config.mk did not contain -DHAVE_INTTYPES_H, which under the full build process (I assume) is added by autoconf.
4. The compiler complained when lround() in lpc.c was static, so it is no longer static.
5. Additional scattered linking directives (and reordering) (particularly FLAC, grabbag, and replaygain_analysis) were necessary to build some of the components.
6. The Makefile.lite build system benefited from some cleanup, particularly by rigorously defining all entries, factoring redundancy, and establishing dependencies. (Some typos were fixed too.)
7. Shared objects on Windows use .dll, not .so. (Added *.dll, *.dylib, and *.exe to .gitignore.)
8. To allow more freedom using Makefile.lite without configure, I added the variables USE_OGG and USE_ICONV which can toggle these two components in the build process.
ex: make -f Makefile.lite examples USE_OGG=0 USE_ICONV=0
These improvements make use of some use-time Makefile variable expansion.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-12-29 04:22:59 -06:00
|
|
|
EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
|
2007-09-12 02:42:05 +00:00
|
|
|
else
|
Fix building with MSYS and MinGW(-w64); Improve Makefile.lite build system
This is a patch to allow building of the project using MSYS, MinGW, and MinGW-w64 with the following invocation:
make -f Makefile.lite libFLAC libFLAC++ flac metaflac test_libs_common test_libFLAC test_libFLAC++ test_grabbag test_seeking test_streams utils examples
This patch addresses eight points:
1. `uname -p` in MSYS returns "unknown" so we must use `gcc -dumpmachine` to gain information about the target, 32-bit or 64-bit.
2. MinGW-w64 does not ship with a working iconv.h, so we must disable it under this specific compiler.
3. The code requires <inttypes.h> in a handful of C files, but config.mk did not contain -DHAVE_INTTYPES_H, which under the full build process (I assume) is added by autoconf.
4. The compiler complained when lround() in lpc.c was static, so it is no longer static.
5. Additional scattered linking directives (and reordering) (particularly FLAC, grabbag, and replaygain_analysis) were necessary to build some of the components.
6. The Makefile.lite build system benefited from some cleanup, particularly by rigorously defining all entries, factoring redundancy, and establishing dependencies. (Some typos were fixed too.)
7. Shared objects on Windows use .dll, not .so. (Added *.dll, *.dylib, and *.exe to .gitignore.)
8. To allow more freedom using Makefile.lite without configure, I added the variables USE_OGG and USE_ICONV which can toggle these two components in the build process.
ex: make -f Makefile.lite examples USE_OGG=0 USE_ICONV=0
These improvements make use of some use-time Makefile variable expansion.
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
2012-12-29 04:22:59 -06:00
|
|
|
LIBS = -lFLAC $(OGG_LIBS) -lm
|
2007-09-12 02:42:05 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
SRCS_C = main.c
|
|
|
|
|
|
|
|
|
|
include $(topdir)/build/exe.mk
|
|
|
|
|
|
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|