|
Packit |
8f7830 |
# FLAC - Free Lossless Audio Codec
|
|
Packit |
8f7830 |
# Copyright (C) 2001-2009 Josh Coalson
|
|
Packit |
8f7830 |
# Copyright (C) 2011-2016 Xiph.Org Foundation
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
# This file is part the FLAC project. FLAC is comprised of several
|
|
Packit |
8f7830 |
# components distributed under different licenses. The codec libraries
|
|
Packit |
8f7830 |
# are distributed under Xiph.Org's BSD-like license (see the file
|
|
Packit |
8f7830 |
# COPYING.Xiph in this distribution). All other programs, libraries, and
|
|
Packit |
8f7830 |
# plugins are distributed under the GPL (see COPYING.GPL). The documentation
|
|
Packit |
8f7830 |
# is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
|
|
Packit |
8f7830 |
# FLAC distribution contains at the top the terms under which it may be
|
|
Packit |
8f7830 |
# distributed.
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
# Since this particular file is relevant to all components of FLAC,
|
|
Packit |
8f7830 |
# it may be distributed under the Xiph.Org license, which is the least
|
|
Packit |
8f7830 |
# restrictive of those mentioned above. See the file COPYING.Xiph in this
|
|
Packit |
8f7830 |
# distribution.
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
# customizable settings from the make invocation
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
USE_OGG ?= 1
|
|
Packit |
8f7830 |
USE_ICONV ?= 1
|
|
Packit |
8f7830 |
USE_LROUND ?= 1
|
|
Packit |
8f7830 |
USE_FSEEKO ?= 1
|
|
Packit |
8f7830 |
USE_LANGINFO_CODESET ?= 1
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
# debug/release selection
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
DEFAULT_BUILD = release
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
F_PIC := -fPIC
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
# returns Linux, Darwin, FreeBSD, etc.
|
|
Packit |
8f7830 |
ifndef OS
|
|
Packit |
8f7830 |
OS := $(shell uname -s)
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
# returns i386, x86_64, powerpc, etc.
|
|
Packit |
8f7830 |
ifndef PROC
|
|
Packit |
8f7830 |
ifeq ($(findstring Windows,$(OS)),Windows)
|
|
Packit |
8f7830 |
PROC := i386 # failsafe
|
|
Packit |
8f7830 |
# ifeq ($(findstring i686,$(shell gcc -dumpmachine)),i686) # MinGW-w64: i686-w64-mingw32
|
|
Packit |
8f7830 |
ifeq ($(findstring x86_64,$(shell gcc -dumpmachine)),x86_64) # MinGW-w64: x86_64-w64-mingw32
|
|
Packit |
8f7830 |
PROC := x86_64
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
else
|
|
Packit |
8f7830 |
ifeq ($(shell uname -p),amd64)
|
|
Packit |
8f7830 |
PROC := x86_64
|
|
Packit |
8f7830 |
else
|
|
Packit |
8f7830 |
PROC := $(shell uname -p)
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
ifeq ($(PROC),powerpc)
|
|
Packit |
8f7830 |
PROC := ppc
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
# x64_64 Mac OS outputs 'i386' in uname -p; use uname -m instead
|
|
Packit |
8f7830 |
ifeq ($(PROC),i386)
|
|
Packit |
8f7830 |
ifeq ($(OS),Darwin)
|
|
Packit |
8f7830 |
PROC := $(shell uname -m)
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifeq ($(OS),Linux)
|
|
Packit |
8f7830 |
PROC := $(shell uname -m)
|
|
Packit |
8f7830 |
USE_ICONV := 0
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifeq ($(findstring Windows,$(OS)),Windows)
|
|
Packit |
8f7830 |
F_PIC :=
|
|
Packit |
8f7830 |
USE_ICONV := 0
|
|
Packit |
8f7830 |
USE_LANGINFO_CODESET := 0
|
|
Packit |
8f7830 |
ifeq (mingw32,$(shell gcc -dumpmachine)) # MinGW (mainline): mingw32
|
|
Packit |
8f7830 |
USE_FSEEKO := 0
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
debug : BUILD = debug
|
|
Packit |
8f7830 |
valgrind : BUILD = debug
|
|
Packit |
8f7830 |
release : BUILD = release
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
# override LINKAGE on OS X until we figure out how to get 'cc -static' to work
|
|
Packit |
8f7830 |
ifeq ($(OS),Darwin)
|
|
Packit |
8f7830 |
LINKAGE = -arch $(PROC)
|
|
Packit |
8f7830 |
else
|
|
Packit |
8f7830 |
debug : LINKAGE = -static
|
|
Packit |
8f7830 |
valgrind : LINKAGE = -dynamic
|
|
Packit |
8f7830 |
release : LINKAGE = -static
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
all default: $(DEFAULT_BUILD)
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
# GNU makefile fragment for emulating stuff normally done by configure
|
|
Packit |
8f7830 |
#
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
VERSION=\"1.3.2\"
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
CONFIG_CFLAGS=$(CUSTOM_CFLAGS) -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_CXX_VARARRAYS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifeq ($(OS),Darwin)
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DFLAC__SYS_DARWIN -DHAVE_SYS_PARAM_H -arch $(PROC)
|
|
Packit |
8f7830 |
else
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DHAVE_SOCKLEN_T
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifeq ($(PROC),ppc)
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DWORDS_BIGENDIAN=1 -DCPU_IS_LITTLE_ENDIAN=0
|
|
Packit |
8f7830 |
else
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DWORDS_BIGENDIAN=0 -DCPU_IS_LITTLE_ENDIAN=1
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifeq ($(OS),Linux)
|
|
Packit |
8f7830 |
ifeq ($(PROC),x86_64)
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -fPIC
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
ifeq ($(OS),FreeBSD)
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DHAVE_SYS_PARAM_H
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifneq (0,$(USE_ICONV))
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DHAVE_ICONV
|
|
Packit |
8f7830 |
ICONV_LIBS = -liconv
|
|
Packit |
8f7830 |
else
|
|
Packit |
8f7830 |
ICONV_LIBS =
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifneq (0,$(USE_OGG))
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DFLAC__HAS_OGG=1
|
|
Packit |
8f7830 |
OGG_INCLUDES = -I$(OGG_INCLUDE_DIR)
|
|
Packit |
8f7830 |
OGG_EXPLICIT_LIBS = $(OGG_LIB_DIR)/libogg.a
|
|
Packit |
8f7830 |
OGG_LIBS = -L$(OGG_LIB_DIR) -logg
|
|
Packit |
8f7830 |
OGG_SRCS = $(OGG_SRCS_C)
|
|
Packit |
8f7830 |
else
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DFLAC__HAS_OGG=0
|
|
Packit |
8f7830 |
OGG_INCLUDES =
|
|
Packit |
8f7830 |
OGG_EXPLICIT_LIBS =
|
|
Packit |
8f7830 |
OGG_LIBS =
|
|
Packit |
8f7830 |
OGG_SRCS =
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
OGG_INCLUDE_DIR=$(HOME)/local/include
|
|
Packit |
8f7830 |
OGG_LIB_DIR=$(HOME)/local/lib
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifneq (0,$(USE_LROUND))
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DHAVE_LROUND
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifneq (0,$(USE_FSEEKO))
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DHAVE_FSEEKO
|
|
Packit |
8f7830 |
endif
|
|
Packit |
8f7830 |
|
|
Packit |
8f7830 |
ifneq (0,$(USE_LANGINFO_CODESET))
|
|
Packit |
8f7830 |
CONFIG_CFLAGS += -DHAVE_LANGINFO_CODESET
|
|
Packit |
8f7830 |
endif
|