

#This file is part of the Variseq program.
#Variseq -- a variable pitch and step sample sequencer
#Copyright (C) 2004  Robert Atwood r.atwood (at) imperial (dot) ac (dot) uk
#
#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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 
#See the file COPYING for more information
.suffixes:
.suffixes: .C .o
CXX=g++
#sometimes fltk is in here (suse)

INCFLAGS:='-I/usr/X11R6/include'

#DEPEND rule copied from gnu make manual
%.d: %.C
	set -e; $(CXX) -MM $(CXXFLAGS) ${INCFLAGS} $< \
| sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
[ -s $@ ] || rm -f $@

%.o: %.C
	$(CXX) $(CXXFLAGS) -I/usr/X11R6/include $(INCFLAGS) -Wall  -c $<

SOURCES=replace.C player.C stretch.C notes.C pattern.C slider.C myFl.C callbacks.C samples.C

OBJECTS=$(SOURCES:.C=.o)
DEPEND=$(SOURCES:.C=.d)


LDFLAGS=-L/usr/X11R6/lib -L/usr/X11R6/lib64 -L/usr/local/lib
LDLIBS=   -lfltk -lX11 -ldl -lc  -lpthread -lsndfile  -lsamplerate -lm $(AUDIO_OUTLIB)
default : variseq

$(OBJECTS) : Makefile

include $(DEPEND)

debug: clean vdeb
new: clean variseq

variseq: $(OBJECTS) 
	$(CXX)  $(CXXFLAGS) -Wall  -o $@  $(OBJECTS) $(LDFLAGS) $(LDLIBS)
variseq_static: $(OBJECTS) 
	$(CXX)  $(CXXFLAGS) -Wall  -o $@  $(OBJECTS) $(LDFLAGS) $(LDLIBS) -static

vdeb: $(SOURCES) 
	$(CXX)  -g3 $(CXXFLAGS)   -o $@  $(SOURCES) $(LDFLAGS) $(LDLIBS) -lefence

clean:
	rm -f *.o; rm -f variseq; rm -f vdeb; rm -f core*

depclean: clean
	rm -f $(DEPEND)
