#==========================#OMyMakefile#==========================#UsefulfunctionstobuildOCamlprojects#|AflagtotellthatwecanuseOMyMakefilefunctionsWithOMy=true#|Theprefix.EqualtothePREFIXenvironmentvariabletryPREFIX=$(getenvPREFIX)defaulteprintln(SpecifyPREFIXorprefixenvironmentvariable.)exit1#OCaml#========================================================================#|PathtotheOCamllibrarydirectoryOCAML_WHERE=$(shellocamlc-where)#|VersionwithoutextensionsOCAML_VERSION=$(shellocamlc-version|sed-e's/^\([0-9.]*\).*/\1/')#|OMyrequiresOCamlFind!USE_OCAMLFIND=trueOCAMLFIND_DESTDIR=$(shellocamlfindprintconfdestdir)#|SetNATIVE_ENABLEDfalselocallyifaprojectdoesnotrequreoptcompilation.NATIVE_ENABLED=$(OCAMLOPT_EXISTS)NATIVE_SHARED_ENABLED=$(OCAMLOPT_EXISTS)BYTE_ENABLED=true#|Thedefaultwarninganderrors.Ifyouwanttousedifferentwarninganderrorswitches,useredefinethevariable.OCAMLFLAGS=-g-wA-4-9-warn-errorA-4-9#|GlobalvariabletobedefinedasemptyOCAMLPACKAGEFLAGS=#|Preinstalledlibrarieswhicharealwaysavailablefornormalocaml.##YoumaywanttoaddtherequiredpackageswhicharebuiltandinstalledoutofOMyframework:##::##includeOMyMakefile##OCAML_PREINSTALLED_PACKS+=llvm#llvmhasbeeninstalledalready,independently##Subdirs()##Itincludes"findlib"bydefault.IfyouwanttobuildfindlibinOMyframework,youhavetoremoveitfromthelist.OCAML_PREINSTALLED_PACKS[]=bigarraycamlp4dbmdynlinkgraphicsnumnum-topstdlibstrthreadsunixfindlibcompiler-libscompiler-libs.commoncompiler-libs.bytecompcompiler-libs.optcompcompiler-libs.toplevel#|Redefinitionofcompilercommandspublic.OCamlC()=value$(OCAMLFIND)$(OCAMLC)$(OCAMLPACKAGEFLAGS)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)\$(OCAMLCFLAGS)$(OCAMLPPFLAGS)$(PREFIXED_OCAMLINCLUDES)#Whyweneed"public."?public.OCamlOpt()=value$(OCAMLFIND)$(OCAMLOPT)$(OCAMLPACKAGEFLAGS)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)\$(OCAMLOPTFLAGS)$(OCAMLPPFLAGS)$(PREFIXED_OCAMLINCLUDES)if$(and$(not$(NATIVE_ENABLED))$(not$(BYTE_ENABLED)))err.=extends$(UnbuildableException)message=$(string$"You must turn on either NATIVE_ENABLED or BYTE_ENABLED")raise$(err)#|Additionalimplicitrulesbyfileextensions#annot,cmt,cmtifiles%.annot%.cmt:%.ml%.cmi$(OCamlC)-c-annot-bin-annot$<%.cmti:%.mli$(OCamlC)-c-bin-annot$<#|DefineOCAML_ANNOTsothatocamlc/ocamloptautomaticallycreateannot/cmt/cmtifiles,evenwithout-annot/-bin-annotoption.Thisrequiresaspecialcompilerpatchsetenv(OCAML_ANNOT,1)#|Enablethebacktracesetenv(OCAMLRUNPARAM,b)#Commonphonies#==================================================================.PHONY:allinstalluninstallcleanveryclean#Directories#=====================================================================#|ThebuildrootdirectoryBIG_ROOT=$(dir.)#Installationmarkfiles#=======================================================================#|Toenabletheinstallationmarkfiles,youmustdefineINSTALLEDpathvariable#forthemarkfiledirectorylikeINSTALLED=$(BIG_ROOT)/installedandmakesure#thedirectory$(INSTALLED)exists.Thispreparationmustbedoneoutsideof#thisOMyMakefile.#|Returnstheinstallationmarkfilesof$(packs)Installed(packs)=if$(definedINSTALLED)return$(addprefix$(INSTALLED)/,$(packs))elsereturn$(array)#|Createmd5sumfileoffiles$(targets)CreateCheckSum(pack,targets)=chan=$(fopen$(pack),w)fprintln($(chan),$(string$(targets)))fprintln($(chan),$(string$(digest$(targets))))close($(chan))#|Create$(Installed$(pack))filefromthedigestsof$(targets)CreateInstalled(pack,targets)=if$(definedINSTALLED)println(dumpmd5$(INSTALLED)/$(pack))CreateCheckSum($(INSTALLED)/$(pack),$(targets))#Packages#=========================================================#|OCamlpackagesrequiredforcompilation.MyCaml*functionsautomaticallyaddnecessarydependenciesoverpackagesin$(OCAMLPACKS).##..note::Theyarealsorequiredfordependencyanalysis.public.OCAMLPACKS[]=#|CamlP4syntaxextensionpackagesrequiredforparsing.MyCaml*functionsautomaticallyaddnecessarydependenciesoverpackagesin$(CAMLP4PACKS).public.CAMLP4PACKS[]=#Dependencies#=========================================================================#|ReturnspackagesmanagedbyOMyframeworkOMyManagedPackages(packages)=#needtorenamecamlimages.jpeg=>camlimagespackages_prefix=foreach(x,$(packages))match$(x)case$"^\([^.]+\).*"packages_prefix+=$1exportdefaultpackages_prefix+=$(x)exportexportreturn$(set-diff$(packages_prefix),$(OCAML_PREINSTALLED_PACKS))#|AdddependenciesofOCamlcompiledfiles(cmx,cmo,etc.)over$(files).##..note::Thesefunctionsintroduceimplicitrules:*youmayneedtoexportit,ifyouusethisfunctioninalocalcontext.*OCamlRequire(files)=%.cmx%.cmo%.cmi%.cma%.cmxa%.annot%.cmt%.cmti:$(files)export#|AdddependenciesofOCamlcompiledfiles(cmx,cmo,etc.)over$(packages).#$(packages)listedinOCAML_PREINSTALLED_PACKSareignored.##..note::Thesefunctionsintroduceimplicitrules:*youmayneedtoexportit,ifyouusethisfunctioninalocalcontext.*##..note::Usuallyyoudonotneedtocallthisfunction.UseOCAMLPACKSvariableinstead.OCamlRequirePackages(packages)=required_packs=$(OMyManagedPackages$(packages))if$(definedINSTALLED)%.cmx%.cmo%.cmi%.cma%.cmxa%.annot%.cmt%.cmti:$(Installed$(required_packs))exportexport#|AdddependenciesofOCamldependencyanalysisandbuildover$(packages).#UsethisforaddingdependenciesforCamlP4extensions.#$(packages)listedinOCAML_PREINSTALLED_PACKSareignored.##..note::Thesefunctionsintroduceimplicitrules:*youmayneedtoexportit,ifyouusethisfunctioninalocalcontext.*##..note::Usuallyyoudonotneedtocallthisfunction.UseCAML4PACKSvariableinstead.OCamlRequireCamlP4Packages(packages)=required_packs=$(OMyManagedPackages$(packages))if$(definedINSTALLED).SCANNER:scan-ocaml-%:$(Installed$(required_packs))%.cmx%.cmo%.cmi%.cma%.cmxa%.annot:$(Installed$(required_packs))exportexport#|``omakexxx.auto.mli``generates.mlifilefromxxx.ml%.auto.mli:%.ml$(OCamlC)-i-c$<>$@#Buildrules#==========================================================public.OCamlLibrary(name,files)=#XXX:JYH:thesevariablesshouldbemarkedprivatein0.9.9protected.name=$(file$(name))protected.OFILES=$(addsuffix$(EXT_OBJ),$(files))protected.CMOFILES=$(addsuffix.cmo,$(files))protected.CMXFILES=$(addsuffix.cmx,$(files))protected.CLIB=$(file$(name)$(EXT_LIB))protected.BYTELIB=$(file$(name).cma)protected.NATIVELIB=$(file$(name).cmxa)protected.NATIVESHAREDLIB=$(file$(name).cmxs)##Linkcommands#$(BYTELIB):$(CMOFILES)$(OCAMLFIND)$(OCAMLLINK)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)$(OCAMLCFLAGS)\$(OCAML_LIB_FLAGS)-a-o$@$(OCamlLinkSort$(CMOFILES))$(NATIVELIB)$(CLIB):$(CMXFILES)$(OFILES)$(OCAMLFIND)$(OCAMLOPTLINK)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)$(OCAMLOPTFLAGS)\$(OCAML_LIB_FLAGS)-a-o$(NATIVELIB)$(OCamlLinkSort$(CMXFILES))$(NATIVESHAREDLIB):$(CMXFILES)$(OFILES)$(OCAMLFIND)$(OCAMLOPTLINK)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)$(OCAMLOPTFLAGS)\$(OCAML_LIB_FLAGS)-shared-o$(NATIVESHAREDLIB)$(OCamlLinkSort$(CMXFILES))return$(array$(if$(NATIVE_ENABLED),$(NATIVELIB)),\$(if$(NATIVE_ENABLED),$(CLIB)),\$(if$(NATIVE_SHARED_ENABLED),$(NATIVESHAREDLIB)),\$(if$(BYTE_ENABLED),$(BYTELIB)))public.OCAML_BYTE_LINK_FLAGS=public.OCamlPackage(name,files)=#XXX:JYH:thesevariablesshouldbemarkedprivatein0.9.9protected.OFILES=$(addsuffix$(EXT_OBJ),$(files))protected.CMOFILES=$(addsuffix.cmo,$(files))protected.CMXFILES=$(addsuffix.cmx,$(files))protected.OBJ=$(file$(name)$(EXT_OBJ))protected.CMO=$(file$(name).cmo)protected.CMX=$(file$(name).cmx)protected.CMI=$(file$(name).cmi)protected.MLI=$(file$(name).mli)protected.BYTE_TARGETS=$(CMO)protected.NATIVE_TARGETS=$(CMX)$(OBJ)if$(BYTE_ENABLED)BYTE_TARGETS+=$(file$(name).cmt)exportelseNATIVE_TARGETS+=$(file$(name).cmt)exportexportprotected.TARGETS=$(CMI)if$(NATIVE_ENABLED)TARGETS+=$(NATIVE_TARGETS)exportif$(BYTE_ENABLED)TARGETS+=$(BYTE_TARGETS)export##Linkcommands#protected.BYTE_DEPS=$(CMOFILES)$(BYTE_TARGETS):$(CMOFILES)sectionruleif$(or$(NATIVE_ENABLED),$(target-exists$(MLI)))BYTE_DEPS+=$(CMI)exportelseBYTE_TARGETS+=$(CMI)export$(BYTE_TARGETS):$(BYTE_DEPS)$(OCAMLFIND)$(OCAMLC)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)\$(OCAMLCFLAGS)$(OCAML_LIB_FLAGS)-pack-bin-annot-o$(CMO)$(OCamlLinkSort$(CMOFILES))protected.NATIVE_DEPS=$(CMXFILES)$(OFILES)$(NATIVE_TARGETS):$(NATIVE_DEPS)sectionruleif$(target-exists$(MLI))NATIVE_DEPS+=$(CMI)exportelseNATIVE_TARGETS+=$(CMI)export$(NATIVE_TARGETS):$(NATIVE_DEPS)$(OCAMLFIND)$(OCAMLOPTLINK)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)\$(OCAMLOPTFLAGS)$(OCAML_LIB_FLAGS)-pack-bin-annot-o$(CMX)$(OCamlLinkSort$(CMXFILES))$(CMI):sectionruleif$(target-exists$(MLI))$(CMI):$(MLI):scanner:scan-ocaml-$(name).mli$(OCamlC)-c$<elseif$(NATIVE_ENABLED)$(NATIVE_TARGETS)$(CMI):$(NATIVE_DEPS)$(OCAMLFIND)$(OCAMLOPTLINK)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)\$(OCAMLOPTFLAGS)$(OCAML_LIB_FLAGS)-pack-o$(CMX)$(OCamlLinkSort$(CMXFILES))else$(BYTE_TARGETS)$(CMI):$(BYTE_DEPS)$(OCAMLFIND)$(OCAMLC)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)\$(OCAMLCFLAGS)$(OCAML_LIB_FLAGS)-pack-o$(CMO)$(OCamlLinkSort$(CMOFILES))return$(TARGETS)#AddimplicitdependenciesoverthepackagesdeclaredinOCAMLPACKSandCAMLP4PACKS#Ifthisfunctionisusedinalocalscope,youmaywanttoexport.AddLocalOCamlPackageDependencies()=#WemakesuretherequiredlibrariesareinstalledOCamlRequirePackages($(OCAMLPACKS))#mustbeexported!OCamlRequireCamlP4Packages($(OCAMLPACKS)$(CAMLP4PACKS))export#|AddaruleforOCamlpackage$(library_name).cmo,$(library_name).cmxandetc.#library_name#targetpackagename#files#MLmodulenames(without.ml)#cmodules#Csourcefiles(without.c)#linkopts#Clibrarylinkoption(withoutOCaml-ccliboptions)##YoucanspecifyMyOCamlPackageExtrasbeforeusingthisfunctiontoinstallfilesoutofthescopeofthisrule.##If$(NO_INSTALL)isdefined,omakeinstalldoesnotinstallthepackage##Example::##MyOCamlPackage(foo,alphabeta,$(EMPTY),$(EMPTY))##Todo:externalClibraryMyOCamlPackage(library_name,files,cmodules,linkopts)=AddLocalOCamlPackageDependencies()export#Theabovethingislocal:needtobeexportedCSTUBS=$(addsuffix.o,$(cmodules))CMOS=$(addsuffix.cmo,$(library_name))CMXS=$(addsuffix.cmx,$(library_name))CMA=$(library_name).cmaCMXA=$(library_name).cmxaif$(not$(definedMyOCamlPackageExtras))MyOCamlPackageExtras[]=exportCSTUBLIBRARIES=if$(not$(equal$(cmodules),$(EMPTY)))CSTUBLIBRARIES=dll$(library_name).solib$(library_name).aexport#CRjfuruse:Iguesswedonotneedthefollowing#export#exporttheimplicitruleabove.PHONY:install-libinstall-lib:$(library_name).cmo$(library_name).cmx$(library_name).cma$(library_name).cmxa$(MyOCamlPackageExtras)$(CMA)$(CMXA)$(library_name).a$(CSTUBLIBRARIES):$(CSTUBS)$(CMOS)$(CMXS)if$(not$(equal$(cmodules),$(EMPTY)))ocamlmklib-verbose-o$(library_name)$(CSTUBS)$(linkopts)$(CMOS)$(CMXS)else$(OCamlC)-a-o$(CMA)$(CMOS)$(OCamlOpt)-a-o$(CMXA)$(CMXS)##thefollowingsarenecessaryforpackingOCAMLPACKAGEFLAGS+=-for-pack$(capitalize$(library_name))#exportOCAMLPACKAGEFLAGS##buildrule.DEFAULT:$(OCamlPackage$(library_name),$(files))##cleanAutoClean()clean:rm-f$(library_name).cmt##install#CRjfuruse:x.cmiisrequiredifx.mlidoesnotexist!targets[]=META$(globi,*.mli)$(library_name).cmi$(library_name).cmo$(library_name).cmx$(library_name).cma$(library_name).cmxa$(library_name).o$(library_name).a$(CSTUBLIBRARIES)$(MyOCamlPackageExtras)targets[]+=$(library_name).cmtif$(not$(definedNO_INSTALL))if$(definedINSTALLED)$(Installed$(library_name)):$(targets)$(OCAMLFIND)remove$(library_name)section:$(OCAMLFIND)install$(library_name)$(targets)CreateInstalled($(library_name),$(targets))install:$(Installed$(library_name))uninstall:rm-f$(Installed$(library_name))$(OCAMLFIND)remove$(library_name)exportelseinstall:$(targets)$(OCAMLFIND)remove$(library_name)$(OCAMLFIND)install$(library_name)$(targets)uninstall:$(OCAMLFIND)remove$(library_name)exportexport##############################################################buildocamlexec#|Addaruletobuildaprogram$(name)#name#Nameoftheprogram#files#OCamlmodulenames(without.ml)MyOCamlTestProgram(name,files)=AddLocalOCamlPackageDependencies()export#Theabovethingislocal:needtobeexported$(name).run$(name).opt:$(Installed$(OMyManagedPackages$(OCAMLPACKS)))#CRjfuruse:forgottoaddthedepsoverthepackages!.DEFAULT:$(OCamlProgram$(name),$(files))#ThefollowingcleanthefilestwiceifMyOCamlPackgecoexists,#butwhocases?AutoClean()#|Addaruletobuildaprogram$(name)#name#Nameoftheprogram#files#OCamlmodulenames(without.ml)#InadditiontoMyOCamlTestProgram,thebinaryisinstalledbyomakeinstallMyOCamlProgram(name,files)=MyOCamlTestProgram($(name),$(files))export#Theabovethingislocal:needtobeexportedif$(not$(definedNO_INSTALL))install:$(name)$(name).run$(name).optinstall$(name)$(name).run$(name).opt$(PREFIX)/binuninstall:rm-f$(PREFIX)/bin/$(name)$(PREFIX)/bin/$(name).run$(PREFIX)/bin/$(name).optexport#|Addaruletobuildatoplevel$(name)#name#Nameoftheprogram#files#OCamlmodulenames(without.ml)OCamlTop(name,files)=#XXX:JYH:thesevariablesshouldbemarkedprivatein0.9.9protected.CMOFILES=$(addsuffix.cmo,$(files))#protected.CMXFILES=$(addsuffix.cmx,$(files))#protected.OFILES=$(addsuffix$(EXT_OBJ),$(files))protected.CMAFILES=$(addsuffix.cma,$(OCAML_LIBS))#protected.CMXAFILES=$(addsuffix.cmxa,$(OCAML_LIBS))protected.ARFILES=$(addsuffix$(EXT_LIB),$(OCAML_LIBS))protected.CMA_OTHER_FILES=$(addsuffix.cma,$(OCAML_OTHER_LIBS))#protected.CMXA_OTHER_FILES=$(addsuffix.cmxa,$(OCAML_OTHER_LIBS))protected.CLIBS=$(addsuffix$(EXT_LIB),$(OCAML_CLIBS))protected.name=$(file$(name))protected.PROG=$(file$(name)$(EXE))protected.BYTEPROG=$(file$(name).run)#protected.OPTPROG=$(file$(name).opt)##Rulestobuildbyte-codeandnativetargets#$(BYTEPROG):$(CMAFILES)$(CMOFILES)$(CLIBS)$(OCAMLFIND)$(OCAMLMKTOP)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLFLAGS)$(OCAMLCFLAGS)\$(PREFIXED_OCAMLINCLUDES)$(OCAML_BYTE_LINK_FLAGS)\-o$@$(CMA_OTHER_FILES)$(CMAFILES)$(OCamlLinkSort$(CMOFILES))\$(CLIBS)$(OCAML_LINK_FLAGS)$(PROG):$(BYTEPROG)ln-or-cp$<$@return$(array$(PROG),$(BYTEPROG))MyOCamlTop(name,files)=AddLocalOCamlPackageDependencies()export#Theabovethingislocal:needtobeexported$(name):$(Installed$(OMyManagedPackages$(OCAMLPACKS)))#CRjfuruse:forgottoaddthedepsoverthepackages!.DEFAULT:$(OCamlTop$(name),$(files))#ThefollowingcleanthefilestwiceifMyOCamlPackgecoexists,#butwhocases?AutoClean()export#Theabovethingislocal:needtobeexportedif$(not$(definedNO_INSTALL))install:$(name)$(name).runinstall$(name)$(name).run$(PREFIX)/binuninstall:rm-f$(PREFIX)/bin/$(name)$(PREFIX)/bin/$(name).runexport#|AddrulestobuildOCamllibrary$(name)#name#Nameofthelibrary#files#OCamlmodulename(without.ml)##..note::ProbablyyoushoulduseMyOCamlPackageMyOCamlLibrary(library_name,files)=AddLocalOCamlPackageDependencies()protected.CMIFILES=$(addsuffix.cmi,$(files))targets=$(OCamlLibrary$(library_name),$(files))$(CMIFILES)$(globi,*.mli).DEFAULT:$(targets)export#Theabovethingislocal:needtobeexportedif$(not$(definedNO_INSTALL))targets[]+=METAif$(definedINSTALLED)$(Installed$(library_name)):$(targets)$(OCAMLFIND)remove$(library_name)section:$(OCAMLFIND)install$(library_name)$(targets)CreateInstalled($(library_name),$(targets))install:$(Installed$(library_name))uninstall:rm-f$(Installed$(library_name))$(OCAMLFIND)remove$(library_name)exportelseinstall:$(targets)$(OCAMLFIND)remove$(library_name)$(OCAMLFIND)install$(library_name)$(targets)uninstall:$(OCAMLFIND)remove$(library_name)exportexport#ThefollowingcleanthefilestwiceifMyOCamlPacakgecoexists,#butwhocases?AutoClean()#Autoclean#====================================================================#|Installcleancommandwhichcleansallthetargetfilesexistsunderthedirectory.Usewithcare.AutoClean()=.PHONY:cleanclean:rm-f$(filter-proper-targets$(lsR,.))#Subdirtraversal#=====================================================================#|Recursivelytraversethesubdirsexcept$(dirs)Subdirs_except(dirs)=#println(PWD:$(shellpwd))#needtoexportsince.SUBDIRSisevaluatedintheglobalscopeexportVISIT_SUBDIRSsub_omakefiles=$(globi,*/OMakefile)subdirs=$(sub_omakefiles.map$(dirname))VISIT_SUBDIRS=$(set-diff$(subdirs),$(dirs))#println(SUBDIRS:$(string$(VISIT_SUBDIRS)))#Therule.SUBDIRS:$(VISIT_SUBDIRS)#|RecursivelytraverseallthesubdirsSubdirs()=Subdirs_except($(array))#|Recursivelytraversethegivensubdirs$(dirs)Subdirs_only(dirs)=.SUBDIRS:$(dirs)#DependencydotfilesforGraphviz#======================================================================#|Addarulefor``depend.dot``foradependencygraphofOCamlfilesinthecurrentdirectoryDot()=depend.dot:$(ls*.ml*.mli)$(OCAMLFIND)ocamldoc-I+threads$(OCAMLPACKAGEFLAGS)$(LAZY_OCAMLFINDFLAGS)$(PREFIXED_OCAMLPACKS)$(OCAMLPPFLAGS)$(PREFIXED_OCAMLINCLUDES)-dot-dot-include-all-dot-reduce$+-o$@#|filterlist#example::#is_url(file)=#match$(file)#case$'://'#returntrue#default#returnfalse##DOWNLOAD_URLS[]=$(list_filter$(funx,$(is_url$(x))),$(URLS))list_filter(pred,list)=result=foreach(x,$(list))if$(apply$(pred),$(x))result+=$(x)exportexportreturn$(result)#|ObtainfilesinstalledasPACKGET_OCAMLFIND_OBJS(pack)=return$(Files$(OCAMLFIND_DESTDIR)/$(pack))#Misctools#======================================================================#|ditto.mkdir_if_not_exists(dir)=if$(not$(test-e$(dir))):mkdir$(dir)return#Veryclean#======================================================================#|OCamlobjectfileswhicharenotrealtargetsofOMakearenotbe#auto-cleanedawayby``omakeclean``.Thisisnotgoodinsomesituations#atlinking.WithOCamlVeryClean()=veryclean:rm-f*.cm**.annot*.o*.a*.so*.exe*.byt*.opt*.run#Pa_ounittest#=======================================================================#|TestwithPa_ounit.Prettyversiondependent.#ThinkingfromtheimplementationPa_ounit_lib.Runtime,itshouldbe#prettyunstableinfuturereleasesofPa_ounit.Sigh.MyOCamlOUnitTest(LIB)=name=ounittest_$(LIB)$(name).ml:section:chan=$(fopen$@,w)fprintln($(chan),moduleM=$(capitalize$(LIB)))fprintln($(chan),let\(\)=Pa_ounit_lib.Runtime.summarize\(\))close($(chan))section:OCAML_LIBS=$(LIB)MyOCamlTestProgram($(name),$(name))inline_tests.log:$(name)println(Checkinline_tests.logfortestresults)./$(name)inline-test-runner$(capitalize$(LIB))-verbose-log-strict.PHONY:testtest:inline_tests.log