# GTK Pattern Creation Lab
# Copyright (C) 1999  Peter Stuart

# This program 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.

# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.


all: gpcl 

# Which compiler
CC=egcs

# GTK configuration 
GTKLIBS=`gtk-config --libs`
GTKFLAGS=`gtk-config --cflags`

# Directory for include files
INCLUDE=.

# Options for development
CFLAGS=-Wall -ansi 

# Options for release
# CFLAGS=-Wall -ansi

PROGRAMNAME=gpcl
SLPARSERDIR=../slparser0.0.6
LIBS=../lib/libptxt.a

gpcl: matrix peachey slparser gpcl.o gpcldlgs.o gpclpatmenu.o \
      checker.o rmansl.o brick.o
	$(CC) -o$(PROGRAMNAME) -I$(INCLUDE) $(GTKLIBS) $(GTKFLAGS) $(CFLAGS) \
	gpcl.o gpcldlgs.o gpclpatmenu.o checker.o rmansl.o brick.o\
        ../matrix/matrix.o ../matrix/math3d.o \
	$(SLPARSERDIR)/tokenlist.o $(SLPARSERDIR)/tokenizer.o \
	$(SLPARSERDIR)/datastack.o $(SLPARSERDIR)/slparser.o \
	$(SLPARSERDIR)/slplib.o $(LIBS)

gpcl.o: gpcl.c gpcl.h gpcldlgs.h types.h patterns.h checker.h rmansl.h brick.h
gpcldlgs.o: gpcldlgs.c gpcldlgs.h gpcl.h gpclpatmenu.h types.h
gpclpatmenu.o: gpclpatmenu.c gpclpatmenu.h gpcl.h patterns.h checker.h brick.h rmansl.h
checker.o: checker.c checker.h types.h ../include/proctext.h ../include/math3d.h ../include/matrix.h  gpcl.h gpcldlgs.h
rmansl.o: rmansl.c rmansl.h types.h ../include/proctext.h ../include/math3d.h ../include/matrix.h gpcl.h gpcldlgs.h $(SLPARSERDIR)/tokens.h
brick.o: brick.c brick.h types.h ../include/proctext.h ../include/math3d.h ../include/matrix.h gpcl.h gpcldlgs.h
matrix: ../matrix/matrix.o ../matrix/math3d.o
	cd ../matrix ; make
peachey:
	cd ../peachey ; make
	cp ../peachey/libptxt.a ../lib
slparser:
	cd $(SLPARSERDIR) ; make

clean:
	-rm -f *.o $(PROGRAMNAME)
	-rm -f ../lib/*
	-cd ../matrix ; make clean
	-cd $(SLPARSERDIR) ; make clean
	-cd ../peachey ; make clean
