annotate src/flac-1.2.1/build/lib.mk @ 83:ae30d91d2ffe

Replace these with versions built using an older toolset (so as to avoid ABI compatibilities when linking on Ubuntu 14.04 for packaging purposes)
author Chris Cannam
date Fri, 07 Feb 2020 11:51:13 +0000
parents 05aa0afa9217
children
rev   line source
Chris@1 1 # FLAC - Free Lossless Audio Codec
Chris@1 2 # Copyright (C) 2001,2002,2003,2004,2005,2006,2007 Josh Coalson
Chris@1 3 #
Chris@1 4 # This file is part the FLAC project. FLAC is comprised of several
Chris@1 5 # components distributed under difference licenses. The codec libraries
Chris@1 6 # are distributed under Xiph.Org's BSD-like license (see the file
Chris@1 7 # COPYING.Xiph in this distribution). All other programs, libraries, and
Chris@1 8 # plugins are distributed under the GPL (see COPYING.GPL). The documentation
Chris@1 9 # is distributed under the Gnu FDL (see COPYING.FDL). Each file in the
Chris@1 10 # FLAC distribution contains at the top the terms under which it may be
Chris@1 11 # distributed.
Chris@1 12 #
Chris@1 13 # Since this particular file is relevant to all components of FLAC,
Chris@1 14 # it may be distributed under the Xiph.Org license, which is the least
Chris@1 15 # restrictive of those mentioned above. See the file COPYING.Xiph in this
Chris@1 16 # distribution.
Chris@1 17
Chris@1 18 #
Chris@1 19 # GNU makefile fragment for building a library
Chris@1 20 #
Chris@1 21
Chris@1 22 include $(topdir)/build/config.mk
Chris@1 23
Chris@1 24 ifeq ($(DARWIN_BUILD),yes)
Chris@1 25 CC = cc
Chris@1 26 CCC = c++
Chris@1 27 else
Chris@1 28 CC = gcc
Chris@1 29 CCC = g++
Chris@1 30 endif
Chris@1 31 AS = as
Chris@1 32 NASM = nasm
Chris@1 33 LINK = ar cru
Chris@1 34 OBJPATH = $(topdir)/obj
Chris@1 35 LIBPATH = $(OBJPATH)/$(BUILD)/lib
Chris@1 36 DEBUG_LIBPATH = $(OBJPATH)/debug/lib
Chris@1 37 RELEASE_LIBPATH = $(OBJPATH)/release/lib
Chris@1 38 ifeq ($(DARWIN_BUILD),yes)
Chris@1 39 STATIC_LIB_SUFFIX = a
Chris@1 40 DYNAMIC_LIB_SUFFIX = dylib
Chris@1 41 else
Chris@1 42 STATIC_LIB_SUFFIX = a
Chris@1 43 DYNAMIC_LIB_SUFFIX = so
Chris@1 44 endif
Chris@1 45 STATIC_LIB_NAME = $(LIB_NAME).$(STATIC_LIB_SUFFIX)
Chris@1 46 DYNAMIC_LIB_NAME = $(LIB_NAME).$(DYNAMIC_LIB_SUFFIX)
Chris@1 47 STATIC_LIB = $(LIBPATH)/$(STATIC_LIB_NAME)
Chris@1 48 DYNAMIC_LIB = $(LIBPATH)/$(DYNAMIC_LIB_NAME)
Chris@1 49 DEBUG_STATIC_LIB = $(DEBUG_LIBPATH)/$(STATIC_LIB_NAME)
Chris@1 50 DEBUG_DYNAMIC_LIB = $(DEBUG_LIBPATH)/$(DYNAMIC_LIB_NAME)
Chris@1 51 RELEASE_STATIC_LIB = $(RELEASE_LIBPATH)/$(STATIC_LIB_NAME)
Chris@1 52 RELEASE_DYNAMIC_LIB = $(RELEASE_LIBPATH)/$(DYNAMIC_LIB_NAME)
Chris@1 53 ifeq ($(DARWIN_BUILD),yes)
Chris@1 54 LINKD = $(CC) -dynamiclib -flat_namespace -undefined suppress -install_name $(DYNAMIC_LIB)
Chris@1 55 else
Chris@1 56 LINKD = $(CC) -shared
Chris@1 57 endif
Chris@1 58
Chris@1 59 debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -W -Wall -Wmissing-prototypes -Wstrict-prototypes -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
Chris@1 60 valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -W -Wall -Wmissing-prototypes -Wstrict-prototypes -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
Chris@1 61 release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(CONFIG_CFLAGS) $(RELEASE_CFLAGS) -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
Chris@1 62
Chris@1 63 LFLAGS = -L$(LIBPATH)
Chris@1 64
Chris@1 65 DEBUG_OBJS = $(SRCS_C:%.c=%.debug.o) $(SRCS_CC:%.cc=%.debug.o) $(SRCS_CPP:%.cpp=%.debug.o) $(SRCS_NASM:%.nasm=%.debug.o) $(SRCS_S:%.s=%.debug.o)
Chris@1 66 RELEASE_OBJS = $(SRCS_C:%.c=%.release.o) $(SRCS_CC:%.cc=%.release.o) $(SRCS_CPP:%.cpp=%.release.o) $(SRCS_NASM:%.nasm=%.release.o) $(SRCS_S:%.s=%.release.o)
Chris@1 67
Chris@1 68 debug : $(DEBUG_STATIC_LIB) $(DEBUG_DYNAMIC_LIB)
Chris@1 69 valgrind: $(DEBUG_STATIC_LIB) $(DEBUG_DYNAMIC_LIB)
Chris@1 70 release : $(RELEASE_STATIC_LIB) $(RELEASE_DYNAMIC_LIB)
Chris@1 71
Chris@1 72 $(DEBUG_STATIC_LIB): $(DEBUG_OBJS)
Chris@1 73 $(LINK) $@ $(DEBUG_OBJS) && ranlib $@
Chris@1 74
Chris@1 75 $(RELEASE_STATIC_LIB): $(RELEASE_OBJS)
Chris@1 76 $(LINK) $@ $(RELEASE_OBJS) && ranlib $@
Chris@1 77
Chris@1 78 $(DEBUG_DYNAMIC_LIB) : $(DEBUG_OBJS)
Chris@1 79 ifeq ($(DARWIN_BUILD),yes)
Chris@1 80 echo Not building dynamic lib, command is: $(LINKD) -o $@ $(DEBUG_OBJS) $(LFLAGS) $(LIBS) -lc
Chris@1 81 else
Chris@1 82 $(LINKD) -o $@ $(DEBUG_OBJS) $(LFLAGS) $(LIBS)
Chris@1 83 endif
Chris@1 84
Chris@1 85 $(RELEASE_DYNAMIC_LIB) : $(RELEASE_OBJS)
Chris@1 86 ifeq ($(DARWIN_BUILD),yes)
Chris@1 87 echo Not building dynamic lib, command is: $(LINKD) -o $@ $(RELEASE_OBJS) $(LFLAGS) $(LIBS) -lc
Chris@1 88 else
Chris@1 89 $(LINKD) -o $@ $(RELEASE_OBJS) $(LFLAGS) $(LIBS)
Chris@1 90 endif
Chris@1 91
Chris@1 92 %.debug.o %.release.o : %.c
Chris@1 93 $(CC) $(CFLAGS) -c $< -o $@
Chris@1 94 %.debug.o %.release.o : %.cc
Chris@1 95 $(CCC) $(CFLAGS) -c $< -o $@
Chris@1 96 %.debug.o %.release.o : %.cpp
Chris@1 97 $(CCC) $(CFLAGS) -c $< -o $@
Chris@1 98 %.debug.i %.release.i : %.c
Chris@1 99 $(CC) $(CFLAGS) -E $< -o $@
Chris@1 100 %.debug.i %.release.i : %.cc
Chris@1 101 $(CCC) $(CFLAGS) -E $< -o $@
Chris@1 102 %.debug.i %.release.i : %.cpp
Chris@1 103 $(CCC) $(CFLAGS) -E $< -o $@
Chris@1 104
Chris@1 105 %.debug.o %.release.o : %.s
Chris@1 106 ifeq ($(DARWIN_BUILD),yes)
Chris@1 107 #$(CC) -c -arch ppc -Wall -force_cpusubtype_ALL $< -o $@
Chris@1 108 $(AS) -arch ppc -force_cpusubtype_ALL $< -o $@
Chris@1 109 else
Chris@1 110 $(AS) $< -o $@
Chris@1 111 endif
Chris@1 112
Chris@1 113 %.debug.o : %.nasm
Chris@1 114 $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ -g $< -o $@
Chris@1 115 %.release.o : %.nasm
Chris@1 116 $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ $< -o $@
Chris@1 117
Chris@1 118 .PHONY : clean
Chris@1 119 clean :
Chris@1 120 -rm -f $(DEBUG_OBJS) $(RELEASE_OBJS) $(OBJPATH)/*/lib/$(STATIC_LIB_NAME) $(OBJPATH)/*/lib/$(DYNAMIC_LIB_NAME)
Chris@1 121
Chris@1 122 .PHONY : depend
Chris@1 123 depend:
Chris@1 124 makedepend -fMakefile.lite -- $(CFLAGS) $(INCLUDES) -- *.c *.cc *.cpp