# This Makefile is part of pas2po, version 0.2. 

# Pease change PREFIX by hand (e.g. /usr/local)
PREFIX=/usr/local


# You do not really want to change anything from here!

SOURCE=pas2po.pas
TARGET=pas2po
GPC_FLAGS=-O2 -Wall
VERSION=0.2
MANPAGE=doc/pas2po.1.gz


# build the project

all: $(SOURCE)
	gpc --automake $(GPC_FLAGS) $(SOURCE) -o $(TARGET)


# clean up garbage

mostlyclean:
	@rm -f *.o *.gpm *.gpi core

clean: mostlyclean
	@rm -f $(TARGET) 

distclean: clean

extraclean: distclean
	@rm -f *~ *.po doc/*~

maintainerclean: extraclean


# Install the project (superuser only)

install:
	cp $(TARGET) $(PREFIX)/bin
	cp $(MANPAGE) $(PREFIX)/man/man1


# build a tarball, just for the maintainer ;-)

tarball: maintainerclean
	@mkdir $(TARGET)-$(VERSION)
	@cp -fr doc $(SOURCE) Makefile README INSTALL COPYING $(TARGET)-$(VERSION)
	@tar cfz $(TARGET)-$(VERSION).tar.gz $(TARGET)-$(VERSION)/
	@rm -r $(TARGET)-$(VERSION)/

