# Set OCamlMakefile to use export OCAMLMAKEFILE = /usr/share/ocaml-tools/OCamlMakefile # Define project "ex1" # this project should be compiled in bc define PROJ_ex1 USE_CAMLP4 := yes PRE_TARGETS := c4ex.cmi c4ex.cmo SOURCES = ex1.ml RESULT = ex1 PACKS := dynlink unix endef export PROJ_ex1 # Define project "ex2" # this subprojet should use NATIVE and remove # dynlink functions define PROJ_ex2 USE_CAMLP4 := yes PRE_TARGETS := c4ex.cmi c4ex.cmo SOURCES = ex2.ml RESULT = ex2 PACKS := unix PPFLAGS := -DNATIVE endef export PROJ_ex2 # by default I want to compile the bc ifndef SUBPROJS export SUBPROJS = ex1 endif # Default target to use all: bc # Catch-all target will be applied to all subprojects automatically %: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@