############################################################################
# RCS INFORMATION:
#
# 	$RCSfile: Makefile,v $
# 	$Author: milind $	$Locker:  $		$State: Exp $
#	$Revision: 1.4 $	$Date: 1997/04/03 20:02:07 $
#
############################################################################
# DESCRIPTION:
#
############################################################################
# REVISION HISTORY:
#
# $Log: Makefile,v $
# Revision 1.4  1997/04/03 20:02:07  milind
# Fixed the projections checkin problem due to unnecessary locks
# inherited from the days when RCS was used.
#
# Revision 1.3  1995/10/31 21:08:15  sanjeev
# added util.c and util_graphics.c
#
# Revision 1.2  1995/02/24  23:16:09  jyelon
# *** empty log message ***
#
############################################################################

##########################################################
#The user needs to edit the following three definitions 
##########################################################

DEFINES		= -D_NO_PROTO -DSTRINGS_ALIGNED 
INCLUDES  	= -I/usr/include/X11R5 -I/usr/include/Motif1.2
LIBRARIES 	= -L/usr/lib/X11R5 -L/usr/lib/Motif1.2


##########################################################
#Directory specifications
##########################################################
SOURCES		= ../sources
MAIN		= $(SOURCES)/main
XS		= $(SOURCES)/trivia
QUIT		= $(SOURCES)/trivia
ANALYSE		= $(SOURCES)/analyse
GRAPHICS	= $(SOURCES)/graphics
CALLBACKS	= $(SOURCES)/callbacks
HEADERS		= $(SOURCES)/headers

SRCS= $(MAIN)/main.c $(XS)/xs.c $(CALLBACKS)/common.c \
    $(GRAPHICS)/common_graphics.c $(CALLBACKS)/timeline.c \
    $(GRAPHICS)/timeline_graphics.c $(CALLBACKS)/grainsize.c \
    $(GRAPHICS)/util_graphics.c $(CALLBACKS)/util.c \
    $(GRAPHICS)/grainsize_graphics.c $(CALLBACKS)/legend.c \
    $(GRAPHICS)/legend_graphics.c $(CALLBACKS)/timestep.c \
    $(CALLBACKS)/parameters.c $(CALLBACKS)/draw.c $(CALLBACKS)/detailed.c \
    $(GRAPHICS)/detailed_graphics.c $(CALLBACKS)/overview.c \
    $(GRAPHICS)/overview_graphics.c $(CALLBACKS)/animation.c \
    $(GRAPHICS)/animation_graphics.c $(CALLBACKS)/expert.c \
    $(ANALYSE)/analyse.c $(ANALYSE)/log.c $(ANALYSE)/file_io.c \
    $(ANALYSE)/data.c $(ANALYSE)/test.c $(ANALYSE)/shared.c \
    $(ANALYSE)/summary.c $(ANALYSE)/ldb.c   $(ANALYSE)/critical.c \
    $(ANALYSE)/sync.c $(ANALYSE)/tachyon.c $(ANALYSE)/wait.c \
	$(ANALYSE)/pattern.c $(ANALYSE)/report.c 
    


##########################################################
#Configuration of cc
##########################################################
RM		= rm -f
CC		= cc 
CFLAGS		= -c -O -I$(SOURCES)/headers $(INCLUDES)
LOAD_FLAGS	= -lXm -lXt -lX11 -lm

##########################################################
#Objects that need to be compiled
##########################################################
OBJECTS		= main.o common.o common_graphics.o xs.o \
		 	legend.o legend_graphics.o \
		  	timeline.o timeline_graphics.o \
		  	grainsize.o grainsize_graphics.o \
		  	util.o util_graphics.o \
		  	timestep.o parameters.o \
		  	draw.o detailed.o detailed_graphics.o \
		  	overview.o overview_graphics.o \
		  	animation.o animation_graphics.o expert.o \
		  	analyse.o log.o file_io.o data.o test.o \
			shared.o summary.o sync.o critical.o \
			tachyon.o ldb.o wait.o pattern.o report.o



all: projections 

##########################################################
#All the dependences
##########################################################
projections: $(OBJECTS)	
		$(RM) $@
		$(CC) -o $@ $(OBJECTS) $(DEFINES) $(LIBRARIES) $(LOAD_FLAGS)

projections.o: $(OBJECTS)	
		$(RM) $@
		ld -r -o $@ $(OBJECTS) 

include depend.mk

