########## Basic settings # Set OCamlMakefile to use export OCAMLMAKEFILE = OCamlMakefile # Export some common variable settings export ANNOTATE = yes export OCAMLFLAGS = -w Alepm export OCAMLNCFLAGS = -w Alpeuyzm -inline 10 -noassert export OCAMLDOCFLAGS = -all-params -colorize-code export PP = camlp4o ########## Sources PLOT_SRCS = \ grace_proc.ml \ grace_proc.mli \ grace.ml \ grace.mli \ ezplot.ml \ Z_SRCS = \ zPervasives.ml \ zHashtbl.ml \ zHashset.ml \ zBBTSet.ml \ zBBTMap.ml \ zDerive.ml \ zOption.ml \ zLazyList.ml \ zEnum.ml \ zEnumable.ml \ zFoldable.ml \ zFoldable2.ml \ zList.ml \ zArray.ml \ zString.ml \ zSet.ml \ zDict.ml \ zQueue.ml \ zMath.ml \ zTime.ml \ zEnv.ml \ ZTEST_SRCS = \ zDict_test.ml \ zSet_test.ml \ zArray_test.ml \ zList_test.ml \ zFoldable_test.ml \ zPervasives_test.ml \ zEnumable_test.ml \ zQueue_test.ml ########## Projects # These projects define different "targets". Not in the traditional sense of # target (eg. executable vs. library), but in the sense of what we want to # build (eg. base sources vs. test suite vs. demo) # define PROJ_pf_coreobj # USE_CAMLP4 = yes # SOURCES = pf_coreobj.ml # RESULT = pf_coreobj # export LIBINSTALL_META = pf_coreobj.META # LIBINSTALL_FILES = pf_coreobj.* # endef # export PROJ_pf_coreobj define PROJ_pa_openin USE_CAMLP4 = yes PPFLAGS = -I +camlp4 PACKS = LIBS = SOURCES = pa_openin.ml DOC_FILES = pa_openin.ml LIB_PACK_NAME = RESULT = pa_openin LIBINSTALL_META = pa_openin.META LIBINSTALL_FILES = pa_openin.* endef export PROJ_pa_openin define PROJ_pa_oo USE_CAMLP4 = yes PPFLAGS = -I +camlp4 PACKS = LIBS = SOURCES = pa_oo.ml DOC_FILES = pa_oo.ml LIB_PACK_NAME = RESULT = pa_oo LIBINSTALL_META = pa_oo.META LIBINSTALL_FILES = pa_oo.* endef export PROJ_pa_oo define PROJ_plot USE_CAMLP4 = yes PPFLAGS = -I `ocamlfind -query mikmatch_pcre` pa_mikmatch_pcre.cma PACKS = extlib mathlib str unix pcre mikmatch_pcre LIBS = SOURCES = $(PLOT_SRCS) DOC_FILES = $(PLOT_SRCS) LIB_PACK_NAME = plot RESULT = plot LIBINSTALL_META = plot.META LIBINSTALL_FILES = plot.* endef export PROJ_plot define PROJ_zUtils USE_CAMLP4 = yes PPFLAGS = -I +camlp4 pa_openin.cmo pa_oo.cmo PACKS = batteries batteries_nothreads extlib mathlib LIBS = plot SOURCES = $(Z_SRCS) DOC_FILES = $(Z_SRCS) LIB_PACK_NAME = zUtils RESULT = zUtils LIBINSTALL_META = zUtils.META LIBINSTALL_FILES = zUtils.* endef export PROJ_zUtils define PROJ_ztest USE_CAMLP4 = yes PPFLAGS = -I +camlp4 pa_openin.cmo pa_oo.cmo PACKS = batteries batteries_nothreads extlib mathlib str unix pcre mikmatch_pcre LIBS = plot zUtils SOURCES = $(ZTEST_SRCS) DOC_FILES = $(ZTEST_SRCS) LIB_PACK_NAME = ztest RESULT = ztest LIBINSTALL_META = ztest.META LIBINSTALL_FILES = ztest.* endef export PROJ_ztest ### Default rules and such ifndef SUBPROJS export SUBPROJS = pa_openin pa_oo plot zUtils ztest endif .PHONY: all opt test clean install doc all: $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=dcl opt: $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=ncl clean: $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=clean test: SUBPROJS=ztest $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=clean $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=dcl SUBPROJS=ztest $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=dc ./ztest install: all opt test $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=libuninstall $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=libinstall uninstall: $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=libuninstall %: $(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@