Josh Coalson | 6b05bc5 | 2001-06-08 00:13:21 +0000 | [diff] [blame] | 1 | # 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 Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 18 | # |
| 19 | # GNU makefile fragment for building a library |
| 20 | # |
| 21 | |
| 22 | CC = gcc |
Josh Coalson | 955a767 | 2001-05-03 02:24:39 +0000 | [diff] [blame] | 23 | NASM = nasm |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 24 | LINK = ar cru |
| 25 | LINKD = ld -G |
| 26 | LIBPATH = ../../obj/lib |
| 27 | STATIC_LIB = $(LIBPATH)/$(LIB_NAME).a |
| 28 | DYNAMIC_LIB = $(LIBPATH)/$(LIB_NAME).so |
| 29 | |
| 30 | all : release |
| 31 | |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 32 | include ../../build/config.mk |
| 33 | |
| 34 | debug : CFLAGS = -g -O0 -DDEBUG $(DEBUG_CFLAGS) -Wall -W -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) |
Josh Coalson | 9bab041 | 2001-07-20 23:44:35 +0000 | [diff] [blame] | 35 | release : CFLAGS = -O3 -fomit-frame-pointer -funroll-loops -finline-functions -DNDEBUG $(RELEASE_CFLAGS) -Wall -W -Winline -DFLaC__INLINE=__inline__ -DVERSION=$(VERSION) $(DEFINES) $(INCLUDES) |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 36 | |
| 37 | LFLAGS = -L$(LIBPATH) |
| 38 | |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 39 | debug : $(ORDINALS_H) $(STATIC_LIB) $(DYNAMIC_LIB) |
| 40 | release : $(ORDINALS_H) $(STATIC_LIB) $(DYNAMIC_LIB) |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 41 | |
| 42 | $(STATIC_LIB) : $(OBJS) |
| 43 | $(LINK) $@ $(OBJS) |
| 44 | |
| 45 | $(DYNAMIC_LIB) : $(OBJS) |
| 46 | $(LINKD) -o $@ $(OBJS) $(LFLAGS) $(LIBS) |
| 47 | |
| 48 | %.o : %.c |
| 49 | $(CC) $(CFLAGS) -c $< -o $@ |
| 50 | %.i : %.c |
| 51 | $(CC) $(CFLAGS) -E $< -o $@ |
| 52 | |
Josh Coalson | 2255848 | 2001-06-13 18:04:47 +0000 | [diff] [blame] | 53 | %.o : %.nasm |
Josh Coalson | 1162f18 | 2001-06-19 06:48:21 +0000 | [diff] [blame] | 54 | $(NASM) -f elf -d OBJ_FORMAT_elf -i ia32/ $< -o $@ |
Josh Coalson | 955a767 | 2001-05-03 02:24:39 +0000 | [diff] [blame] | 55 | |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 56 | .PHONY : clean |
| 57 | clean : |
Josh Coalson | 6ca4b1b | 2001-06-29 02:54:59 +0000 | [diff] [blame] | 58 | -rm -f $(OBJS) $(STATIC_LIB) $(DYNAMIC_LIB) $(ORDINALS_H) |
Josh Coalson | bb7f6b9 | 2000-12-10 04:09:52 +0000 | [diff] [blame] | 59 | |
| 60 | .PHONY : depend |
| 61 | depend: |
| 62 | makedepend -- $(CFLAGS) $(INCLUDES) -- *.c |