# 
# Copyright (C) 1994 
#            Olav Woelfelschneider (wosch@rbg.informatik.th-darmstadt.de)
#
# This file is part of xplaycd
#
# 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.
#

##############################################################################
# Change this to your needs.
##############################################################################
BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man1
GIFDIR = /usr/local/pictures/multimedia
MKDIR  = mkdirhier


##############################################################################
# for debugging
##############################################################################

ifdef DEBUG
CC     = gcc
COPTS  = -g -DDEBUG_CODE
LDOPTS =
else
##############################################################################
# for final installation
##############################################################################

CC     = gcc
COPTS  = -m486 -O2 -fstrength-reduce -fomit-frame-pointer
LDOPTS = -s
endif

##############################################################################
# You should not need to change anything below
##############################################################################

all:: lib xplaycd xmixer xvumeter

lib::
	cd lib;     make COPTS='$(COPTS)' CC='$(CC)' LDOPTS='$(LDOPTS)'

xplaycd::
	cd XPlaycd; make COPTS='$(COPTS)' CC='$(CC)' LDOPTS='$(LDOPTS)'
	if [ -f XPlaycd/xplaycd ]; then mv XPlaycd/xplaycd . ; fi

xmixer::
	cd XMixer;  make COPTS='$(COPTS)' CC='$(CC)' LDOPTS='$(LDOPTS)'
	if [ -f XMixer/xmixer ];   then mv XMixer/xmixer .   ; fi

xvumeter::
	cd XVumeter;  make COPTS='$(COPTS)' CC='$(CC)' LDOPTS='$(LDOPTS)'
	if [ -f XVumeter/xvumeter ];   then mv XVumeter/xvumeter .   ; fi

clean::
	cd lib;      make clean
	cd XPlaycd;  make clean
	cd XMixer;   make clean
	cd XVumeter; make clean

depend::
	cd lib;      make depend
	cd XPlaycd;  make depend
	cd XMixer;   make depend
	cd XVumeter; make depend

install:
	-$(MKDIR) $(BINDIR)
	-$(MKDIR) $(MANDIR)
	-$(MKDIR) $(GIFDIR)
	install -c -o root -m 755 xplaycd xmixer xvumeter $(BINDIR)
	install -c -o root -m 644 XPlaycd/xplaycd.man $(MANDIR)/xplaycd.1
	install -c -o root -m 644 XMixer/xmixer.man $(MANDIR)/xmixer.1
	install -c -o root -m 644 XPlaycd/xplaycd-doc.gif $(GIFDIR)
