# $Id: Makefile,v 1.8 2004/07/08 23:21:11 alpha Exp $
#
# Copyright (c) 1999-2004 Darius Rad
#
# This file is part of the OpenOtto project.
#
# OpenOtto 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.
#


-include Rules.mk


DIST_TAR=$(PACKAGE_TARNAME)_$(PACKAGE_VERSION).tar.gz
RELEASE_TAR=$(PACKAGE_TARNAME).tar.gz

default:

default:
	$(MAKE) -C src $@
	$(MAKE) -C doc $@

lint:
	$(MAKE) -C src $@

clean:
	$(MAKE) -C src $@
	$(MAKE) -C doc $@
	$(RM) -r html/
	$(RM) $(DIST_TAR) $(RELEASE_TAR)

build:

install:

distclean: clean
	$(MAKE) -C src $@
	$(MAKE) -C doc $@
	$(RM) -r autom4te.cache
	$(RM) aclocal.m4
	$(RM) autoscan.log configure.scan
	$(RM) Rules.mk config.h config.log config.status

mrproper: distclean
	$(RM) config.h.in configure

doxygen: Doxyfile
	doxygen

config.h Rules.mk: configure config.h.in Rules.mk.in
	./configure

ifdef REMAKEALL
configure config.h.in: configure.ac
	autoreconf
else
configure config.h.in:
	autoreconf
endif

configure.scan:
	autoscan

all: default doxygen

dist: $(DIST_TAR)

dist.list.template:
	echo > $@
	find -type f | grep -v /CVS/ >> $@

$(DIST_TAR): dist.list
	$(TAR) zcf $@ -T dist.list

release: $(RELEASE_TAR)

release.list.template: all
	echo > $@
	find ../$(notdir $(shell pwd))/doc/ -type f >> $@
	echo ../$(notdir $(shell pwd))/html/ >> $@

$(RELEASE_TAR): $(DIST_TAR) release.list all
	$(TAR) zcf $@ -T release.list ../$(notdir $(shell pwd))/$(DIST_TAR)