main.o:		$(MAIN)/main.c 
		$(CC) $(CFLAGS) $(DEFINES) $(MAIN)/main.c

xs.o:		$(XS)/xs.c 
		$(CC) $(CFLAGS) $(DEFINES) $(XS)/xs.c

common.o:	$(CALLBACKS)/common.c
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/common.c

common_graphics.o: $(GRAPHICS)/common_graphics.c 
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/common_graphics.c

timeline.o:	$(CALLBACKS)/timeline.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/timeline.c

timeline_graphics.o: $(GRAPHICS)/timeline_graphics.c 
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/timeline_graphics.c

grainsize.o:	$(CALLBACKS)/grainsize.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/grainsize.c

grainsize_graphics.o: $(GRAPHICS)/grainsize_graphics.c 
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/grainsize_graphics.c

util.o:	$(CALLBACKS)/util.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/util.c

util_graphics.o: $(GRAPHICS)/util_graphics.c 
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/util_graphics.c

legend.o:	$(CALLBACKS)/legend.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/legend.c

legend_graphics.o: $(GRAPHICS)/legend_graphics.c 
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/legend_graphics.c

timestep.o:	$(CALLBACKS)/timestep.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/timestep.c

parameters.o:	$(CALLBACKS)/parameters.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/parameters.c

draw.o:		$(CALLBACKS)/draw.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/draw.c

detailed.o:	$(CALLBACKS)/detailed.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/detailed.c

detailed_graphics.o: $(GRAPHICS)/detailed_graphics.c 
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/detailed_graphics.c

overview.o:	$(CALLBACKS)/overview.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/overview.c

overview_graphics.o: $(GRAPHICS)/overview_graphics.c 
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/overview_graphics.c

animation.o:	$(CALLBACKS)/animation.c 
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/animation.c

animation_graphics.o: $(GRAPHICS)/animation_graphics.c
		$(CC) $(CFLAGS) $(DEFINES) $(GRAPHICS)/animation_graphics.c

expert.o:	$(CALLBACKS)/expert.c
		$(CC) $(CFLAGS) $(DEFINES) $(CALLBACKS)/expert.c

analyse.o: $(ANALYSE)/analyse.c
	$(CC) $(CFLAGS) $(ANALYSE)/analyse.c	

log.o: $(ANALYSE)/log.c  $(ANALYSE)/io.c
	$(CC) $(CFLAGS) $(ANALYSE)/log.c	

file_io.o: $(ANALYSE)/file_io.c
	$(CC) $(CFLAGS) $(ANALYSE)/file_io.c	

data.o: $(ANALYSE)/data.c 
	$(CC) $(CFLAGS) $(ANALYSE)/data.c	

test.o: $(ANALYSE)/test.c 
	$(CC) $(CFLAGS) $(ANALYSE)/test.c	

shared.o: $(ANALYSE)/shared.c 
	$(CC) $(CFLAGS) $(ANALYSE)/shared.c	

summary.o: $(ANALYSE)/summary.c 
	$(CC) $(CFLAGS) $(ANALYSE)/summary.c	

critical.o: $(ANALYSE)/critical.c 
	$(CC) $(CFLAGS) $(ANALYSE)/critical.c	

sync.o: $(ANALYSE)/sync.c 
	$(CC) $(CFLAGS) $(ANALYSE)/sync.c	

tachyon.o: $(ANALYSE)/tachyon.c 
	$(CC) $(CFLAGS) $(ANALYSE)/tachyon.c	

ldb.o: $(ANALYSE)/ldb.c 
	$(CC) $(CFLAGS) $(ANALYSE)/ldb.c	

wait.o: $(ANALYSE)/wait.c 
	$(CC) $(CFLAGS) $(ANALYSE)/wait.c	

pattern.o: $(ANALYSE)/pattern.c 
	$(CC) $(CFLAGS) $(ANALYSE)/pattern.c	

report.o: $(ANALYSE)/report.c 
	$(CC) $(CFLAGS) $(ANALYSE)/report.c	

lint:
	lint $(INCLUDES) -I$(SOURCES)/headers \
			-I$(MAIN) -I$(XS) -I$(QUIT) -I$(ANALYSE)  \
			-I$(GRAPHICS) -I$(CALLBACKS) -I$(HEADERS) $(SRCS)

depend:
	makedepend -fdepend.mk -I$(SOURCES)/headers $(INCLUDES) $(SRCS)

clean:
	rm -f *.o projections
