diff --git a/OMakefile b/OMakefile new file mode 100644 index 0000000..240f700 --- /dev/null +++ b/OMakefile @@ -0,0 +1,51 @@ +USE_OCAMLFIND = true +NATIVE_ENABLED = true +BYTE_ENABLED = true + +OCAMLPACKS[] = + csv + sqlite3 + lwt + lwt.ppx + lwt.unix + threads + +OCAMLFLAGS = -thread -bin-annot -g -w +a-4-6-9-27..29-32..99 -warn-error -a + +OCAMLDEP_MODULES_ENABLED = false + +%.sig: %.ml %.cmo + $(OCAMLFIND) ocamlc -package $(concat \,, $(OCAMLPACKS)) \ + $(OCAMLFINDFLAGS) \ + $(mapprefix -I, $(OCAMLINCLUDES)) \ + $(OCAMLFLAGS) $(OCAMLCFLAGS) -i $< > $@ + +.SUBDIRS: src tests/ppx tests/syntax + +.PHONY: clean + +clean: + rm -f $(filter-proper-targets $(ls R, .)) *.s *.annot *.so *.a + +section + VERSION = $`(shell oasis query Version | tail -1) + NAME = $`(string ocaml-sqlexpr-$(VERSION)) + DATE = $`(shell date +%F) + BRANCH = $`(string $(VERSION)_$(DATE)) + + .PHONY: release + release: + git checkout -b $(BRANCH) + oasis setup + echo "let () = Ocamlbuild_plugin.dispatch (fun hook -> Ocamlbuild_cppo.dispatcher hook)" >> myocamlbuild.ml + git add -f src/META sqlexpr.odocl Makefile _tags configure \ + myocamlbuild.ml setup.ml \ + src/sqlexpr.mllib src/syntax/sqlexpr_syntax.mllib src/ppx/ppx.mllib + git commit -m "Add OASIS-generated build system." + git archive -v --prefix $(NAME)/ -o $(NAME).tar HEAD + rm -f $(NAME).tar.gz + gzip $(NAME).tar + git checkout master + git branch -D $(BRANCH) + +# vim: set sw=4 et: diff --git a/OMakeroot b/OMakeroot new file mode 100644 index 0000000..4b2972f --- /dev/null +++ b/OMakeroot @@ -0,0 +1,6 @@ +open build/C +open build/OCaml + +DefineCommandVars() + +.SUBDIRS: . \ No newline at end of file diff --git a/src/OMakefile b/src/OMakefile new file mode 100644 index 0000000..eb4998b --- /dev/null +++ b/src/OMakefile @@ -0,0 +1,17 @@ +.SUBDIRS: syntax + unsetenv(OCAMLFIND_TOOLCHAIN) + OCAMLFINDFLAGS = -syntax camlp4o + NATIVE_ENABLED = false + OCAMLPACKS[] = estring camlp4.quotations + pa_sql.cmi pa_sql.cmo: pa_sql.ml + +.SUBDIRS: ppx + OCAMLPACKS[] = compiler-libs.common ocaml-migrate-parsetree ppx_tools_versioned ppx_core re.pcre unix ppx_tools_versioned.metaquot_403 + OCamlProgram(ppx_sqlexpr, sqlexpr_parser ppx_sqlexpr) + +.SCANNER: scan-ocaml-%.ml: %.ml syntax/pa_sql.cmo +.SCANNER: scan-ocaml-%.mli: %.mli syntax/pa_sql.cmo + +OCamlLibrary(sqlexpr, sqlexpr_utils sqlexpr_concurrency sqlexpr_sqlite sqlexpr_sqlite_lwt) + +.DEFAULT: syntax/pa_sql.cmo ppx/ppx_sqlexpr sqlexpr.cma sqlexpr.cmxa diff --git a/tests/ppx/OMakefile b/tests/ppx/OMakefile new file mode 100644 index 0000000..bdb85f2 --- /dev/null +++ b/tests/ppx/OMakefile @@ -0,0 +1,35 @@ +EXTENSIONS = $(ROOT)/src/ppx/ppx_sqlexpr + +.SCANNER: scan-ocaml-%.ml: %.ml $(EXTENSIONS) +.SCANNER: scan-ocaml-%.mli: %.mli $(EXTENSIONS) + +OCAMLINCLUDES += $(ROOT)/src +OCAML_LIBS[] += $(ROOT)/src/sqlexpr + +section + OCAMLPACKS[] = + compiler-libs.common + csv + lwt + lwt.ppx + lwt.unix + ppx_tools.metaquot + re.pcre + sqlite3 + threads + oUnit + unix + + OCAMLFINDFLAGS = -ppx $(ROOT)/src/ppx/ppx_sqlexpr -ppxopt lwt.ppx,-no-debug + OCAMLDEPFLAGS = -ppx $(ROOT)/src/ppx/ppx_sqlexpr + + OCamlProgram(t_parse, t_parse) + OCamlProgram(t_sqlexpr, t_sqlexpr) + $(addsuffixes .o .cmx .cmi .cmo, t_parse t_sqlexpr): + +.PHONY: test +test: t_sqlexpr$(EXE) t_parse$(EXE) + ./t_sqlexpr + ./t_parse + +# vim: set ts=8 expandtab sw=4: diff --git a/tests/syntax/OMakefile b/tests/syntax/OMakefile new file mode 100644 index 0000000..4e0d0d4 --- /dev/null +++ b/tests/syntax/OMakefile @@ -0,0 +1,21 @@ +EXTENSIONS = $(ROOT)/src/syntax/pa_sql.cmo + +.SCANNER: scan-ocaml-%.ml: %.ml $(EXTENSIONS) +.SCANNER: scan-ocaml-%.mli: %.mli $(EXTENSIONS) + +OCAMLINCLUDES += $(ROOT)/src +OCAML_LIBS[] += $(ROOT)/src/sqlexpr + +section + OCAMLPACKS[] = csv estring lwt.syntax lwt.unix oUnit sqlite3 threads + OCAMLFINDFLAGS = -syntax camlp4o -ppopt $(ROOT)/src/syntax/pa_sql.cmo + OCamlProgram(t_sqlexpr_sqlite, t_sqlexpr_sqlite) + OCamlProgram(bm_sqlexpr_sqlite_lwt, bm_sqlexpr_sqlite_lwt) + $(addsuffixes .o .cmx .cmi .cmo, bm_sqlexpr_sqlite_lwt t_sqlexpr_sqlite): + +.PHONY: test +test: t_sqlexpr$(EXE) t_parse$(EXE) + ./t_sqlexpr + ./t_parse + +# vim: set ts=8 expandtab sw=4: