OS	:=	$(shell uname)
include ../templates/template.$(OS)
# -------------------------------------------------------------
# RCSID		: 	$Id: Makefile,v 1.9 2000/11/10 22:37:44 cmalek Exp $
# Project	:	xdphys matlab library
# Filename	:	Makefile
# Author	:	cmalek
# Desc		:	Makefile for ss matlab library
# -------------------------------------------------------------


# -------------------------------------------------------------
# Define some useful variables
# -------------------------------------------------------------
# various system tools
CC          = gcc 
CPP	     	= gcc - -E -P
LD	     	= gcc 
CDEBUG      = -g 
ifdef CDEBUG
LDEBUG      = -g 
endif
ifndef CDEBUG 
OPTIMIZE	= -O3
endif
RM	     	= /bin/rm -f
AR	     	= ar
RANLIB      = ranlib
LINT		= lclint
INSTALL		= install

# ------------------------------------------------------------------
# Matlab files
# ------------------------------------------------------------------
MATFILES	= 	readana.m \
        readana_spikes.m \
        fdread.m \
				readwave.m \
				depvars.m \
				showtraces.m \
				xdview_curve.m \
				xdview_isih.m \
				xdview_psth.m \
				xdview_getcal.m \
				nspikes.m \
				getvar.m \
				stimpower.m

install: 
		@echo
		@echo   Installing matlab files to $(INSTALL_MATDIR) ...
		@$(INSTALL) -d -m 0755  $(INSTALL_MATDIR)
		@for x in $(MATFILES); \
				do\
					$(INSTALL) -m 0444 $$x $(INSTALL_MATDIR);\
					echo "           $$x.";\
				done
		@echo
		@echo You must have \"$(INSTALL_MATDIR)\" in your MATLABPATH to 
		@echo use these files in matlab.
		@echo

mex: fitexy.mex$(MATEXT)
.PHONY: mex

fitexy.mex$(MATEXT): fitexy-mat.c
	mex -DNR -I$(NRINC) -DMATLAB $(NRLIB) -g fitexy-mat.c \
		-output fitexy

clean:
	rm fitexy.mex$(MATEXT)

