OCAMLMAKEFILE = /usr/include/OCamlMakefile
# for debugging: add -g and make bc, then ocamldebug the RESULT
# for profiling: make profiling-native-code, then gprof
RESULT  = main
B = /home/matsen/spaz
C = $(B)/common
INCDIRS = /usr/lib/ocaml/site-packages/lacaml /usr/lib/ocaml/gsl
LIBDIRS = $(INCDIRS) 
OCAMLFLAGS = #-dtypes
#OCAMLBLDFLAGS = -dllpath $(INCDIRS)
LIBS    = pcre bigarray unix lacaml gsl
BASE = $(C)/btree.ml $(C)/number.ml $(C)/mat.ml base.ml $(C)/common_base.ml $(C)/algexp.ml $(C)/simplify.ml $(C)/treeAE.ml $(C)/resolution.ml $(C)/stats.ml alga.ml ga.ml $(C)/score.ml
SOURCES = $(BASE) $(RESULT).ml

all: native-code

run:
	./$(RESULT)

go:
	make && make run

edit:
	#emacs -r -f split-window-horizontally $(SOURCES) &
	vim $(RESULT).ml $(BASE)

profile:
# make clean
	make profiling-native-code
	./$(RESULT)
	gprof $(RESULT) | less

install: $(RESULT)
	scp $(RESULT) fmatsen@port:bin

-include $(OCAMLMAKEFILE)
