UIobjects = App.o ../wxGLCanvases/LsysGLCanvas.o ../Lsystem/Lturtle.o \
../Lsystem/Lstring.o ../GL_Lsystem/trackball.o ../GL_Lsystem/GL_Lsystem.o \
../GL_Lsystem/GLGraphics.o ../wxGLCanvases/AnimateGLCanvas.o MyTextFrame.o
ThinAirobjects = ../thinair/modarith.o ../thinair/rand_rng.o ../thinair/randcomp.o \
../thinair/randcong.o ../thinair/randgen.o ../thinair/randmcon.o ../thinair/rndmconm.o
objects = $(UIobjects) $(ThinAirobjects)
hdirs= ../Lsystem ../GL_Lsystem ../wxGLCanvases ../Extras ../thinair ../App

.PHONY : distclean clean all wxGLCanvases GL_Lsystem debug

all          : thinair GL_Lsystem wxGLCanvases L-Breeder

debug        :
	export SHOW_DEBUGGING_MESSAGES; $(MAKE) all

L-Breeder    : $(objects)
	g++ -lwx_gtk -ldl -lpthread -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \
-rdynamic -lgmodule -lgthread -lglib -lpthread -lXext -lX11 /usr/lib/libGL.a \
/usr/lib/libGLU.so /usr/lib/libm.a \
-lwx_gtk_gl $(objects) -o L-Breeder

StaticApp : $(objects)
	g++ /usr/lib/libwx_gtk-2.1.so -ldl -lpthread -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk \
-rdynamic -lgmodule -lgthread -lglib -lpthread -lXext -lX11 /usr/lib/libGL.a \
/usr/lib/libGLU.so /usr/lib/libm.a \
/usr/lib/libwx_gtk_gl.so $(objects) -o StaticApp


App.o   : App.cpp App.h ../wxGLCanvases/LsysGLCanvas.h MyTextFrame.h
	g++ ${CFLAGS} -c App.cpp `wx-config --cflags` \
$(addprefix -I,$(hdirs))

MyTextFrame.o : MyTextFrame.cpp MyTextFrame.h
	g++ ${CFLAGS} -c MyTextFrame.cpp `wx-config --cflags` \
$(addprefix -I,$(hdirs))


MutDialog.o   : MutDialog.cpp MutDialog.h ../Lsystem/Lstring.h
	g++ ${CFLAGS} -c MutDialog.cpp `wx-config --cflags` -I../Lsystem

wxGLCanvases :
	$(MAKE) all -C ../wxGLCanvases

GL_Lsystem   : 
	$(MAKE) all -C ../GL_Lsystem

thinair      :
	$(MAKE) all CFLAGS=-O2 -C ../thinair 
clean :
	rm App.o MyTextFrame.o App
 
distclean :
	rm $(UIobjects) App

fullclean :
	rm $(objects) App
