/*
 * @(#)Imakefile	1.12 01/04/13
 *
 * Imakefile for libcddb and libcddbkey
 *
 *	libcddb, libcddbkey - CDDB interface library for xmcd/cda
 *
 *   Copyright (C) 1993-2001  Ti Kan
 *   E-mail: xmcd@amb.org
 *
 *   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., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */


/*
 * If your local X configuration is broken, you may need to muck with
 * the following RANLIB= lines.
 * On most System V platforms RANLIB should be set to /bin/true.
 * On BSD-derived systems RANLIB should be set to ranlib.
 */
#if defined(DoRanlibCmd) && (DoRanlibCmd == NO)
RANLIB= /bin/true
#endif


/**** Optional defines:  Change as you see fit. *****************************
 *
 * -DBSDCOMPAT
 *	Compiling under BSD-derived or BSD-like OS
 *
 * -DNO_STDLIB_H
 *	The system does not support <stdlib.h>
 *
 * -DNO_UNISTD_H
 *      The system does not support <unistd.h>
 *
 * -DSOCKS
 *	Define this if your network requires that clients such as
 *	xmcd/cda to be SOCKSified in order to access an Internet server.
 *	You will also have to change to link the application with the
 *	socks library instead of the standard socket library.
 *
 * -DNOREMOTE
 *	Define this if you don't have TCP/IP and socket support.
 *	This causes libcddb to become a local-only datastore manager.
 *	Submits to CDDB merely writes to the local cache.  CDDB queries
 *	and reads are done only from this cache, and the cache will not
 *	expire.
 */
#if defined(SYSTYPE_BSD43) || defined(BSD43) || defined(BSD) || \
    defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || \
    defined(OpenBSDArchitecture) || defined(__bsdi__) || \
    defined(OsfArchitecture) || defined(sony_news) || \
    (defined(SunArchitecture) && OSMajorVersion == 4)
DEFINES= -DBSDCOMPAT
#else
DEFINES=
#endif

#if defined(__QNX__)
LIBCDDBKEY=	cddbkey3r.lib
LIBCDDBKEY1=	cddbkey13r.lib
LIBCDDBKEY2=	cddbkey23r.lib
#else
LIBCDDBKEY=	libcddbkey.a
LIBCDDBKEY1=	libcddbkey1.a
LIBCDDBKEY2=	libcddbkey2.a
#endif

/*
 * Add local include path
 */
INCLUDES=-I..

/*
 * C Source files
 */
SRCS=	control.c \
	credit.c \
	disc.c \
	discs.c \
	fcddb.c \
	fullname.c \
	gen.c \
	genre.c \
	genrelist.c \
	genretree.c \
	options.c \
	region.c \
	regionlist.c \
	role.c \
	rolelist.c \
	roletree.c \
	segment.c \
	track.c \
	url.c \
	urllist.c \
	urlmanager.c \
	userinfo.c \
	cddbkey1.c


/*
 * Objects files for libcddb
 */
OBJS=	control.o \
	credit.o \
	disc.o \
	discs.o \
	fcddb.o \
	fullname.o \
	gen.o \
	genre.o \
	genrelist.o \
	genretree.o \
	options.o \
	region.o \
	regionlist.o \
	role.o \
	rolelist.o \
	roletree.o \
	segment.o \
	track.o \
	url.o \
	urllist.o \
	urlmanager.o \
	userinfo.o

/*
 * Objects file for libcddbkey1
 */
KOBJ=	cddbkey1.o


/*
 * Build rule for the CD Information Library
 */
NormalLibraryTarget(cddb,$(OBJS))
NormalLibraryTarget(cddbkey1,$(KOBJ))
DependTarget()

$(LIBCDDBKEY2): cddbkey2.o
	$(RM) $@
	$(AR) $@ cddbkey2.o
	$(RANLIB) $@

all::
	@$(RM) $(LIBCDDBKEY)
	@if [ -f $(LIBCDDBKEY2) ]; \
	then $(LN) $(LIBCDDBKEY2) $(LIBCDDBKEY); \
	else $(LN) $(LIBCDDBKEY1) $(LIBCDDBKEY); \
	fi

