1 # FLAC - Free Lossless Audio Codec
2 # Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008,2009 Josh Coalson
4 # This file is part the FLAC project. FLAC is comprised of several
5 # components distributed under difference licenses. The codec libraries
6 # are distributed under Xiph.Org's BSD-like license (see the file
7 # COPYING.Xiph in this distribution). All other programs, libraries, and
8 # plugins are distributed under the GPL (see COPYING.GPL). The documentation
9 # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
10 # FLAC distribution contains at the top the terms under which it may be
13 # Since this particular file is relevant to all components of FLAC,
14 # it may be distributed under the Xiph.Org license, which is the least
15 # restrictive of those mentioned above. See the file COPYING.Xiph in this
19 # customizable settings from the make invocation
26 # debug/release selection
29 DEFAULT_BUILD
= release
31 # returns Linux, Darwin, FreeBSD, etc.
35 OS
:= $(shell uname
-s
)
37 # returns i386, x86_64, powerpc, etc.
39 PROC
:= $(PROC_OVERRIDE
)
41 ifeq ($(findstring MINGW
,$(OS
)),MINGW
)
42 PROC
:= i386
# failsafe
43 # ifeq (mingw32,$(shell gcc -dumpmachine)) # MinGW (mainline): mingw32
44 ifeq ($(findstring i686
,$(shell gcc
-dumpmachine
)),i686
) # MinGW-w64: i686-w64-mingw32
46 else ifeq ($(findstring x86_64
,$(shell gcc
-dumpmachine
)),x86_64
) # MinGW-w64: x86_64-w64-mingw32
51 PROC
:= $(shell uname
-p
)
54 ifeq ($(PROC
),powerpc
)
59 PROC
:= $(shell uname
-m
)
64 valgrind
: BUILD
= debug
65 release
: BUILD
= release
67 # override LINKAGE on OS X until we figure out how to get 'cc -static' to work
69 LINKAGE
= -arch
$(PROC
)
71 debug
: LINKAGE
= -static
72 valgrind
: LINKAGE
= -dynamic
73 release
: LINKAGE
= -static
76 all default
: $(DEFAULT_BUILD
)
79 # GNU makefile fragment for emulating stuff normally done by configure
84 CONFIG_CFLAGS
=-DHAVE_STDINT_H
-DHAVE_INTTYPES_H
-DHAVE_CXX_VARARRAYS
-DHAVE_LANGINFO_CODESET
-D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS
=64
87 CONFIG_CFLAGS
+= -DFLAC__SYS_DARWIN
-arch
$(PROC
)
89 CONFIG_CFLAGS
+= -DHAVE_SOCKLEN_T
93 CONFIG_CFLAGS
+= -DWORDS_BIGENDIAN
=1
95 CONFIG_CFLAGS
+= -DWORDS_BIGENDIAN
=0
100 CONFIG_CFLAGS
+= -fPIC
104 ifneq (0,$(USE_ICONV
))
105 CONFIG_CFLAGS
+= -DHAVE_ICONV
112 CONFIG_CFLAGS
+= -DFLAC__HAS_OGG
=1
113 OGG_INCLUDES
= -I
$(OGG_INCLUDE_DIR
)
114 OGG_EXPLICIT_LIBS
= $(OGG_LIB_DIR
)/libogg.a
115 OGG_LIBS
= -L
$(OGG_LIB_DIR
) -logg
116 OGG_SRCS
= $(OGG_SRCS_C
)
118 CONFIG_CFLAGS
+= -DFLAC__HAS_OGG
=0
125 OGG_INCLUDE_DIR
=$(HOME
)/local
/include
126 OGG_LIB_DIR
=$(HOME
)/local
/lib