Skip to content

Commit

Permalink
omake files were added
Browse files Browse the repository at this point in the history
  • Loading branch information
Freyr committed Oct 3, 2017
1 parent 89ab231 commit 9e6a101
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 0 deletions.
51 changes: 51 additions & 0 deletions 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:
6 changes: 6 additions & 0 deletions OMakeroot
@@ -0,0 +1,6 @@
open build/C
open build/OCaml

DefineCommandVars()

.SUBDIRS: .
17 changes: 17 additions & 0 deletions 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
35 changes: 35 additions & 0 deletions 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:
21 changes: 21 additions & 0 deletions 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:

0 comments on commit 9e6a101

Please sign in to comment.