/*
 * @(#)Imakefile	2.17 94/02/15
 *
 * Imakefile for xmcd
 *
 *   xmcd - Motif(tm) CD Audio Player
 *
 *   Copyright (C) 1994  Ti Kan
 *   E-mail: ti@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


/*
 * If your local X configuration supports Motif correctly, the
 * following LOCAL_LIBRARIES= declaration should work just fine.
 * If it fails, try uncommenting the #include lines below.  If that
 * still fails, then substitute the LOCAL_LIBRARIES= line with
 * one of the these:
 *
 * LOCAL_LIBRARIES= $(XMLIB) $(XTOOLLIB) $(XLIB)
 *
 * or,
 *
 * LOCAL_LIBRARIES= -lXm -lXt -lXext -lX11
 *
 */

/*
 * #include "Motif.tmpl"
 * #include "Motif.rules"
 */
LOCAL_LIBRARIES= XmClientLibs


/**** 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>
 *
 * -DUSE_SYMLINK
 *	Use symbolic links instead of hard links in the CD database
 *	to implement the LINK feature (see the xmcd man page).
 *
 * -DSOL2_RSENSE
 *	Whether to include code that makes use of the auto request-sense
 *	feature in Solaris 2.2 or later.  This option is unused under
 *	other OS platforms.
 *
 * -DDEMO_ONLY
 *	Build a simulated, demo-only version of xmcd.
 *
 * -DCHINON
 *	Include Chinon SCSI-1 vendor-unique command support.
 *
 * -DHITACHI
 *	Include Hitachi SCSI-1 vendor-unique command support.
 *
 * -DNEC
 *	Include NEC SCSI-1 vendor-unique command support.
 *
 * -DPIONEER
 *	Include Pioneer SCSI-1 vendor-unique command support.
 *
 * -DSONY
 *	Include Sony SCSI-1 vendor-unique command support.
 *
 * -DTOSHIBA
 *	Include Toshiba SCSI-1 vendor-unique command support.
 *
 */
#if defined(SYSTYPE_BSD43) || defined(BSD43) || defined(BSD) || \
    defined(OsfArchitecture) || \
    (defined(SunArchitecture) && OSMajorVersion == 4)
DEFINES= -DBSDCOMPAT -DCHINON -DHITACHI -DNEC -DPIONEER -DSONY -DTOSHIBA
#else
DEFINES= -DCHINON -DHITACHI -DNEC -DPIONEER -DSONY -DTOSHIBA
#endif


/*
 * Target directory definitions
 *
 * Uncomment BINDIR and LIBDIR and modify if you want to use non-default
 * values.
 */

/*
 * BINDIR=   /usr/bin/X11
 * LIBDIR=   /usr/lib/X11
 */



/*
 * Redefine InstallProgram because we want to use our own install script
 */
#if defined(ultrix) || defined(__ultrix)
SHELL=/bin/sh5
#else
SHELL=/bin/sh
#endif

#ifdef InstallProgram
#undef InstallProgram
#define InstallProgram(program, dest)					@@\
install:: program							@@\
	@BINDIR=$(BINDIR) LIBDIR=$(LIBDIR) MANFILE=ManDir/program.ManSuffix \
		$(SHELL) ./install.sh -n
#endif


/*
 * C Source files
 */
SRCS=	ac_cdfunc.c \
	ac_dbprog.c \
	ac_geom.c \
	ac_help.c \
	ac_hotkey.c \
	ac_main.c \
	ac_util.c \
	ac_widget.c \
	di_scsipt.c \
	os_aix.c \
	os_dec.c \
	os_hpux.c \
	os_irix.c \
	os_linux.c \
	os_odt.c \
	os_sun.c \
	os_svr4.c \
	os_demo.c \
	os_cdsim.c \
	vu_chin.c \
	vu_hita.c \
	vu_nec.c \
	vu_pion.c \
	vu_sony.c \
	vu_tosh.c

/*
 * Main module objects
 */
OBJS=	ac_cdfunc.o \
	ac_dbprog.o \
	ac_geom.o \
	ac_help.o \
	ac_hotkey.o \
	ac_main.o \
	ac_util.o \
	ac_widget.o \
	di_lib.a

/*
 * DIS module objects
 */
LOBJS=	di_scsipt.o \
	os_aix.o \
	os_dec.o \
	os_hpux.o \
	os_irix.o \
	os_linux.o \
	os_odt.o \
	os_sun.o \
	os_svr4.o \
	os_demo.o \
	os_cdsim.o \
	vu_chin.o \
	vu_hita.o \
	vu_nec.o \
	vu_pion.o \
	vu_sony.o \
	vu_tosh.o


/*
 * Source subdirectory management
 */
#define IHaveSubdirs
SUBDIRS=wm2xmcd


/*
 * Build rule for the main module
 */
ComplexProgramTarget(xmcd)


/*
 * Build rule for subdirectories
 */
#define PassCDebugFlags
MakeSubdirs($(SUBDIRS))


/*
 * Build rule for the DIS module library
 */
di_lib.a:	$(LOBJS)
	rm -f di_lib.a; $(AR) di_lib.a $(LOBJS)
	$(RANLIB) di_lib.a

$(LOBJS):
	$(CC) $(CFLAGS) -c $*.c



