OSDN Git Service

apply OMakefile for src/
authormzp <mzpppp@gmail.com>
Fri, 10 Oct 2008 03:55:07 +0000 (12:55 +0900)
committermzp <mzpppp@gmail.com>
Fri, 10 Oct 2008 03:55:07 +0000 (12:55 +0900)
OMakefile [new file with mode: 0644]
OMakeroot [new file with mode: 0644]
src/OMakefile [new file with mode: 0644]
src/asm.mli [deleted file]
src/instruction.mlp [moved from src/instruction.ml with 98% similarity]
util/OMakefile

diff --git a/OMakefile b/OMakefile
new file mode 100644 (file)
index 0000000..77467c5
--- /dev/null
+++ b/OMakefile
@@ -0,0 +1,160 @@
+########################################################################
+# 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.
+# You will usually need to modify this file for your project.
+
+# Delete this line once you have configured this file
+eprintln($(CWD)/OMakefile is not configured)
+
+########################################################################
+# Phony targets are scoped, so you probably want to declare them first.
+#
+
+# .PHONY: all install clean
+
+########################################################################
+# Subdirectories.
+# You may want to include some subdirectories in this project.
+# If so, define the subdirectory targets and uncomment this section.
+#
+
+.SUBDIRS: test src util
+
+########################################################################
+# C configuration.
+# Delete this section if you are not building C files.
+#
+
+################################################
+# Configuration.  You might want to modify any of these
+# configuration variables.
+#
+
+# CFLAGS +=
+# ASFLAGS +=
+# LDFLAGS +=
+# INCLUDES +=
+
+################################################
+# Uncomment the following section if you want
+# to build a C program in the current directory.
+#
+
+# CFILES[] =
+#    file1
+#    main
+#
+# MAIN = main
+#
+# .DEFAULT: $(CProgram $(MAIN), $(CFILES))
+
+################################################
+# Uncomment the following section if you want to build a C library
+# in the current directory.
+#
+
+# LIBFILES[] =
+#    file1
+#    file2
+#
+# LIB = libxxx
+#
+# .DEFAULT: $(StaticCLibrary $(LIB), $(LIBFILES))
+
+########################################################################
+# OCaml configuration.
+# Delete this section if you are not building OCaml files.
+#
+
+################################################
+# Configuration.  You may want to modify any of these configuration
+# variables.
+#
+
+#
+# This project requires ocamlfind (default - false).
+#
+# 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 +=
+
+#
+# Compile native or byte code? 
+#
+# The default values are defined as follows:
+#
+# NATIVE_ENABLED = $(OCAMLOPT_EXISTS)
+# BYTE_ENABLED = $(not $(OCAMLOPT_EXISTS))
+
+#
+# Various options
+#
+# OCAMLFLAGS    +=
+# OCAMLCFLAGS   +=
+# OCAMLOPTFLAGS +=
+# OCAML_LINK_FLAGS +=
+# OCAML_BYTE_LINK_FLAGS +=
+# OCAML_NATIVE_LINK_FLAGS +=
+
+################################################
+# Generated files
+#
+# Workaround for the fact that ocamldep does not pay attention to .mll
+# and .mly files.
+#
+# OCamlGeneratedFiles(parser.ml lexer.ml)
+
+################################################
+# Build an OCaml library
+#
+
+# 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))
diff --git a/OMakeroot b/OMakeroot
new file mode 100644 (file)
index 0000000..35c219d
--- /dev/null
+++ b/OMakeroot
@@ -0,0 +1,45 @@
+########################################################################
+# 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.
+#
+# If you decide to modify this file, note that it uses exactly
+# the same syntax as the OMakefile.
+#
+
+#
+# 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: .
diff --git a/src/OMakefile b/src/OMakefile
new file mode 100644 (file)
index 0000000..af3097f
--- /dev/null
@@ -0,0 +1,83 @@
+.PHONY: clean
+
+################################################
+#
+# This project requires ocamlfind
+#
+USE_OCAMLFIND = true
+
+OCAMLPACKS[] =
+     extlib
+     core
+
+
+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 +=
+
+#
+# Compile native or byte code? 
+#
+NATIVE_ENABLED = false
+BYTE_ENABLED = true
+
+#
+# Various options
+#
+OCAMLFLAGS    += -thread
+OCAMLPPFLAGS   += -pp 'camlp4o'
+OCAMLDEPFLAGS  += $(OCAMLPPFLAGS)
+
+
+################################################
+# Build an OCaml program
+#
+
+FILES[] =
+       abc
+       asm
+       ast
+       base
+       bytes
+       closuretrans
+       codegen
+       cpool
+       hList
+       instruction
+       label
+       lexer
+       lisp
+       main
+       parsec
+       sexp
+
+
+PROGRAM = aosh
+OCAML_OTHER_LIBS += threads
+
+.DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))
+
+
+
+%.ml: %.mlp match_body.ml opcode.ml
+    @rm -f $@
+    @echo "(* CAUTION: this is a generated file.  If you edit it, all changes will be lost! *)" > $@
+    $(CPP) $*.mlp >> $@
+    @chmod 444 $@
+
+
+match_body.ml: ../util/instruction ../util/instruction.txt
+    ../util/instruction -m < ../util/instruction.txt > $@
+    ../util/instruction -s < ../util/instruction.txt >> $@
+
+opcode.ml: ../util/instruction ../util/instruction.txt
+    ../util/instruction -t < ../util/instruction.txt > $@
+
+clean:
+       rm -f  $(PROGRAM) *.cm[iox] *.o *.omc *.opt *.run *~ match_body.ml opcode.ml instruction.ml
\ No newline at end of file
diff --git a/src/asm.mli b/src/asm.mli
deleted file mode 100644 (file)
index 92a842f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-type klass_type = Sealed | Final | Interface | ProtectedNs of Cpool.namespace
-
-type instruction =
-#include "opcode.ml"
- and meth = {
-  name: Cpool.multiname;
-  params: int list;
-  return: int;
-  flags:int;
-  instructions:instruction list;
-  traits: int list;
-  exceptions: int list;
-} and klass = {
-   cname:     Cpool.multiname;
-   sname:     Cpool.multiname;
-   flags_k:   klass_type list;
-   cinit:     meth;
-   iinit:     meth;
-   interface: klass list;
-   methods:   meth list
-}
-
-type t = {
-  abc_cpool:     Abc.cpool;
-  method_info:   Abc.method_info list;
-  method_body:   Abc.method_body list;
-  class_info:    Abc.class_info  list;
-  instance_info: Abc.instance_info list
-}
-
-val make_meth: ?args:int list -> string -> instruction list -> meth
-val make_proc: ?args:int list -> string -> instruction list -> meth
-val assemble : meth -> t
-
-(**{6 For debug}*)
-
-val string_of_instruction : instruction -> string
-val collect_method : meth -> meth list
-val collect_const  : meth -> Cpool.t
-
similarity index 98%
rename from src/instruction.ml
rename to src/instruction.mlp
index 13c37c6..9ae53c5 100644 (file)
@@ -77,4 +77,4 @@ let klass_const {cname=cname;
     List.map multiname [cname;sname];
     List.map method_const (cinit::iinit::methods)]
     
-#include "match.ml"
+#include "match_body.ml"
index f16721f..875ac8b 100644 (file)
@@ -12,4 +12,4 @@ OCAML_OTHER_LIBS += str
 .DEFAULT: $(OCamlProgram $(PROGRAM), $(FILES))
 
 clean:
-       rm -f  $(PROGRAM) *.cm[iox] *.o *.omc *.opt *.run *~
\ No newline at end of file
+       rm -f  $(PROGRAM) *.cm[iox] *.o *.omc *.opt *.run *~