# Makefile.in --- Mesa GL Widget for X11 Toolkit Programming
# Copyright (C) 1995, 1996 by
#   Jeroen van der Zijp <jvz@cyberia.cfdrc.com>
#   Thorsten Ohl <Thorsten.Ohl@Physik.TH-Darmstadt.de>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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 Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: Makefile.in,v 1.18 1996/09/30 00:21:06 ohl Exp $
#
########################################################################

CFLAGS = -O
LDFLAGS =

########################################################################

SHELL = /bin/sh

srcdir = @srcdir@
top_srcdir = @top_srcdir@
mesa_srcdir = @mesa_srcdir@
VPATH = @srcdir@

SUBDIRS = src include/GL man demos

VISUAL_GL_DEMOS = demo.gl.pseudo.rgb demo.gl.true.rgb \
		  demo.gl.pseudo.ci demo.gl.true.ci 

VISUAL_MESA_DEMOS = demo.mesa.pseudo.rgb demo.mesa.true.rgb \
		    demo.mesa.pseudo.ci demo.mesa.true.ci

all install uninstall:
	for d in $(SUBDIRS); do	(cd $$d && $(MAKE) $@) || break; done

demo demo.gl demo.mesa demo.ws demo.ws1 demo.tea \
  demo.gl.pseudo demo.gl.true \
  demo.mesa.pseudo demo.mesa.true \
  $(VISUAL_GL_DEMOS) $(VISUAL_MESA_DEMOS):
	cd src && $(MAKE) all
	cd demos && $(MAKE) $@

demo.all: demo.gl.all demo.mesa.all 
demo.gl.all: $(VISUAL_GL_DEMOS)
demo.mesa.all: $(VISUAL_MESA_DEMOS)

# Standard GNU clean* targets:
maintainer-clean: clean
	@echo "This command is intended for maintainers to use;"
	@echo "it deletes files that may require special tools to rebuild."
	for d in $(SUBDIRS); do	(cd $$d && $(MAKE) $@); done

mostlyclean: clean
	for d in $(SUBDIRS); do	(cd $$d && $(MAKE) $@); done

distclean: clean
	for d in $(SUBDIRS); do	(cd $$d && $(MAKE) $@); done
	rm -f Makefile config.cache config.status

clean:
	for d in $(SUBDIRS); do	(cd $$d && $(MAKE) $@); done
	rm -f .*~ *~ config.log

realclean: clean

# GNU autoconf(1) targets:
Makefile: Makefile.in config.status
	$(SHELL) config.status
config.status: configure
	$(SHELL) config.status --recheck
configure: configure.in
	cd $(srcdir); autoconf

########################################################################
# Distributions
########################################################################

DISTFILES.top = README INSTALL /usr/local/etc/COPYING ChangeLog TODO \
		Makefile.in configure configure.in config.guess config.sub \
		install-sh

DISTFILES.src = ChangeLog Makefile.in \
		GLwDrawingArea.c GLwMDrawingArea.c \
		MesaDrawingArea.c MesaWorkstation.c \
		GLwCreateMDrawingArea.c GLwDrawingAreaMakeCurrent.c \
		GLwDrawingAreaSwapBuffers.c GLwMakeCurrent.c

DISTFILES.inc = ChangeLog Makefile.in \
		GLwDrawA.h GLwDrawAP.h GLwMDrawA.h GLwMDrawAP.h \
		MesaDrawingArea.h MesaDrawingAreaP.h \
		MesaWorkstation.h MesaWorkstationP.h

PODS = MesaDrawingArea.pod MesaWorkstation.pod \
       GLwDrawingArea.pod GLwCreateMDrawingArea.pod \
       GLwDrawingAreaSwapBuffers.pod GLwDrawingAreaMakeCurrent.pod

DISTFILES.man = ChangeLog Makefile.in \
		$(PODS) $(PODS:.pod=.3x) $(PODS:.pod=.html)

DISTFILES.demos = ChangeLog Makefile.in cube.c mcube.c ed.c tea.c \
		  Cube Mcube Ed events Tea

# snapshots:
snap:
	rm -fr widgets-current
	mkdir widgets-current
	cp $(DISTFILES.top) widgets-current
	mkdir widgets-current/src
	cd src && cp $(DISTFILES.src) ../widgets-current/src
	mkdir widgets-current/include
	mkdir widgets-current/include/GL
	cd include/GL && cp $(DISTFILES.inc) ../../widgets-current/include/GL
	mkdir widgets-current/man
	cd man && $(MAKE) && cp $(DISTFILES.man) ../widgets-current/man
	mkdir widgets-current/demos
	cd demos && cp $(DISTFILES.demos) ../widgets-current/demos
	tar cf - widgets-current | gzip > widgets-current.tar.gz
	rm -fr widgets-current

test.snap: snap
	rm -fr widgets-current
	zcat widgets-current.tar.gz | tar xf -
	cd widgets-current && ./configure && $(MAKE) all
