[OCaml] Add a class example

It is based on the Python class example. The Makefile is based on the
Makefile used in the OCaml shapes example.
This commit is contained in:
Zackery Spytz 2019-01-11 17:53:38 -07:00
commit 96c5a95878
6 changed files with 164 additions and 4 deletions

View file

@ -0,0 +1,31 @@
TOP = ../..
SWIGEXE = $(TOP)/../swig
SWIG_LIB_DIR = $(TOP)/../$(TOP_BUILDDIR_TO_TOP_SRCDIR)Lib
SWIGOPT =
SRCS = example.c
TARGET = example
INTERFACE = example.i
PROGFILE = runme.ml
OBJS = example.o
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_run
build: static
static:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
ocaml_static_cpp
static_top:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' \
SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
PROGFILE='$(PROGFILE)' OBJS='$(OBJS)' \
ocaml_static_cpp_toplevel
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' TARGET='$(TARGET)' ocaml_clean