annotate src/flac-1.2.1/build/exe.mk @ 1:05aa0afa9217

Bring in flac, ogg, vorbis
author Chris Cannam
date Tue, 19 Mar 2013 17:37:49 +0000
parents
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 an executable
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 NASM = nasm
Chris@1 32 LINK = $(CC) $(LINKAGE)
Chris@1 33 OBJPATH = $(topdir)/obj
Chris@1 34 BINPATH = $(OBJPATH)/$(BUILD)/bin
Chris@1 35 LIBPATH = $(OBJPATH)/$(BUILD)/lib
Chris@1 36 DEBUG_BINPATH = $(OBJPATH)/debug/bin
Chris@1 37 DEBUG_LIBPATH = $(OBJPATH)/debug/lib
Chris@1 38 RELEASE_BINPATH = $(OBJPATH)/release/bin
Chris@1 39 RELEASE_LIBPATH = $(OBJPATH)/release/lib
Chris@1 40 PROGRAM = $(BINPATH)/$(PROGRAM_NAME)
Chris@1 41 DEBUG_PROGRAM = $(DEBUG_BINPATH)/$(PROGRAM_NAME)
Chris@1 42 RELEASE_PROGRAM = $(RELEASE_BINPATH)/$(PROGRAM_NAME)
Chris@1 43
Chris@1 44 debug : CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -W -Wall -Wmissing-prototypes -Wstrict-prototypes -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
Chris@1 45 valgrind: CFLAGS = -g -O0 -DDEBUG $(CONFIG_CFLAGS) $(DEBUG_CFLAGS) -DFLAC__VALGRIND_TESTING -W -Wall -Wmissing-prototypes -Wstrict-prototypes -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
Chris@1 46 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 47
Chris@1 48 LFLAGS = -L$(LIBPATH)
Chris@1 49
Chris@1 50 DEBUG_OBJS = $(SRCS_C:%.c=%.debug.o) $(SRCS_CC:%.cc=%.debug.o) $(SRCS_CPP:%.cpp=%.debug.o) $(SRCS_NASM:%.nasm=%.debug.o)
Chris@1 51 RELEASE_OBJS = $(SRCS_C:%.c=%.release.o) $(SRCS_CC:%.cc=%.release.o) $(SRCS_CPP:%.cpp=%.release.o) $(SRCS_NASM:%.nasm=%.release.o)
Chris@1 52
Chris@1 53 debug : $(DEBUG_PROGRAM)
Chris@1 54 valgrind: $(DEBUG_PROGRAM)
Chris@1 55 release : $(RELEASE_PROGRAM)
Chris@1 56
Chris@1 57 # by default on OS X we link with static libs as much as possible
Chris@1 58
Chris@1 59 $(DEBUG_PROGRAM) : $(DEBUG_OBJS)
Chris@1 60 ifeq ($(DARWIN_BUILD),yes)
Chris@1 61 $(LINK) -o $@ $(DEBUG_OBJS) $(EXPLICIT_LIBS)
Chris@1 62 else
Chris@1 63 $(LINK) -o $@ $(DEBUG_OBJS) $(LFLAGS) $(LIBS)
Chris@1 64 endif
Chris@1 65
Chris@1 66 $(RELEASE_PROGRAM) : $(RELEASE_OBJS)
Chris@1 67 ifeq ($(DARWIN_BUILD),yes)
Chris@1 68 $(LINK) -o $@ $(RELEASE_OBJS) $(EXPLICIT_LIBS)
Chris@1 69 else
Chris@1 70 $(LINK) -o $@ $(RELEASE_OBJS) $(LFLAGS) $(LIBS)
Chris@1 71 endif
Chris@1 72
Chris@1 73 %.debug.o %.release.o : %.c
Chris@1 74 $(CC) $(CFLAGS) -c $< -o $@
Chris@1 75 %.debug.o %.release.o : %.cc
Chris@1 76 $(CCC) $(CFLAGS) -c $< -o $@
Chris@1 77 %.debug.o %.release.o : %.cpp
Chris@1 78 $(CCC) $(CFLAGS) -c $< -o $@
Chris@1 79 %.debug.i %.release.i : %.c
Chris@1 80 $(CC) $(CFLAGS) -E $< -o $@
Chris@1 81 %.debug.i %.release.i : %.cc
Chris@1 82 $(CCC) $(CFLAGS) -E $< -o $@
Chris@1 83 %.debug.i %.release.i : %.cpp
Chris@1 84 $(CCC) $(CFLAGS) -E $< -o $@
Chris@1 85
Chris@1 86 %.debug.o : %.nasm
Chris@1 87 $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ -g $< -o $@
Chris@1 88 %.release.o : %.nasm
Chris@1 89 $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ $< -o $@
Chris@1 90
Chris@1 91 .PHONY : clean
Chris@1 92 clean :
Chris@1 93 -rm -f $(DEBUG_OBJS) $(RELEASE_OBJS) $(OBJPATH)/*/bin/$(PROGRAM_NAME)
Chris@1 94
Chris@1 95 .PHONY : depend
Chris@1 96 depend:
Chris@1 97 makedepend -fMakefile.lite -- $(CFLAGS) $(INCLUDES) -- *.c *.cc *.cpp