#
# dvdspanky makefile - a makefile for dvdspanky
# Copyright (C) 2007  Jeffrey Grembecki
#
# 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.
#

include make.include

CC=gcc
CXX=g++
CFLAGS=-O2 -c -Wall $(INCCFLAGS)
LIBS=$(INCLIBS)

all: dvdspanky

dvdspanky.o: dvdspanky.c config.h
	$(CC) $(CFLAGS) dvdspanky.c -o dvdspanky.o

dvdspanky: dvdspanky.o
	$(CC) dvdspanky.o -o dvdspanky $(LIBS) -s

install: dvdspanky
	install -m 755 dvdspanky -D $(DESTDIR)$(PREFIX)/bin/dvdspanky
	gzip -c dvdspanky.1 > dvdspanky.1.gz
	install -m 644 dvdspanky.1.gz -D $(DESTDIR)$(PREFIX)/man/man1/dvdspanky.1.gz
clean:
	rm -f *.o dvdspanky dvdspanky.1.gz
dist:
	rm -rf dvdspanky-$(VERSION)
	mkdir dvdspanky-$(VERSION)
	cp dvdspanky.c Makefile configure dvdspanky.1 LICENCE CHANGELOG README dvdspanky-$(VERSION)/
	fakeroot tar -zcf dvdspanky-$(VERSION).tar.gz dvdspanky-$(VERSION)/*
	rm -rf dvdspanky-$(VERSION)
	md5sum dvdspanky-$(VERSION).tar.gz

