#
#RCS ID: $Id: Makefile_multi_hive 889 2006-03-07 02:09:27Z rcatwood $
REG_LCDEFS_1 =  -DLIST_ALL_NUC -DPRINT_AV_PROFILE -DGLOBAL_UND_GRO -DAV_DIFF_COEFF -DNOSOLID -DCELL_DIFF_COEFF  -DHISTO_NUC   -DALWAYS_NUC -DRANSLEY -DTEST_LINE_INT -DWRITE_BLOCK -DMULTICOMP -DNLM_FORMULA -DSET_PRESSURE 

REG_LCDEFS_2 =  -DLIST_ALL_NUC -DPRINT_AV_PROFILE -DGLOBAL_UND_GRO -DAV_DIFF_COEFF -DNOSOLID -DCELL_DIFF_COEFF  -DHISTO_NUC   -DALWAYS_NUC -DRANSLEY -DTEST_LINE_INT -DWRITE_BLOCK -DMULTICOMP -DNLM_FORMULA -DPROCAST_CA -DPROCAST_3D -DUSER_1

#REG_LCDEFS =  -DAV_DIFF_COEFF -DNOSOLID -DCELL_DIFF_COEFF -DSINGLESLICE -DC_LIQ_OUTPUT -DNLM_FORMULA  -DHISTO_NUC   -DALWAYS_NUC -DRANSLEY -DTEST_LINE_INT -DWRITE_BLOCK

#REG_LCDEFS =  -DAV_DIFF_COEFF -DNOSOLID -DDEBUG_PORE -DCELL_DIFF_COEFF -DSINGLESLICE -DC_LIQ_OUTPUT -DNLM_FORMULA  -DHISTO_NUC  -DSILICON -DPORE_EXIT  -DALWAYS_NUC -DRANSLEY
#REG_LCDEFS = -DSTAT_ONLY -DAV_DIFF_COEFF -DNOSOLID -DDEBUG_PORE -DCELL_DIFF_COEFF -DSINGLESLICE -DC_LIQ_OUTPUT -DNLM_FORMULA  -DHISTO_NUC  -DSILICON -DPORE_EXIT  -DALWAYS_NUC -DRANSLEY
#REG_LCDEFS =  -DAV_DIFF_COEFF -DNOSOLID -DDEBUG_PORE -DCELL_DIFF_COEFF -DSINGLESLICE -DC_LIQ_OUTPUT -DNLM_FORMULA  -DHISTO_NUC  -DSILICON -DPORE_EXIT -DXRAY_PORES

CC = cc
FC = f90
CVERSION=
TARGETS1= ca_multi_mvar
DTARG = ca_deb

OPTIMIZER = -g
LCDEFS = ${DFLAGS} ${REG_LCDEFS_1}
LFFLAGS = -extend_source

CFILES = bigblock.c subblock.c \
	readgeoplus.c readmat.c read_ctrl.c getxyz.c\
	output_ex.c output_img.c find_max.c freeblock.c\
	read_cap_ca.c sb_nuc.c sb_temp_calc.c \
	sb_ca_step.c initface.c fcopymat.c icopymat.c \
	init_sb_neigh.c initcube.c rcs_id.c\
	fidap_interp_init.c  checkblock.c\
	thermo_trace_init.c thermo_trace_calc.c nbhd_def.c  \
        sb_boundary.c recr_extra.c props.c\
        open_sb.c sb_diffuse_gas.c sb_diffuse_alloy.c read_sb.c calc_sb.c\
	T_var_read.c trans_interp_calc.c wfact_r_calc.c pnuc_function.c\
	wfact_z_calc.c p_growth.c castats.c nuc_lookup.c nuc_functions.c\
	gaussdev.c rand_step.c rand_square.c ca_histo.c write_header_ctrl.c\
	write_grain_histo.c  pore_setup_multi.c pore_routines.c pore_multi.c\
	find_nmols.c findroot.c checks.c sb_line_int.c read_ca_procast.c\
        sb_diffuse_alloy_multi.c readphase.c interpolate.c analythic.c

HFILES = ca_matrix.h blocks.h fem.h machine.h writeblocks.h\
	readgeoplus.h readmat.h  read_sb.h\
	matprops.h nucprops.h read_ctrl.h find_max.h\
	colour.h temprops.h solprops.h cube.h \
	grain.h fidap.h output.h tcpl.h nbhd.h\
        sb_diffuse.h pore.h constants.h rcs_id.h\
	interp.h nearnode.h castats.h nuc_lookup.h\
	pr_struct.h temp_struct.h nuc_functions.h nucfuncs.h props.h gaussdev.h\
	ca_histo.h  histo_struct.h rand_step.h rand_square.h pore_routines.h\
        checks.h common.h gd.h gd_io.h temp_struct.h pr_struct.h\
        multi_diff_props.h




ALLFILES = $(CFILES) $(HFILES) $(WFILES) $(IFILES) $(P_RES)\
            prop_wrapper.c Makefile localrules files.txt
## if SGI use below
#       default malloc version
LLDLIBS = -lm
#     SGI speedshop malloc version - remember to set environment variables also
#LLDLIBS	= -lfastm -lm -lmalloc_ss
#       Electric Fence malloc version (use with caution)
#LLDLIBS	= -lfastm -lm -L/mount/mpg4/chirazi/efence -lefence 


#
default: ${TARGETS1}

p_res:
	$(CC) -o p_res $(P_RES)

ca_deb:	$(OBJECTS)
	${CC} ${CFLAGS} -o $(DTARG) ${OBJECTS} ${LDFLAGS}
	echo $@;echo $(DTARG)

${TARGETS1}: ${CFILES}
	${CC} ca_wrapper.c ca_solid.c  $(REG_LCDEFS_1) -o ca_multi_ali	 $(CFILES)  -lm
	echo $@



