#
#      Welson R. Jacometti
#

DBIN    = $(GEOLAB_HOME)/bin/
DOBJ    = obj/
CFLAGS  = -I. -I$(GUIDEHOME)/include -I$(OPENWINHOME)/include
LDFLAGS = -L$(GUIDEHOME)/lib -L$(OPENWINHOME)/lib \
          -Bstatic -lguide -lguidexv -lxview -lolgx -lX -lm -ll -Bdynamic -ldl -Bstatic \
          /usr/lib/debug/mallocmap.o
CC = /usr/lang/CC-3.0.1

OBJS=  \
		$(DOBJ)geolex.o \
		$(DOBJ)Bb_tree.o \
		$(DOBJ)Circle.o \
		$(DOBJ)Coords2D.o \
		$(DOBJ)Ellipse.o \
		$(DOBJ)Interval_set.o \
		$(DOBJ)Line2D.o \
		$(DOBJ)List.o \
		$(DOBJ)Obj.o \
		$(DOBJ)Point2D.o \
		$(DOBJ)Polygon.o \
		$(DOBJ)Range_tree.o \
		$(DOBJ)Ray2D.o \
		$(DOBJ)Rectangle.o \
		$(DOBJ)SList.o \
		$(DOBJ)Segment2D.o \
		$(DOBJ)Square.o \
		$(DOBJ)String.o \
		$(DOBJ)World.o \
		$(DOBJ)algorithms.o \
		$(DOBJ)animation.o \
		$(DOBJ)attributes.o \
		$(DOBJ)basic.o \
		$(DOBJ)benchmark.o \
		$(DOBJ)color.o \
		$(DOBJ)compose.o \
		$(DOBJ)dynamic.o \
		$(DOBJ)edit_mode.o \
		$(DOBJ)geolab_stubs.o \
		$(DOBJ)geolab_ui.o \
		$(DOBJ)global.o \
		$(DOBJ)goodies_file.o \
		$(DOBJ)goodies_file_ui.o \
		$(DOBJ)handle.o \
		$(DOBJ)input_tools.o \
		$(DOBJ)insert_simple.o \
		$(DOBJ)instantiation.o \
		$(DOBJ)line_settings.o \
		$(DOBJ)load_save.o \
		$(DOBJ)move_copy.o \
		$(DOBJ)objects.o \
		$(DOBJ)quit.o \
		$(DOBJ)resize.o \
		$(DOBJ)scroll.o \
		$(DOBJ)select.o \
		$(DOBJ)tools.o \
		$(DOBJ)trapsignal.o \
		$(DOBJ)utilities.o \
		$(DOBJ)zoom.o


$(DBIN)geolab: $(OBJS)
	$(CC) $(OBJS) $(LDFLAGS) -o $(DBIN)geolab

$(DOBJ)Bb_tree.o: 	Bb_tree.C \
			B_stack.h \
			Bb_tree.h \
			basic.h \
			global.h
	$(CC) $(CFLAGS) -c Bb_tree.C -o $(DOBJ)Bb_tree.o

$(DOBJ)Circle.o: 	Circle.C \
			Circle.h \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Rectangle.h \
			Segment2D.h \
			Square.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			color.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Circle.C -o $(DOBJ)Circle.o

$(DOBJ)Coords2D.o: 	Coords2D.C \
			Coords2D.h \
			global.h
	$(CC) $(CFLAGS) -c Coords2D.C -o $(DOBJ)Coords2D.o

$(DOBJ)Ellipse.o: 	Ellipse.C \
			Coords2D.h \
			Ellipse.h \
			List.h \
			Obj.h \
			Point2D.h \
			Rectangle.h \
			Segment2D.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			color.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Ellipse.C -o $(DOBJ)Ellipse.o

$(DOBJ)Interval_set.o: 	Interval_set.C \
			B_stack.h \
			Bb_tree.h \
			D2_dictionary.h \
			Interval_set.h \
			List.h \
			Range_tree.h \
			basic.h \
			global.h
	$(CC) $(CFLAGS) -c Interval_set.C -o $(DOBJ)Interval_set.o

$(DOBJ)Line2D.o: 	Line2D.C \
			Coords2D.h \
			Line2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Line2D.C -o $(DOBJ)Line2D.o

