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>
*.la
*.lo
*.so
+*.dll
+*.dylib
+*.exe
.deps
.libs
Makefile
--- /dev/null
+# FLAC - Free Lossless Audio Codec
+# Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
+#
+# This file is part the FLAC project. FLAC is comprised of several
+# components distributed under difference licenses. The codec libraries
+# are distributed under Xiph.Org's BSD-like license (see the file
+# COPYING.Xiph in this distribution). All other programs, libraries, and
+# plugins are distributed under the GPL (see COPYING.GPL). The documentation
+# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
+# FLAC distribution contains at the top the terms under which it may be
+# distributed.
+#
+# Since this particular file is relevant to all components of FLAC,
+# it may be distributed under the Xiph.Org license, which is the least
+# restrictive of those mentioned above. See the file COPYING.Xiph in this
+# distribution.
+
+flac: libFLAC share
+libFLAC++: libFLAC
+metaflac: libFLAC share
+plugin_common: libFLAC
+plugin_xmms: libFLAC plugin_common
+share: libFLAC
+test_grabbag: share
+test_libs_common: libFLAC
+test_libFLAC++: libFLAC libFLAC++ test_libs_common
+test_libFLAC: libFLAC test_libs_common
+test_seeking: libFLAC
+test_streams: libFLAC
+flacdiff: libFLAC libFLAC++
+flactimer: libFLAC libFLAC++
+utils: flacdiff flactimer
topdir = .
-.PHONY: all doc src examples libFLAC libFLAC++ share plugin_common plugin_xmms flac metaflac test_grabbag test_libFLAC test_libFLAC++ test_seeking test_streams
+.PHONY: all doc src examples libFLAC libFLAC++ share plugin_common plugin_xmms flac metaflac test_grabbag test_libFLAC test_libFLAC++ test_seeking test_streams utils flacdiff flactimer
all: doc src examples
DEFAULT_CONFIG = release
doc:
(cd $@ && $(MAKE) -f Makefile.lite)
-src:
+src examples:
(cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
-examples: src
- (cd $@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-libFLAC:
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-libFLAC++: libFLAC
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-share: libFLAC
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-flac: libFLAC share
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-metaflac: libFLAC share
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-plugin_common: libFLAC
+libFLAC libFLAC++ share flac metaflac plugin_common plugin_xmms test_libs_common test_seeking test_streams test_grabbag test_libFLAC test_libFLAC++:
(cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-plugin_xmms: libFLAC plugin_common
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-test_seeking: libFLAC
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-test_streams: libFLAC
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-test_grabbag: share
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-test_libFLAC: libFLAC
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
-
-test_libFLAC++: libFLAC libFLAC++
- (cd src/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
+flacdiff flactimer:
+ (cd src/utils/$@ && $(MAKE) -f Makefile.lite $(CONFIG))
test: debug
(cd test && $(MAKE) -f Makefile.lite debug)
-(cd src && $(MAKE) -f Makefile.lite clean)
-(cd examples && $(MAKE) -f Makefile.lite clean)
-(cd test && $(MAKE) -f Makefile.lite clean)
+
+examples: libFLAC libFLAC++ share
+include $(topdir)/Makefile.deps
%.debug.o %.release.o : %.s
ifeq ($(OS),Darwin)
- #$(CC) -c -arch ppc -Wall -force_cpusubtype_ALL $< -o $@
- $(AS) -arch ppc -force_cpusubtype_ALL $< -o $@
+ #$(CC) -c -arch $(PROC) -Wall -force_cpusubtype_ALL $< -o $@
+ $(AS) -arch $(PROC) -force_cpusubtype_ALL $< -o $@
else
$(AS) $< -o $@
endif
%.debug.pic.o %.release.pic.o : %.s
ifeq ($(OS),Darwin)
- #$(CC) -c -arch ppc -Wall -force_cpusubtype_ALL $< -o $@
- $(AS) -arch ppc -force_cpusubtype_ALL $< -o $@
+ #$(CC) -c -arch $(PROC) -Wall -force_cpusubtype_ALL $< -o $@
+ $(AS) -arch $(PROC) -force_cpusubtype_ALL $< -o $@
else
$(AS) $< -o $@
endif
# distribution.
#
+# customizable settings from the make invocation
+#
+
+USE_OGG ?= 1
+USE_ICONV ?= 1
+
+#
# debug/release selection
#
DEFAULT_BUILD = release
-# returns i386, x86_64, powerpc, etc.
-PROC := $(shell uname -p)
# returns Linux, Darwin, FreeBSD, etc.
-OS := $(shell uname -s)
+ifdef OS_OVERRIDE
+ OS := $(OS_OVERRIDE)
+else
+ OS := $(shell uname -s)
+endif
+# returns i386, x86_64, powerpc, etc.
+ifdef PROC_OVERRIDE
+ PROC := $(PROC_OVERRIDE)
+else
+ ifeq ($(findstring MINGW,$(OS)),MINGW)
+ PROC := i386 # failsafe
+ # ifeq (mingw32,$(shell gcc -dumpmachine)) # MinGW (mainline): mingw32
+ ifeq ($(findstring i686,$(shell gcc -dumpmachine)),i686) # MinGW-w64: i686-w64-mingw32
+ USE_ICONV := 0
+ else ifeq ($(findstring x86_64,$(shell gcc -dumpmachine)),x86_64) # MinGW-w64: x86_64-w64-mingw32
+ USE_ICONV := 0
+ PROC := x86_64
+ endif
+ else
+ PROC := $(shell uname -p)
+ endif
+endif
+ifeq ($(PROC),powerpc)
+ PROC := ppc
+endif
debug : BUILD = debug
valgrind : BUILD = debug
# override LINKAGE on OS X until we figure out how to get 'cc -static' to work
ifeq ($(OS),Darwin)
-LINKAGE =
+LINKAGE = -arch $(PROC)
else
debug : LINKAGE = -static
valgrind : LINKAGE = -dynamic
VERSION=\"1.2.1\"
+CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_CXX_VARARRAYS -DHAVE_LANGINFO_CODESET -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+
ifeq ($(OS),Darwin)
-CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_ICONV -DHAVE_CXX_VARARRAYS -DHAVE_LANGINFO_CODESET -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFLAC__SYS_DARWIN -DWORDS_BIGENDIAN
+ CONFIG_CFLAGS += -DFLAC__SYS_DARWIN -arch $(PROC)
+else
+ CONFIG_CFLAGS += -DHAVE_SOCKLEN_T
+endif
+
+ifeq ($(PROC),ppc)
+ CONFIG_CFLAGS += -DWORDS_BIGENDIAN=1
+else
+ CONFIG_CFLAGS += -DWORDS_BIGENDIAN=0
+endif
+
+ifneq (0,$(USE_ICONV))
+ CONFIG_CFLAGS += -DHAVE_ICONV
+ ICONV_LIBS = -liconv
+else
+ ICONV_LIBS =
+endif
+
+ifneq (0,$(USE_OGG))
+ CONFIG_CFLAGS += -DFLAC__HAS_OGG=1
+ OGG_INCLUDES = -I$(OGG_INCLUDE_DIR)
+ OGG_EXPLICIT_LIBS = $(OGG_LIB_DIR)/libogg.a
+ OGG_LIBS = -L$(OGG_LIB_DIR) -logg
+ OGG_SRCS = $(OGG_SRCS_C)
else
-CONFIG_CFLAGS=-DHAVE_STDINT_H -DHAVE_ICONV -DHAVE_CXX_VARARRAYS -DHAVE_LANGINFO_CODESET -DHAVE_SOCKLEN_T -DFLAC__HAS_OGG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ CONFIG_CFLAGS += -DFLAC__HAS_OGG=0
+ OGG_INCLUDES =
+ OGG_EXPLICIT_LIBS =
+ OGG_LIBS =
+ OGG_SRCS =
endif
OGG_INCLUDE_DIR=$(HOME)/local/include
include $(topdir)/build/config.mk
ifeq ($(OS),Darwin)
-CC = cc
-CCC = c++
+ CC = cc
+ CCC = c++
else
-CC = gcc
-CCC = g++
+ CC = gcc
+ CCC = g++
endif
NASM = nasm
LINK = $(CC) $(LINKAGE)
include $(topdir)/build/config.mk
ifeq ($(OS),Darwin)
-CC = cc
-CCC = c++
+ CC = cc
+ CCC = c++
else
-CC = gcc
-CCC = g++
+ CC = gcc
+ CCC = g++
endif
AS = as
NASM = nasm
DEBUG_LIBPATH = $(OBJPATH)/debug/lib
RELEASE_LIBPATH = $(OBJPATH)/release/lib
ifeq ($(OS),Darwin)
-STATIC_LIB_SUFFIX = a
-DYNAMIC_LIB_SUFFIX = dylib
+ STATIC_LIB_SUFFIX = a
+ DYNAMIC_LIB_SUFFIX = dylib
+else ifeq ($(findstring MINGW,$(OS)),MINGW)
+ STATIC_LIB_SUFFIX = a
+ DYNAMIC_LIB_SUFFIX = dll
else
-STATIC_LIB_SUFFIX = a
-DYNAMIC_LIB_SUFFIX = so
+ STATIC_LIB_SUFFIX = a
+ DYNAMIC_LIB_SUFFIX = so
endif
STATIC_LIB_NAME = $(LIB_NAME).$(STATIC_LIB_SUFFIX)
DYNAMIC_LIB_NAME = $(LIB_NAME).$(DYNAMIC_LIB_SUFFIX)
RELEASE_STATIC_LIB = $(RELEASE_LIBPATH)/$(STATIC_LIB_NAME)
RELEASE_DYNAMIC_LIB = $(RELEASE_LIBPATH)/$(DYNAMIC_LIB_NAME)
ifeq ($(OS),Darwin)
-LINKD = $(CC) -dynamiclib -flat_namespace -undefined suppress -install_name $(DYNAMIC_LIB)
+ LINKD = $(CC) -dynamiclib -flat_namespace -undefined suppress -install_name $(DYNAMIC_LIB)
else
-LINKD = $(CC) -shared
+ LINKD = $(CC) -shared
endif
debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -W -Wall -Wmissing-prototypes -Wstrict-prototypes -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lFLAC $(OGG_LIBS) -lm
endif
SRCS_C = main.c
INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lFLAC $(OGG_LIBS) -lm
endif
SRCS_C = main.c
INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
endif
SRCS_CPP = main.cpp
INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
endif
SRCS_CPP = main.cpp
include $(topdir)/build/config.mk
ifeq ($(OS),Darwin)
-EXTRA_TARGETS =
+ EXTRA_TARGETS =
else
ifeq ($(PROC),x86_64)
-EXTRA_TARGETS =
+ EXTRA_TARGETS =
else
-EXTRA_TARGETS = plugin_xmms
+ EXTRA_TARGETS = plugin_xmms
endif
endif
-.PHONY: all flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams
-all: flac libFLAC libFLAC++ metaflac plugin_common $(EXTRA_TARGETS) share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams
+.PHONY: all flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams utils flacdiff flactimer
+all: flac libFLAC libFLAC++ metaflac plugin_common $(EXTRA_TARGETS) share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams utils
DEFAULT_CONFIG = release
valgrind: all
release : all
+all: flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams utils
+
flac libFLAC libFLAC++ metaflac plugin_common plugin_xmms share test_grabbag test_libs_common test_libFLAC test_libFLAC++ test_seeking test_streams:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
+flacdiff flactimer:
+ (cd utils/$@ ; $(MAKE) -f Makefile.lite $(CONFIG))
+
clean:
-(cd flac ; $(MAKE) -f Makefile.lite clean)
-(cd libFLAC ; $(MAKE) -f Makefile.lite clean)
-(cd test_libFLAC++ ; $(MAKE) -f Makefile.lite clean)
-(cd test_seeking ; $(MAKE) -f Makefile.lite clean)
-(cd test_streams ; $(MAKE) -f Makefile.lite clean)
+ -(cd utils/flacdiff ; $(MAKE) -f Makefile.lite clean)
+ -(cd utils/flactimer ; $(MAKE) -f Makefile.lite clean)
-flac: libFLAC share
-libFLAC++: libFLAC
-metaflac: libFLAC share
-plugin_common: libFLAC
-plugin_xmms: libFLAC plugin_common
-share: libFLAC
-test_grabbag: share
-test_libFLAC++: libFLAC libFLAC++ test_libs_common
-test_libFLAC: libFLAC test_libs_common
-test_seeking: libFLAC
-test_streams: libFLAC
+include $(topdir)/Makefile.deps
flac_LDADD = \
$(top_builddir)/src/share/utf8/libutf8.la \
+ $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
- $(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
$(top_builddir)/src/share/replaygain_synthesis/libreplaygain_synthesis.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
@OGG_LIBS@ \
PROGRAM_NAME = flac
-INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
+INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_LIB_DIR)/libogg.a -liconv -lm
+ EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm
else
-LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lreplaygain_synthesis -lgetopt -lutf8 -lgrabbag $(OGG_LIBS) -lm
endif
SRCS_C = \
PROGRAM_NAME = iffscan
-INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
+INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
-ifeq ($(DARWIN_BUILD),yes)
-EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -liconv -lm
+ifeq ($(OS),Darwin)
+ EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm
else
-LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lFLAC $(OGG_LIBS) -lm
endif
SRCS_C = \
#
topdir = ../..
+libdir = $(topdir)/obj/$(BUILD)/lib
+
+ifeq ($(OS),Darwin)
+ EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm -lstdc++
+else
+ LIBS = -lFLAC $(OGG_LIBS) -lm -lsupc++
+endif
LIB_NAME = libFLAC++
INCLUDES = -I$(topdir)/include
topdir = ../..
-LIB_NAME = libFLAC
ifeq ($(OS),Darwin)
-DEFINES = -DFLAC__CPU_PPC -DFLAC__USE_ALTIVEC -DFLAC__ALIGN_MALLOC_DATA
+ EXPLICIT_LIBS = $(OGG_EXPLICIT_LIBS) -lm
+else
+ LIBS = $(OGG_LIBS) -lm
+endif
+
+LIB_NAME = libFLAC
+ifeq ($(PROC),ppc)
+ DEFINES = -DFLAC__CPU_PPC -DFLAC__USE_ALTIVEC -DFLAC__ALIGN_MALLOC_DATA
else
ifeq ($(OS),Solaris)
-DEFINES = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA
+ DEFINES = -DFLAC__NO_ASM -DFLAC__ALIGN_MALLOC_DATA
else
ifeq ($(PROC),i386)
-DEFINES = -DFLAC__CPU_IA32 -DFLAC__USE_3DNOW -DFLAC__HAS_NASM -DFLAC__ALIGN_MALLOC_DATA
+ DEFINES = -DFLAC__CPU_IA32 -DFLAC__USE_3DNOW -DFLAC__HAS_NASM -DFLAC__ALIGN_MALLOC_DATA
else
-DEFINES = -DFLAC__ALIGN_MALLOC_DATA
+ DEFINES = -DFLAC__ALIGN_MALLOC_DATA
endif
endif
endif
-INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
+INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
DEBUG_CFLAGS = -DFLAC__OVERFLOW_DETECT
ifeq ($(OS),Darwin)
endif
endif
+OGG_SRCS_C = \
+ ogg_decoder_aspect.c \
+ ogg_encoder_aspect.c \
+ ogg_helper.c \
+ ogg_mapping.c
+
SRCS_C = \
bitmath.c \
bitreader.c \
memory.c \
metadata_iterators.c \
metadata_object.c \
- ogg_decoder_aspect.c \
- ogg_encoder_aspect.c \
- ogg_helper.c \
- ogg_mapping.c \
stream_decoder.c \
stream_encoder.c \
stream_encoder_framing.c \
- window.c
+ window.c \
+ $(OGG_SRCS)
include $(topdir)/build/lib.mk
#elif defined(__GNUC__)
#define copysign __builtin_copysign
#endif
-static inline long int lround(double x) {
+inline long int lround(double x) {
return (long)(x + copysign (0.5, x));
}
//If this fails, we are in the precence of a mid 90's compiler..move along...
metaflac_LDFLAGS =
metaflac_LDADD = \
- $(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/replaygain_analysis/libreplaygain_analysis.la \
+ $(top_builddir)/src/share/grabbag/libgrabbag.la \
$(top_builddir)/src/share/getopt/libgetopt.a \
$(top_builddir)/src/share/utf8/libutf8.la \
$(top_builddir)/src/libFLAC/libFLAC.la \
PROGRAM_NAME = metaflac
-INCLUDES = -I./include -I$(topdir)/include -I$(OGG_INCLUDE_DIR)
+INCLUDES = -I./include -I$(topdir)/include $(OGG_INCLUDES)
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_LIB_DIR)/libogg.a -liconv -lm
+ EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(libdir)/libgetopt.a $(libdir)/libutf8.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm
else
-LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lgetopt -lutf8 -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lgrabbag -lFLAC -lreplaygain_analysis -lgetopt -lutf8 -lgrabbag $(OGG_LIBS) -lm
endif
SRCS_C = \
#
topdir = ../..
+libdir = $(topdir)/obj/$(BUILD)/lib
LIB_NAME = libxmms-flac
INCLUDES = -I./include -I$(topdir)/include -I.. $(shell xmms-config --cflags)
# refer to the static libs explicitly
ifeq ($(OS),Darwin)
-LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a $(OGG_LIB_DIR)/libogg.a -liconv -lstdc++ -lz
+ LIBS = $(libdir)/libFLAC.a $(libdir)/libplugin_common.a $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(OGG_EXPLICIT_LIBS) $(ICONV_LIBS) -lm -lstdc++ -lz
else
-LIBS = $(topdir)/obj/$(BUILD)/lib/libFLAC.a $(topdir)/obj/$(BUILD)/lib/libplugin_common.a $(topdir)/obj/$(BUILD)/lib/libgrabbag.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_analysis.a $(topdir)/obj/$(BUILD)/lib/libreplaygain_synthesis.a -L$(OGG_LIB_DIR) -logg -lstdc++ -lz
+ LIBS = $(libdir)/libFLAC.a $(libdir)/libplugin_common.a $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libreplaygain_synthesis.a $(OGG_LIBS) -lm -lsupc++ -lz
endif
SRCS_C = \
# distribution.
.PHONY: all getopt grabbag replaygain_analysis replaygain_synthesis utf8
-all: getopt grabbag replaygain_analysis replaygain_synthesis utf8
+all: getopt replaygain_analysis grabbag replaygain_synthesis utf8
DEFAULT_CONFIG = release
getopt:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
-grabbag:
+replaygain_analysis:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
-replaygain_analysis:
+grabbag:
(cd $@ ; $(MAKE) -f Makefile.lite $(CONFIG))
replaygain_synthesis:
#
topdir = ../../..
+libdir = $(topdir)/obj/$(BUILD)/lib
+
+ifeq ($(OS),Darwin)
+ EXPLICIT_LIBS = $(libdir)/libFLAC.a $(libdir)/libreplaygain_analysis.a $(OGG_EXPLICIT_LIBS) -lm
+else
+ LIBS = -lFLAC -lreplaygain_analysis $(OGG_LIBS) -lm
+endif
LIB_NAME = libgrabbag
INCLUDES = -I$(topdir)/include
SRCS_C = \
+ alloc.c \
cuesheet.c \
file.c \
picture.c \
#
topdir = ../../..
+libdir = $(topdir)/obj/$(BUILD)/lib
LIB_NAME = libutf8
+
+ifeq ($(OS),Darwin)
+ EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(ICONV_LIBS)
+else
+ LIBS = -lgrabbag $(ICONV_LIBS)
+endif
+
INCLUDES = -I$(topdir)/include -I$(topdir)/include/share
SRCS_C = \
INCLUDES = -I./include -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lgrabbag -lreplaygain_analysis -lFLAC $(OGG_LIBS) -lm
endif
SRCS_C = \
INCLUDES = -I./include -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lgrabbag -lreplaygain_analysis -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lgrabbag -lreplaygain_analysis -lFLAC $(OGG_LIBS) -lm
endif
SRCS_C = \
INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC++ -lFLAC $(OGG_LIBS) -lm
endif
SRCS_CPP = \
INCLUDES = -I../libFLAC/include -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libgrabbag.a $(libdir)/libreplaygain_analysis.a $(libdir)/libtest_libs_common.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lgrabbag -lreplaygain_analysis -ltest_libs_common -lFLAC $(OGG_LIBS) -lm
endif
SRCS_C = \
LIB_NAME = libtest_libs_common
+ifeq ($(OS),Darwin)
+ EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
+else
+ LIBS = -lFLAC $(OGG_LIBS) -lm
+endif
+
INCLUDES = -I$(topdir)/include
SRCS_C = \
INCLUDES = -I../libFLAC/include -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lFLAC $(OGG_LIBS) -lm
endif
SRCS_C = \
INCLUDES = -I$(topdir)/include
ifeq ($(OS),Darwin)
-EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_LIB_DIR)/libogg.a -lm
+ EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
else
-LIBS = -lFLAC++ -lFLAC -L$(OGG_LIB_DIR) -logg -lm
+ LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
endif
SRCS_CPP = \
--- /dev/null
+# flactimer - Runs a command and prints timing information
+# Copyright (C) 2007,2008,2009 Josh Coalson
+#
+# 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.
+#
+# 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.
+
+#
+# GNU makefile
+#
+
+topdir = ../../..
+libdir = $(topdir)/obj/$(BUILD)/lib
+
+PROGRAM_NAME = flactimer
+
+INCLUDES = -I$(topdir)/include
+
+ifeq ($(OS),Darwin)
+ EXPLICIT_LIBS = $(libdir)/libFLAC++.a $(libdir)/libFLAC.a $(OGG_EXPLICIT_LIBS) -lm
+else
+ LIBS = -lFLAC++ -lFLAC $(OGG_LIBS) -lm
+endif
+
+SRCS_CPP = \
+ main.cpp
+
+include $(topdir)/build/exe.mk
+
+LINK = $(CCC) $(LINKAGE)
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.