Skip to content

Commit

Permalink
build using OASIS
Browse files Browse the repository at this point in the history
  • Loading branch information
avsm committed Jan 5, 2012
1 parent d74884b commit 78992bd
Show file tree
Hide file tree
Showing 10 changed files with 5,642 additions and 66 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.*.swp
_build/
setup.data
setup.log
*.bak
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Building using OASIS.
- Improved API for accessing substring information.
- The search can now be bounded to a given length.
- The function "execp" returns a boolean indicating whether the match
Expand Down
3 changes: 0 additions & 3 deletions META

This file was deleted.

77 changes: 14 additions & 63 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,68 +1,19 @@
.PHONY: all clean install build
all: build

NAME = re
setup.data:
ocaml setup.ml -configure

OCAMLC = ocamlfind ocamlc -g
OCAMLOPT = ocamlfind ocamlopt -unsafe
OCAMLDEP = ocamldep
build: setup.data
ocaml setup.ml -build

INCFLAGS =
OBJECTS = cset.cmo automata.cmo \
re.cmo re_posix.cmo re_emacs.cmo re_perl.cmo re_glob.cmo re_str.cmo
XOBJECTS = $(OBJECTS:cmo=cmx)
INTFS = re.mli re_posix.mli re_emacs.mli re_perl.mli re_glob.mli re_str.mli
install:
ocaml setup.ml -install

ARCHIVE = $(NAME).cma
XARCHIVE = $(NAME).cmxa
reinstall:
ocamlfind -remove regexp || true
ocaml setup.ml -reinstall

REQUIRES =
PREDICATES =

all: $(ARCHIVE)
opt: $(XARCHIVE)

$(ARCHIVE): $(OBJECTS)
$(OCAMLC) -a -o $(ARCHIVE) -package "$(REQUIRES)" -linkpkg \
-predicates "$(PREDICATES)" $(OBJECTS)
$(XARCHIVE): $(XOBJECTS)
$(OCAMLOPT) -a -o $(XARCHIVE) -package "$(REQUIRES)" -linkpkg \
-predicates "$(PREDICATES)" $(XOBJECTS)

.SUFFIXES: .cmo .cmi .cmx .ml .mli

.ml.cmo:
$(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
$(INCFLAGS) -c $<
.mli.cmi:
$(OCAMLC) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
$(INCFLAGS) -c $<
.ml.cmx:
$(OCAMLOPT) -package "$(REQUIRES)" -predicates "$(PREDICATES)" \
$(INCFLAGS) -c $<

depend: *.ml *.mli
$(OCAMLDEP) $(INCFLAGS) *.ml *.mli util/*.ml util/*.mli > depend
include depend

install: all
{ test ! -f $(XARCHIVE) || extra="$(XARCHIVE) "`basename $(XARCHIVE) .cmxa`.a; }; \
ocamlfind install $(NAME) $(INTFS) $(INTFS:mli=cmi) $(ARCHIVE) META $$extra

uninstall:
ocamlfind remove $(NAME)

clean::
rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o
rm -f util/*.cmi util/*.cmo util/*.cmx util/*.o

clean::
cd tests; make clean

realclean: clean
rm -f *~ util/*~

distrib: realclean
cd ..; tar zcvf re.tar.gz --exclude CVS re

check: $(ARCHIVE)
fort $(ARCHIVE) -env tests/env.ml \
tests/test_re.ml tests/test_emacs.ml tests/test_perl.ml
clean:
ocamlbuild -clean
rm -f setup.data setup.log
13 changes: 13 additions & 0 deletions _oasis
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
OASISFormat: 0.2
Name: regexp
Version: 0.9-dev
Synopsis: Pure OCaml regular expression library
Authors: Jerome Vouillon
License: LGPL-2.0 with OCaml linking exception
Plugins: META (0.2)

Library re
Path: lib
BuildTools: ocamlbuild
Modules: Re,Cset,Automata,Re_posix,Re_perl,Re_glob,Re_str

18 changes: 18 additions & 0 deletions _tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# OASIS_START
# DO NOT EDIT (digest: ecd10cf2b97824384a608da0dc44c060)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
<**/.svn>: -traverse
<**/.svn>: not_hygienic
".bzr": -traverse
".bzr": not_hygienic
".hg": -traverse
".hg": not_hygienic
".git": -traverse
".git": not_hygienic
"_darcs": -traverse
"_darcs": not_hygienic
# Library re
"lib": include
# OASIS_STOP
9 changes: 9 additions & 0 deletions lib/META
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# OASIS_START
# DO NOT EDIT (digest: 50f4e2b5330b2d9e94554eba6b37b43c)
version = "0.9-dev"
description = "Pure OCaml regular expression library"
archive(byte) = "re.cma"
archive(native) = "re.cmxa"
exists_if = "re.cma"
# OASIS_STOP

10 changes: 10 additions & 0 deletions lib/re.mllib
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# OASIS_START
# DO NOT EDIT (digest: db3e05d0568bfbd5227f0a2c226b2475)
Re
Cset
Automata
Re_posix
Re_perl
Re_glob
Re_str
# OASIS_STOP
Loading

0 comments on commit 78992bd

Please sign in to comment.