$(DOBJ)List.o: 	List.C \
			List.h \
			basic.h \
			global.h
	$(CC) $(CFLAGS) -c List.C -o $(DOBJ)List.o

$(DOBJ)Obj.o: 	Obj.C \
			List.h \
			Obj.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Obj.C -o $(DOBJ)Obj.o

$(DOBJ)Point2D.o: 	Point2D.C \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Point2D.C -o $(DOBJ)Point2D.o

$(DOBJ)Polygon.o: 	Polygon.C \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Polygon.h \
			Segment2D.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Polygon.C -o $(DOBJ)Polygon.o

$(DOBJ)Range_tree.o: 	Range_tree.C \
			B_stack.h \
			Bb_tree.h \
			List.h \
			Range_tree.h \
			basic.h \
			global.h
	$(CC) $(CFLAGS) -c Range_tree.C -o $(DOBJ)Range_tree.o

$(DOBJ)Ray2D.o: 	Ray2D.C \
			Coords2D.h \
			Line2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Ray2D.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Ray2D.C -o $(DOBJ)Ray2D.o

$(DOBJ)Rectangle.o: 	Rectangle.C \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Rectangle.h \
			Segment2D.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Rectangle.C -o $(DOBJ)Rectangle.o

$(DOBJ)SList.o: 	SList.C \
			SList.h \
			basic.h \
			global.h
	$(CC) $(CFLAGS) -c SList.C -o $(DOBJ)SList.o

$(DOBJ)Segment2D.o: 	Segment2D.C \
			Coords2D.h \
			Line2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Ray2D.h \
			Segment2D.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Segment2D.C -o $(DOBJ)Segment2D.o

$(DOBJ)Square.o: 	Square.C \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Rectangle.h \
			Segment2D.h \
			Square.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			handle.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c Square.C -o $(DOBJ)Square.o

$(DOBJ)String.o: 	String.C \
			String.h \
			global.h
	$(CC) $(CFLAGS) -c String.C -o $(DOBJ)String.o

$(DOBJ)World.o: 	World.C \
			World.h \
			global.h
	$(CC) $(CFLAGS) -c World.C -o $(DOBJ)World.o

$(DOBJ)algorithms.o: 	algorithms.C \
			Algorithm.h \
			geolex.h \
			List.h \
			Obj.h \
			SList.h \
			Stack.h \
			String.h \
			World.h \
			algorithms.h \
			animation.h \
			attributes.h \
			basic.h \
			benchmark.h \
			compose.h \
			edit_mode.h \
			geolab_ui.h \
			global.h \
			objects.h \
			tools.h \
			trapsignal.h \
			utilities.h
	$(CC) $(CFLAGS) -c algorithms.C -o $(DOBJ)algorithms.o

$(DOBJ)animation.o: 	animation.C \
			Algorithm.h \
			List.h \
			Obj.h \
			String.h \
			World.h \
			algorithms.h \
			animation.h \
			attributes.h \
			basic.h \
			edit_mode.h \
			geolab_ui.h \
			global.h \
			goodies_file.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c animation.C -o $(DOBJ)animation.o

$(DOBJ)attributes.o: 	attributes.C \
			String.h \
			attributes.h \
			color.h \
			global.h \
			line_settings.h
	$(CC) $(CFLAGS) -c attributes.C -o $(DOBJ)attributes.o

$(DOBJ)basic.o: 	basic.C \
			basic.h \
			global.h
	$(CC) $(CFLAGS) -c basic.C -o $(DOBJ)basic.o

$(DOBJ)benchmark.o: 	benchmark.C \
			benchmark.h
	$(CC) $(CFLAGS) -c benchmark.C -o $(DOBJ)benchmark.o

$(DOBJ)color.o: 	color.C \
			color.h \
			global.h
	$(CC) $(CFLAGS) -c color.C -o $(DOBJ)color.o

$(DOBJ)compose.o: 	compose.C \
			Algorithm.h \
			List.h \
			Obj.h \
			String.h \
			World.h \
			algorithms.h \
			animation.h \
			attributes.h \
			basic.h \
			compose.h \
			geolab_ui.h \
			global.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c compose.C -o $(DOBJ)compose.o

