/*
 * Imakefile
 *
 * Copyright (C) 1996-1998 Satoshi KURAMOCHI <satoshi@ueda.info.waseda.ac.jp>
 *
 * 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.
 */

/* $Id: Imakefile,v 1.5 1998-04-08 17:26:07+09 satoshi Exp $ */

#include "../Local.config"
#include "../.version"

PROGRAMS = xmidisel

#ifdef Use_Xaw3d
XAWLIB = -lXaw3d
DEFS += -DUse_Xaw3d
#endif

#ifdef Use_Kanji
DEFS += -DKANJI
KCONVOBJ = ../kconv.o
KCONVSRC = ../kconv.cc
#endif

DEFINES = $(DEFS) -DVERSION=\"$(VERSION)\" \
          -DEPLAYMIDIPATH=\"$(EPLAYMIDIDIR)\" -DFMPATCHPATH=\"$(FMPATCHDIR)\" \
          $(PROTO_DEFINES)
CXXEXTRA_DEFINES = $(DEFINES)
CXXEXTRA_INCLUDES = -I..
/*CXXEXTRA_INCLUDES = -I/usr/local/include/g++*/

#ifdef Have_getopt
DEFS += -DHAVE_GETOPT_H
#else
GETOPT_SRCS = ../getopt.c ../getopt1.c
GETOPT_OBJS = ../getopt.o ../getopt1.o
#endif

#ifdef FreeBSDArchitecture
SYS_LIBRARIES += -lcompat -lxpg4
#endif

#ifdef DEBUG
CXXDEBUGFLAGS = -g -O2 -pedantic -Wall -pipe \
		/*-fno-default-inline -fkeep-inline-functions*/
#else
#ifdef DISTMAKE
CXXDEBUGFLAGS = -V 2.8.2 -b i586-unknown-linuxlibc1 -m486 \
		-O2 -Wall -pedantic -pipe -s
#else
CXXDEBUGFLAGS = -O6 -Wall -pipe -s
#endif
#endif

# in case of using gcc instead of g++
EXTRA_DEFINES = -x c++
CDEBUGFLAGS = $(CXXDEBUGFLAGS)
EXTRA_INCLUDES = $(CXXEXTRA_INCLUDES)

DEPENDFLAGS = $(CXXEXTRA_INCLUDES)

########################################################################

OBJS = main.o  xmidisel.o  menubar.o  playlist.o  filelist.o  mlist.o  \
       dir.o  fileinfo.o  ../server.o  $(KCONVOBJ) $(GETOPT_OBJS)
SRCS = main.cc xmidisel.cc menubar.cc playlist.cc filelist.cc mlist.cc \
       dir.cc fileinfo.cc ../server.cc $(KCONVSRC) $(GETOPT_SRCS)
XPMLIB = -lXpm

AllTarget($(PROGRAMS))
DependTarget()
NormalCplusplusProgramTarget(xmidisel,$(OBJS),XawClientDepLibs,XawClientLibs $(XPMLIB),$(SYS_LIBRARIES))
InstallProgram(xmidisel,$(EPLAYMIDI_BINDIR))

TAGS::
	etags -C -S $(SRCS) *.h
