# $Id: Makefile,v 1.14 2004/10/21 09:11:42 steve Exp $

# Command Line Front-end for Robert Leslie's `libmad' mp3 decoder.
# Copyright (C) 2001-2004 Steve Woodford.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */

PROG=	mad123
SRCS=	mad123.c mp3_stream.c audio_dev.c
SRCS+=	audio_dev_sun.c audio_dev_pcm.c

BINDIR?=/usr/local/bin

MKLINT=	no

USE_CURL?=yes
USE_TAGLIB?=yes
USE_ID3LIB?=no
USE_ARTS?=no

.if ${USE_CURL} != "no"
CURLLIB= -lcurl
EXTRALIBS+= -lssl -lcrypto
.else
CPPFLAGS+= -DNOCURL
.endif

.if ${USE_TAGLIB} != "no"
TAGLIB= -ltag_c
.else
CPPFLAGS+= -DNOTAGLIB

.if ${USE_ID3LIB} != "no"
ID3LIB= -lid3
EXTRALIBS+= -lstdc++ -lz
.else
CPPFLAGS+= -DNOID3LIB
.endif
.endif	# USE_TAGLIB

.if ${USE_ARTS} != "no"
ARTSLIB= -lartsc
SRCS+=	audio_dev_arts.c
.else
CPPFLAGS+= -DNOARTS
.endif

CPPFLAGS+= -I/usr/pkg/include
LDFLAGS+= -L/usr/pkg/lib -R/usr/pkg/lib
LDADD+= -lmad ${CURLLIB} ${TAGLIB} ${ID3LIB} ${ARTSLIB} ${EXTRALIBS}

USETOOLS=no

.include <bsd.prog.mk>