$(DOBJ)dynamic.o: 	dynamic.C \
			Algorithm.h \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			String.h \
			World.h \
			algorithms.h \
			attributes.h \
			basic.h \
			color.h \
			compose.h \
			dynamic.h \
			geolab_ui.h \
			global.h \
			handle.h \
			line_settings.h \
			objects.h \
			tools.h \
			trapsignal.h \
			utilities.h
	$(CC) $(CFLAGS) -c dynamic.C -o $(DOBJ)dynamic.o

$(DOBJ)edit_mode.o: 	edit_mode.C \
			Algorithm.h \
			ICONS/copy.cursor \
			ICONS/dynamic.cursor \
			ICONS/insert.cursor \
			ICONS/move.cursor \
			ICONS/resizecl.cursor \
			ICONS/resizeop.cursor \
			ICONS/scroll.cursor \
			ICONS/select.cursor \
			ICONS/zoom.cursor \
			List.h \
			Obj.h \
			String.h \
			World.h \
			algorithms.h \
			attributes.h \
			basic.h \
			dynamic.h \
			edit_mode.h \
			geolab_ui.h \
			global.h \
			insert_simple.h \
			instantiation.h \
			move_copy.h \
			objects.h \
			resize.h \
			scroll.h \
			select.h \
			tools.h \
			trapsignal.h \
			utilities.h \
			zoom.h
	$(CC) $(CFLAGS) -c edit_mode.C -o $(DOBJ)edit_mode.o

$(DOBJ)geolab_stubs.o: 	geolab_stubs.C \
			Algorithm.h \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			String.h \
			World.h \
			algorithms.h \
			animation.h \
			attributes.h \
			basic.h \
			color.h \
			compose.h \
			edit_mode.h \
			geolab_ui.h \
			global.h \
			goodies_file.h \
			handle.h \
			input_tools.h \
			line_settings.h \
			load_save.h \
			objects.h \
			quit.h \
			tools.h \
			trapsignal.h \
			utilities.h \
			zoom.h
	$(CC) $(CFLAGS) -c geolab_stubs.C -o $(DOBJ)geolab_stubs.o

$(DOBJ)geolab_ui.o: 	geolab_ui.C \
			Algorithm.h \
			ICONS/color.icon \
			ICONS/dynamic.icon \
			ICONS/ellipse.icon \
			ICONS/geolab.icon \
			ICONS/line.icon \
			ICONS/move_copy.icon \
			ICONS/place_holder.icon \
			ICONS/point.icon \
			ICONS/ray.icon \
			ICONS/rectangle.icon \
			ICONS/resize.icon \
			ICONS/scroll.icon \
			ICONS/segment.icon \
			ICONS/select.icon \
			ICONS/zoom.icon \
			List.h \
			Obj.h \
			String.h \
			World.h \
			algorithms.h \
			attributes.h \
			basic.h \
			color.h \
			geolab_ui.h \
			global.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c geolab_ui.C -o $(DOBJ)geolab_ui.o

$(DOBJ)global.o: 	global.C \
			global.h
	$(CC) $(CFLAGS) -c global.C -o $(DOBJ)global.o

$(DOBJ)goodies_file.o: 	goodies_file.C \
			goodies_file.h
	$(CC) $(CFLAGS) -c goodies_file.C -o $(DOBJ)goodies_file.o

$(DOBJ)goodies_file_ui.o: 	goodies_file_ui.C \
			goodies_file.h
	$(CC) $(CFLAGS) -c goodies_file_ui.C -o $(DOBJ)goodies_file_ui.o

$(DOBJ)handle.o: 	handle.C \
			World.h \
			color.h \
			global.h \
			handle.h \
			tools.h
	$(CC) $(CFLAGS) -c handle.C -o $(DOBJ)handle.o

$(DOBJ)input_tools.o: 	input_tools.C \
			B_stack.h \
			Bb_tree.h \
			Circle.h \
			Coords2D.h \
			D2_dictionary.h \
			Ellipse.h \
			Interval_set.h \
			List.h \
			Obj.h \
			Point2D.h \
			Polygon.h \
			Range_tree.h \
			Rectangle.h \
			Segment2D.h \
			Square.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			benchmark.h \
			geolab_ui.h \
			global.h \
			handle.h \
			input_tools.h \
			objects.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c input_tools.C -o $(DOBJ)input_tools.o

