# 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 SOURCES = ex1.ml c4ex.ml RESULT = ex1 export 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 PPFLAGS = -DNATIVE SOURCES = ex2.ml c4ex.ml RESULT = ex2 export PACKS = unix endef export PROJ_ex2 #ifndef SUBPROJS #export SUBPROJS = ex2 clean ex1 #endif # Default target to use #all: bc ex1: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=bc SUBPROJS=ex1 ex2: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=nc SUBPROJS=ex2 clean: @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=clean SUBPROJS="ex1 ex2" # Catch-all target will be applied to all subprojects automatically #%: # @$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@