blob: 20f087ba5210452ab1ce0e862e10e63f0939c89c [file] [log] [blame]
Josh Coalson6b05bc52001-06-08 00:13:21 +00001# FLAC - Free Lossless Audio Codec
2# Copyright (C) 2001 Josh Coalson
3#
4# This program is part of FLAC; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License
6# as published by the Free Software Foundation; either version 2
7# of the License, or (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
Josh Coalsonbb7f6b92000-12-10 04:09:52 +000018#
19# GNU makefile fragment for building an executable
20#
21
Josh Coalson955a7672001-05-03 02:24:39 +000022CC = gcc
23NASM = nasm
Josh Coalsonbb7f6b92000-12-10 04:09:52 +000024# LINKAGE can be forced to -static or -dynamic from invocation if desired, but it defaults to -static
Josh Coalson955a7672001-05-03 02:24:39 +000025LINKAGE = -static
26LINK = gcc $(LINKAGE)
27BINPATH = ../../obj/bin
28LIBPATH = ../../obj/lib
29PROGRAM = $(BINPATH)/$(PROGRAM_NAME)
Josh Coalsonbb7f6b92000-12-10 04:09:52 +000030
31all : release
32
Josh Coalson6ca4b1b2001-06-29 02:54:59 +000033include ../../build/config.mk
34
35debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
36release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -ffast-math -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES)
Josh Coalsonbb7f6b92000-12-10 04:09:52 +000037
38LFLAGS = -L$(LIBPATH)
39
Josh Coalson6ca4b1b2001-06-29 02:54:59 +000040debug : $(ORDINALS_H) $(PROGRAM)
41release : $(ORDINALS_H) $(PROGRAM)
Josh Coalsonbb7f6b92000-12-10 04:09:52 +000042
43$(PROGRAM) : $(OBJS)
44 $(LINK) -o $@ $(OBJS) $(LFLAGS) $(LIBS)
45
46%.o : %.c
47 $(CC) $(CFLAGS) -c $< -o $@
48%.i : %.c
49 $(CC) $(CFLAGS) -E $< -o $@
50
Josh Coalson22558482001-06-13 18:04:47 +000051%.o : %.nasm
Josh Coalson1162f182001-06-19 06:48:21 +000052 $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ $< -o $@
Josh Coalson955a7672001-05-03 02:24:39 +000053
Josh Coalsonbb7f6b92000-12-10 04:09:52 +000054.PHONY : clean
55clean :
56 -rm -f $(OBJS) $(PROGRAM)
57
58.PHONY : depend
59depend:
60 makedepend -- $(CFLAGS) $(INCLUDES) -- *.c