$(DOBJ)insert_simple.o: 	insert_simple.C \
			Algorithm.h \
			List.h \
			Obj.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			color.h \
			edit_mode.h \
			global.h \
			insert_simple.h \
			line_settings.h \
			objects.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c insert_simple.C -o $(DOBJ)insert_simple.o

$(DOBJ)instantiation.o: 	instantiation.C \
			Algorithm.h \
			Circle.h \
			Coords2D.h \
			Ellipse.h \
			Line2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Polygon.h \
			Ray2D.h \
			Rectangle.h \
			Segment2D.h \
			Square.h \
			String.h \
			World.h \
			algorithms.h \
			attributes.h \
			basic.h \
			geolab_ui.h \
			global.h \
			handle.h \
			instantiation.h \
			tools.h \
			trapsignal.h \
			utilities.h
	$(CC) $(CFLAGS) -c instantiation.C -o $(DOBJ)instantiation.o

$(DOBJ)line_settings.o: 	line_settings.C \
			global.h \
			line_settings.h
	$(CC) $(CFLAGS) -c line_settings.C -o $(DOBJ)line_settings.o

$(DOBJ)load_save.o: 	load_save.C \
			List.h \
			Obj.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			global.h \
			instantiation.h \
			load_save.h \
			objects.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c load_save.C -o $(DOBJ)load_save.o

$(DOBJ)move_copy.o: 	move_copy.C \
			List.h \
			Obj.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			color.h \
			global.h \
			move_copy.h \
			objects.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c move_copy.C -o $(DOBJ)move_copy.o

$(DOBJ)objects.o: 	objects.C \
			Algorithm.h \
			List.h \
			Obj.h \
			String.h \
			World.h \
			algorithms.h \
			attributes.h \
			basic.h \
			color.h \
			edit_mode.h \
			geolab_ui.h \
			global.h \
			line_settings.h \
			objects.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c objects.C -o $(DOBJ)objects.o

$(DOBJ)quit.o: 	quit.C \
			global.h \
			quit.h
	$(CC) $(CFLAGS) -c quit.C -o $(DOBJ)quit.o

$(DOBJ)resize.o: 	resize.C \
			List.h \
			Obj.h \
			String.h \
			World.h \
			attributes.h \
			basic.h \
			color.h \
			global.h \
			objects.h \
			resize.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c resize.C -o $(DOBJ)resize.o

$(DOBJ)scroll.o: 	scroll.C \
			World.h \
			global.h \
			scroll.h
	$(CC) $(CFLAGS) -c scroll.C -o $(DOBJ)scroll.o

$(DOBJ)select.o: 	select.C \
			Algorithm.h \
			Coords2D.h \
			List.h \
			Obj.h \
			Point2D.h \
			Rectangle.h \
			Segment2D.h \
			String.h \
			World.h \
			algorithms.h \
			attributes.h \
			basic.h \
			color.h \
			geolab_ui.h \
			global.h \
			handle.h \
			objects.h \
			select.h \
			tools.h \
			utilities.h
	$(CC) $(CFLAGS) -c select.C -o $(DOBJ)select.o

$(DOBJ)tools.o: 	tools.C \
			global.h \
			tools.h
	$(CC) $(CFLAGS) -c tools.C -o $(DOBJ)tools.o

$(DOBJ)trapsignal.o: 	trapsignal.C \
			String.h \
			World.h \
			geolab_ui.h \
			global.h \
			load_save.h \
			trapsignal.h
	$(CC) $(CFLAGS) -c trapsignal.C -o $(DOBJ)trapsignal.o

$(DOBJ)utilities.o: 	utilities.C \
			global.h \
			utilities.h
	$(CC) $(CFLAGS) -c utilities.C -o $(DOBJ)utilities.o

$(DOBJ)zoom.o: 	zoom.C \
			World.h \
			color.h \
			global.h \
			zoom.h
	$(CC) $(CFLAGS) -c zoom.C -o $(DOBJ)zoom.o

$(DOBJ)geolex.o:
	make -f MakeLEX

clean: 
	$(RM) $(DOBJ)* core *~




