#
# original_author: "Justin Finnerty"
# original_date: "July 2005"
# current_date: "$Date: 2005/10/31 07:18:05 $"
# current_author: "$Author: finnerty $"
# revision: "$Revision: 2.11 $"
# $Log: makefile.sys.in,v $
# Revision 2.11  2005/10/31 07:18:05  finnerty
# Added ability to create symlinks between directories as an alternative to merging. The major changes are in DIRDUP_REPORT with others adding/changing features as required.
#
# Revision 2.10  2005/09/30 07:24:11  finnerty
# Finalised for alpha version with ISE
#
# Revision 2.9  2005/09/30 06:48:16  finnerty
# Finalised for alpha release with SE and VE compilers
#
# Revision 2.8  2005/09/28 14:53:04  finnerty
# Added variables to improve the clean up target 'distclean'
#
# Revision 2.7  2005/09/28 14:24:26  finnerty
# Updated to work with ISE
#
# Revision 2.6  2005/09/27 08:30:10  finnerty
# Added VE eCluster/eProject dirs to "distclean"
#
# Revision 2.5  2005/09/27 08:15:41  finnerty
# Corrected for ve system
#
# Revision 2.4  2005/09/27 08:14:06  finnerty
# Corrected typo 2.
#
# Revision 2.3  2005/09/27 08:11:48  finnerty
# Corrected typo.
#
# Revision 2.2  2005/09/27 07:12:01  finnerty
# Integrated makefile system with autoconf
#
# Revision 2.1  2005/09/27 06:26:34  finnerty
# Integrated makefile system with autoconf
#
# Revision 2.1  2005/09/06 23:00:44  finnerty
# Support files for compiling with VE and SE
#
# Revision 2.1  2005/09/03 11:07:20  finnerty
# Static makefiles for test programs to compile with SE and VE.
#
# Revision 2.0  2005/08/26 23:18:23  finnerty
# == alpha version ==
#
# Revision 1.1  2005/08/26 22:51:34  finnerty
# autoconfiscated
#
#

CC=@CC@
CFLAGS=@CFLAGS@
EC=@EC@
CONFFILES=config.h makefile makefile.sys config.status config.log

ifeq ($(EC),se)
EPP=gepp
ECSYS=se
ECXACE=$(ECSYS).ace
EPPFLAGS=-l -DSE -DHAS_AGENT
ECOMP=c $(ECXACE)
ECOMPFINAL=$(ECOMP)
ETOPTODEL=demangle.c demangle.h demangle.id
ETODEL=
EMAKEBINFINAL=
EMAKEBIN=
endif
ifeq ($(EC),vec)
EPP=gepp
ECSYS=ve
ECXACE=$(ECSYS).ace
EPPFLAGS=-l -DVE
ECOMP=-y -a:$(ECXACE)
ECOMPFINAL=$(ECOMP)
ETOPTODEL=eCluster eProject *.xcp Result.out
ETODEL=$(ETOPTODEL)
EMAKEBINFINAL=
EMAKEBIN=
endif
ifeq ($(EC),ec)
EPP=gepp
ECSYS=ise
ECXACE=$(ECSYS).ace
EPPFLAGS=-l -DISE -DHAS_AGENT
ECOMP=-quick_melt -ace $(ECXACE)
ECOMPFINAL=-finalize -ace $(ECXACE)
ETOPTODEL=EIFGEN arguments.wb preferences.wb desync.melted desync.epr demangle.epr Metrics
ETODEL=
CSRCDIR=`if [ -f EIFGEN/F_code/Makefile.SH ]; then echo F_code; else echo W_code; fi`
EMAKEBINFINAL=pushd EIFGEN/F_code; finish_freezing; cp desync ../..; popd
EMAKEBIN=pushd EIFGEN/W_code; finish_freezing; cp desync ../..; if [ -f desync.melted ]; then cp desync.melted ../..; fi; popd
endif

RM=rm -rf

all: $(PROG)

development: esource $(OBJ) $(ECXACE)
	$(EC) $(ECOMP)
	$(EMAKEBIN)
	@echo "* done *"

$(PROG): DUMMY
	@echo "* done *"

DUMMY: esource $(OBJ) $(ECXACE)
	$(EC) $(ECOMPFINAL)
	$(EMAKEBINFINAL)

$(ECXACE): system.xace
	gexace --system=$(ECSYS) --output=$(ECXACE)

esource:: $(LOCALESRC) $(OBJ)

eclean:
	$(RM) $(OBJ) $(LOCALESRC)

clean: eclean
	/bin/sh -c \
	"for DIR in $(OTHERDEP) ; do pushd \$${DIR}; make eclean ; popd ; done"

distclean: clean
	$(RM) $(PROG) $(CONFFILES) $(ECXACE) $(ETOPTODEL)
	$(RM) test_demangle* test-cycle LOG
	/bin/sh -c \
	"for DIR in $(OTHERDEP) ; do pushd \$${DIR}; $(RM) $(ETODEL) ; popd ; done"

%.e:
	$(EPP) $(EPPFLAGS) $*.ge > $@

