#
# Copyright (C) 2008 Till Harbaum <till@harbaum.org>.
#
# This file is part of NeHeGLES.
#
# NeHeGLES 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.
#
# NeHeGLES 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 NeHeGLES.  If not, see <http://www.gnu.org/licenses/>.

APP = nehegles
LESSONPATH = lesson
prefix = /usr
VERSION = $${VERSION_PREFIX}1.3$${VERSION_SUFFIX}
bindir = ${exec_prefix}/bin
datarootdir = /opt
datadir = /opt

LESSONS = 02 03 04 05 06 07 08 09 10

all:
	cd gui && make
	cd gui/data && make
	cd glues/source && make
	for i in $(LESSONS); do PRT=`pwd`; cd $(LESSONPATH)$$i && make ; cd $$PRT; done

install:
	cd gui && make install
	cd gui/data && make install	
	install -d $(DESTDIR)$(datadir)/$(APP)
	for i in $(LESSONS); do \
	  install $(LESSONPATH)$$i/lesson$$i $(DESTDIR)$(datadir)/$(APP);\
	  install $(LESSONPATH)$$i/data/* $(DESTDIR)$(datadir)/$(APP);\
	  install $(LESSONPATH)$$i/lesson$$i.c $(DESTDIR)$(datadir)/$(APP);\
	done

clean:
	rm -f *~ \#*\# *.bak *-stamp
	cd gui && make clean
	cd gui/data && make clean
	cd glues/source && make clean
	for i in $(LESSONS); do PRT=`pwd`; cd $(LESSONPATH)$$i && make clean; cd $$PRT; done

distclean: clean
	rm -f Makefile gui/Makefile gui/data/Makefile config.log config.status
	rm -fr autom4te.cache

mostlyclean: clean

maintainer-clean: distclean
	@echo 'This command is intended for maintainers to use; it'
	@echo 'deletes files that may need special tools to rebuild.'
	# (nothing yet)

ChangeLog: FORCE
	svn2cl --group-by-day --include-rev --separate-daylogs --include-actions

tarball: distclean
	sh mktarball.sh "$(VERSION)"

FORCE:
