1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
include ../Makefile.template
# If coThreads is built but not installed, pass LOCAL variable to make e.g "make all LOCAL=../src"
INCLUDES=$(if $(LOCAL),-I $(LOCAL))
PATHROOT=$(if $(LOCAL),$(LOCAL)/, )
IFRAY = $(if $(findstring ray,$@), $(if $(findstring opt,$@),ray.cmx,ray.cmo))
VMPARAM = -I $(PATHROOT)vmthreads $(IFRAY) cothreads.cma
NATHPARAM = -I $(PATHROOT)threads $(IFRAY) unix.cma cothreads.cma
NATHOPTPARAM = $(NATHPARAM:%.cma=%.cmxa)
PROCPARAM = -I $(PATHROOT)process $(IFRAY) unix.cma cothreads.cma
PROCOPTPARAM = $(PROCPARAM:%.cma=%.cmxa)
%.vmth: %.cmo
$(OCAMLC) -o $@ $(VMPARAM) $<
%.nath: %.cmo
$(OCAMLC) -o $@ $(NATHPARAM) $<
ifeq ($(NATIVE),yes)
%.nath.opt: %.cmx
$(OCAMLOPT) -o $@ $(NATHOPTPARAM) $<
endif
%.proc: %.cmo
$(OCAMLC) -o $@ $(PROCPARAM) $<
ifeq ($(NATIVE),yes)
%.proc.opt: %.cmx
$(OCAMLOPT) -o $@ $(PROCOPTPARAM) $<
endif
ALLTEST = coth evt lock ray_col ray_nocol test mvar merge mcast phil santa
all: $(ALLTEST:%=%.vmth) $(ALLTEST:%=%.nath) $(ALLTEST:%=%.nath.opt) $(ALLTEST:%=%.proc) $(ALLTEST:%=%.proc.opt)
clean: ocamlclean
$(RM) *.vmth *.nath *.proc *.netw *.opt *.pgm
# TODO:
# NETWPARAM = -I networker $(IFRAY) unix.cma cothreads.cma
# NETWOPTPARAM = $(NETWOPTPARAM:%.cma=%.cmxa)
# %.netw: %.cmo
# $(OCAMLC) -o $@ $(NETWPARAM) $<
# %.netw.opt: %.cmx
# $(OCAMLOPT) -o $@ $(NETWOPTPARAM) $<
|