# Copyright (C)  2006  Daniele Zelante

# This file is part of copyblock.
# 
# copyblock 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.
# 
# copyblock 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 copyblock; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#@LICENSE
# $Id: GNUmakefile,v 1.6 2006/08/20 10:33:09 zeldan Exp $

PREFIX ?= /usr/local

TARGET := copyblock
VERSION := 0.1.6


CPPFLAGS := -DVERSION=\"$(VERSION)\" -D_REENTRANT -D_FILE_OFFSET_BITS=64
CXXFLAGS := -Wall -Wextra -O2
LDFLAGS := -s

TBDIR := $(TARGET)-$(subst :,_,$(VERSION))


all: $(TARGET)

$(TARGET) : copyblock.cxx
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $<


install: $(TARGET)
	install $(TARGET) $(PREFIX)/bin
	install *.sh $(PREFIX)/bin


tarball:
	mkdir -p $(TBDIR)
	cp -l configure Makefile GNUmakefile INSTALL README TODO *.cxx *.sh $(TBDIR)/
	tar zcf $(TBDIR).tar.gz $(TBDIR)
	$(RM) -r $(TBDIR)
	
	
	

.PHONY: clean
clean:
	$(RM) $(TARGET)



