# ----------------------------------------------------------------------------
#
#  Copyright (C) 2006-2018 Fons Adriaensen <fons@linuxaudio.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, see <http://www.gnu.org/licenses/>.
#
# ----------------------------------------------------------------------------


PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin


VERSION = 0.1.0
CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPREFIX=\"$(PREFIX)\" 
CPPFLAGS += $(shell pkgconf --cflags freetype2)
CXXFLAGS += -O2 -Wall -ffast-math
CXXFLAGS += -march=native
LDLIBS += -lclthreads -lclxclient -ljack -lpthread -lXft -lX11 -lrt


YASS_O = ringbuff.o jclient.o mainwin.o styles.o yass.o
YASS_H = ringbuff.h jclient.h mainwin.h styles.h
yass:	$(YASS_O)
	$(CXX) $(LDFLAGS) -o yass $(YASS_O) $(LDLIBS)
$(YASS_O):	$(YASS_H)


install:	yass
	install -d $(DESTDIR)$(BINDIR)
	install -m 755 yass $(DESTDIR)$(BINDIR)


uninstall:
	rm -rf $(DESTDIR)$(BINDIR)/yass


clean:
	/bin/rm -f *~ *.o *.a *.so yass

