#
#  delicate-volman - DeLi(cate) Linux Volume Manager
#  Copyright (C) 2013 Jaromir Capik <tavvva@email.cz>
#
#  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 3 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/>.
#

APPNAME = delicate-volman
TARGET_BIN_DIR = $(DESTDIR)/usr/bin
TARGET_DATA_DIR = $(DESTDIR)/usr/share/$(APPNAME)
COMPILER = gcc
GTK_FLAGS=`pkg-config --cflags --libs gtk+-2.0`

all: $(APPNAME) $(APPNAME)-backend

$(APPNAME) : $(APPNAME).c
	$(COMPILER) -Wall -pedantic $(GTK_FLAGS) $(CFLAGS) -o $(APPNAME) $(APPNAME).c

$(APPNAME)-backend : $(APPNAME)-backend.c
	$(COMPILER) -Wall -pedantic $(CFLAGS) -o $(APPNAME)-backend $(APPNAME)-backend.c

.PHONY: install
install : $(APPNAME)
	install -d $(TARGET_BIN_DIR)
	install -m755 $(APPNAME) $(TARGET_BIN_DIR)
	install -m4755 $(APPNAME)-backend $(TARGET_BIN_DIR)
	install -d $(TARGET_DATA_DIR)
	install -m644 *.png $(TARGET_DATA_DIR)

.PHONY: clean
clean :
	rm -f $(APPNAME)
	rm -f $(APPNAME)-backend
