#
#    GWMON Parallel Ada Monitor for 386/486 PCs   
#    Copyright (C) 1993, Charles W. Kann  & Michael Bliss Feldman
#                        ckann@seas.gwu.edu mfeldman@seas.gwu.edu
# 
#    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.
#
#    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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#


#
# This makefile creates the GWUMON program.  GWUMON is a run time shell
# which allows a user to see the progress of an Ada program as it is 
# executing.  It is built around the NYU Ada 83 (AdaED) system.
#
# There are two variables which have to be set before this makefile is 
# used.  They are:
#	NS = Where the NYU AdaED source is stored.
#	GW = Where the GWAda source is stored.

SHELL=/bin/sh

CC=icc
#CFLAGS=-O3 -DIBM_PC
CFLAGS=-d0 -O3 -DMONITOR -DIBM_PC -DGWUMON

LINKER= $(CC)
NS=\nyusrc
GW=\gwada
ADAED=d:\adaed

.SUFFIXES:
.SUFFIXES: .obj .c

.c.obj:
	$(CC)$(CCVAR) $(CFLAGS) -c $<  

EXECS = gwumon.exe

all: $(EXECS) 

install : all

#---------------------------#
# adaexec FILES AND ACTIONS #
#---------------------------#

INT_OBJS = imain.obj inta.obj intb.obj predef4.obj tasking.obj mon_int.obj \
	cwkgraph.obj cwktask.obj cwkfile.obj cwkform.obj cwkfpr.obj \
	cwkblock.obj mon_glob.obj gwload.obj imisc.obj


$(EXECS): $(NS)/ivars.c   $(INT_OBJS)
	$(LINKER) -n -e $@ $(LFLAGS) @gwumon.lnk  d:\intelc\lib\graphics.lib
	copy $@ $(ADAED)

#------------------------------------------------------------------------------#
# These executables are made from NYU Ada source file.  However, we don't want
# GWUMON defines in Adaexec.exe.  So therefore, these routines are recompiled
# into this directory with the GWUMON definition.  Only one source file is
# therefore needed, but we have two objects generated depending on the compile.
#------------------------------------------------------------------------------#

imain.obj:	$(NS)/imain.c
	$(CC)$(CCVAR) $(CFLAGS) -c $(NS)\imain.c
inta.obj:	$(NS)/inta.c
	$(CC)$(CCVAR) $(CFLAGS) -c $(NS)\inta.c
intb.obj:	$(NS)/intb.c
	$(CC)$(CCVAR) $(CFLAGS) -c $(NS)\intb.c
predef4.obj:	$(NS)/predef4.c
	$(CC)$(CCVAR) $(CFLAGS) -c $(NS)\predef4.c
tasking.obj:	$(NS)/tasking.c
	$(CC)$(CCVAR) $(CFLAGS) -c $(NS)\tasking.c
imisc.obj:	$(NS)/imisc.c
	$(CC)$(CCVAR) $(CFLAGS) -c $(NS)\imisc.c

#----------------------------------------------------------------------------#
# NOTE:  This rule is needed because GWAda defines a load file, as does
# NYU Ada.
#----------------------------------------------------------------------------#

gwload.obj:	$(GW)\load.c
	copy $(GW)\load.c gwload.c
	$(CC)$(CCVAR) $(CFLAGS) -c gwload.c
	del gwload.c
