Skip to content

Commit

Permalink
omake beginning
Browse files Browse the repository at this point in the history
  • Loading branch information
Rok Strnisa committed Jun 25, 2010
1 parent 2f0eb40 commit c5e2317
Show file tree
Hide file tree
Showing 6 changed files with 269 additions and 0 deletions.
71 changes: 71 additions & 0 deletions OMakefile
@@ -0,0 +1,71 @@
########################################################################
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this file, to deal in the File without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the File, and to permit persons to whom the
# File is furnished to do so, subject to the following condition:
#
# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
# THE USE OR OTHER DEALINGS IN THE FILE.

########################################################################
# The standard OMakefile.

# .PHONY: all install clean

.SUBDIRS: src

# USE_OCAMLFIND = true
#
# OCAMLPACKS[] =
# pack1
# pack2
#
# if $(not $(OCAMLFIND_EXISTS))
# eprintln(This project requires ocamlfind, but is was not found.)
# eprintln(You need to install ocamlfind and run "omake --configure".)
# exit 1

# Include path
#
# OCAMLINCLUDES +=

NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))

OCAMLFLAGS += -g
# OCAMLCFLAGS +=
# OCAMLOPTFLAGS +=
# OCAML_LINK_FLAGS +=
# OCAML_BYTE_LINK_FLAGS +=
# OCAML_NATIVE_LINK_FLAGS +=

# FILES[] =
# file1
# file2
#
# LIB = main
#
# .DEFAULT: $(OCamlLibrary $(LIB), $(FILES))

################################################
# Build an OCaml program
#

# FILES[] =
# file1
# file2
#
# PROGRAM =
# OCAML_LIBS +=
# OCAML_CLIBS +=
# OCAML_OTHER_LIBS +=
# OCAML_LIB_FLAGS +=
#
# .DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))
36 changes: 36 additions & 0 deletions OMakeroot
@@ -0,0 +1,36 @@
########################################################################
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this file, to deal in the File without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the File, and to permit persons to whom the
# File is furnished to do so, subject to the following condition:
#
# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
# THE USE OR OTHER DEALINGS IN THE FILE.

########################################################################
# The standard OMakeroot file.
# You will not normally need to modify this file.
# By default, your changes should be placed in the
# OMakefile in this directory.
#

# Include the standard installed configuration files.
# Any of these can be deleted if you are not using them,
# but you probably want to keep the Common file.
# open build/C
open build/OCaml
# open build/LaTeX

# The command-line variables are defined *after* the
# standard configuration has been loaded.
DefineCommandVars()

# Include the OMakefile in this directory.
.SUBDIRS: .
36 changes: 36 additions & 0 deletions src/encodings/OMakefile
@@ -0,0 +1,36 @@
# targets not related to filenames
.PHONY: clean

# omake-related generated files
# (cannot delete the .omakedb from within omake. probably
# better to hide these files from hg/git, rather than
# deleting them)
OMAKE_GENERATED=*.{omc} .omakedb .omakedb.lock

# ocaml-related generated files
OCAML_GENERATED=*.{a,cmi,cmx,cmxa,o,opt}

# all generated files (used for 'clean')
GENERATED=$(OCAML_GENERATED) # $(OMAKE_GENERATED)

# process OMakefile(s) in the following sub-directories
# (note: a phony target in this file depends on the
# same-named targets in the sub-directories)
.SUBDIRS: test

# ml and mli files required to build the library
FILES[] = encodings encodings_private

# the meta name of the library
LIB_NAME = encodings

# the instructions to build the library file(s)
# (LIB = the resulting filename(s))
LIB_FILES = $(OCamlLibrary $(LIB_NAME), $(FILES))

# build library by default
.DEFAULT: $(LIB_FILES)

# clean the library and other intermediate files
clean:
rm -f $(LIB_FILES) $(GENERATED)
18 changes: 18 additions & 0 deletions src/encodings/OMakeroot
@@ -0,0 +1,18 @@
# The standard OMakeroot file.
# You will not normally need to modify this file.
# By default, your changes should be placed in the
# OMakefile in this directory.

# Include the standard installed configuration files.
# Any of these can be deleted if you are not using them,
# but you probably want to keep the Common file.
# open build/C
open build/OCaml
# open build/LaTeX

# The command-line variables are defined *after* the
# standard configuration has been loaded.
DefineCommandVars()

# Include the OMakefile in this directory.
.SUBDIRS: .
38 changes: 38 additions & 0 deletions src/encodings/test/OMakefile
@@ -0,0 +1,38 @@
# targets not related to filenames
.PHONY: test clean

# use ocamlfind (required for the ocamltest package)
USE_OCAMLFIND = true

# use the ocamltest package
OCAMLPACKS[] = ocamltest

# look for dependencies in the super directory
OCAMLINCLUDES += ..

# use the encodings library in the super directory
OCAML_LIBS += ../encodings

# ml and mli files required to build this program
FILES[] = encodings_test

# the meta name of the program
PROGRAM_NAME = encodings_test

# the program's executable file
PROGRAM = $(PROGRAM_NAME)$(EXE)

# instructions for creating the executable(s)
# (PROGRAM_FILES = resulting target filename(s))
PROGRAM_FILES = $(OCamlProgram $(PROGRAM_NAME), $(FILES))

# run the test (defined below) by default
.DEFAULT: test

# create and run the executable
test: $(PROGRAM_FILES)
./$(PROGRAM)

# clean the executable(s) and other intermediate files
clean:
rm -f $(PROGRAM_FILES) $(GENERATED)
70 changes: 70 additions & 0 deletions src/ocamltest/OMakefile
@@ -0,0 +1,70 @@
########################################################################
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this file, to deal in the File without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the File, and to permit persons to whom the
# File is furnished to do so, subject to the following condition:
#
# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
# THE USE OR OTHER DEALINGS IN THE FILE.

########################################################################
# The standard OMakefile.

# .PHONY: all install clean

# USE_OCAMLFIND = true
#
# OCAMLPACKS[] =
# pack1
# pack2
#
# if $(not $(OCAMLFIND_EXISTS))
# eprintln(This project requires ocamlfind, but is was not found.)
# eprintln(You need to install ocamlfind and run "omake --configure".)
# exit 1

# Include path
#
# OCAMLINCLUDES +=

FILES[] =
ocamltest

LIB = ocamltest

.DEFAULT: $(OCamlLibrary $(LIB), $(FILES))

################################################
# Build an OCaml program
#

# FILES[] =
# file1
# file2
#
# PROGRAM =
# OCAML_LIBS +=
# OCAML_CLIBS +=
# OCAML_OTHER_LIBS +=
# OCAML_LIB_FLAGS +=
#
# .DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))

VERSION = 0.1

META: META.in
sed 's/@VERSION@/$(VERSION)/g' < $< > $@

.PHONY: install
install: ocamltest META
ocamlfind install -ldconf ignore ocamltest META *.cm{i,x,xa}

.PHONY: remove
ocamlfind remove ocamltest

0 comments on commit c5e2317

Please sign in to comment.