Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.a
*.o
*.cmx
*.cmxa
*.cmo
*.cmi
*.so
*.cma
._bcdi/
._d/
._ncdi/
.*.swp
stubgen
lib/ffi_generated.ml
lib/ffi_generated_stubs.c
8 changes: 8 additions & 0 deletions META
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version = "111.08.00"
description = "Async wrappers for ssl"
requires = "threads core async ctypes ctypes.stubs herelib pa_bench pa_bench.syntax pa_ounit sexplib"
archive(byte) = "async_ssl.cma"
archive(byte, plugin) = "async_ssl.cma"
archive(native) = "async_ssl.cmxa"
archive(native, plugin) = "async_ssl.cmxs"
exists_if = "async_ssl.cma"
112 changes: 59 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
# Generic Makefile for oasis project

# Set to setup.exe for the release
SETUP := setup-dev.exe

# Default rule
default: build

# Setup for the development version
setup-dev.exe: _oasis setup.ml
grep -v '^#' setup.ml > setup_dev.ml
ocamlfind ocamlopt -o $@ -linkpkg -package ocamlbuild,oasis.dynrun setup_dev.ml || ocamlfind ocamlc -o $@ -linkpkg -package ocamlbuild,oasis.dynrun setup_dev.ml || true
rm -f setup_dev.*

# Setup for the release
setup.exe: setup.ml
ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
rm -f setup.cmx setup.cmi setup.o setup.obj setup.cmo

build: $(SETUP) setup.data
./$(SETUP) -build $(BUILDFLAGS)

doc: $(SETUP) setup.data build
./$(SETUP) -doc $(DOCFLAGS)

test: $(SETUP) setup.data build
./$(SETUP) -test $(TESTFLAGS)

all: $(SETUP)
./$(SETUP) -all $(ALLFLAGS)

install: $(SETUP) setup.data
./$(SETUP) -install $(INSTALLFLAGS)

uninstall: $(SETUP) setup.data
./$(SETUP) -uninstall $(UNINSTALLFLAGS)

reinstall: $(SETUP) setup.data
./$(SETUP) -reinstall $(REINSTALLFLAGS)

clean: $(SETUP)
./$(SETUP) -clean $(CLEANFLAGS)

distclean: $(SETUP)
./$(SETUP) -distclean $(DISTCLEANFLAGS)

configure: $(SETUP)
./$(SETUP) -configure $(CONFIGUREFLAGS)

setup.data: $(SETUP)
./$(SETUP) -configure $(CONFIGUREFLAGS)

.PHONY: default build doc test all install uninstall reinstall clean distclean configure
export USE_CAMLP4=yes
export OCAMLMAKEFILE = ./OCamlMakefile
export THREADS=yes
export CFLAGS=-Wall -Wno-deprecated-declarations
export PACKS=sexplib.syntax,sexplib,pa_ounit.syntax,pa_ounit,pa_bench.syntax,\
pa_bench,herelib.syntax,herelib,ctypes.stubs,async,core
export LIB_PACK_NAME=Async_ssl
export CLIBS=ssl crypto
export OCAMLDEP = ocamldep -package $(PACKS) -syntax camlp4o
export OCAMLFLAGS = -syntax camlp4o
export LIBINSTALL_FILES = lib/ffi.mli lib/ssl.mli lib/version.mli \
Async_ssl.cmi Async_ssl.cmo Async_ssl.cmx \
async_ssl.cma async_ssl.cmxa async_ssl.a \
libasync_ssl_stubs.a dllasync_ssl_stubs.so \
META

ifndef SUBPROJS
export SUBPROJS = stubgen async_ssl
endif

define PROJ_stubgen
RESULT=stubgen
SOURCES=lib/import.ml \
lib/version.ml lib/version.mli \
lib/ffi_bindings.ml \
lib/ffi_stubgen.ml
endef
export PROJ_stubgen

define PROJ_async_ssl
RESULT=async_ssl
INCDIRS = $(shell ocamlfind query ctypes)/..
SOURCES=lib/import.ml \
lib/version.ml lib/version.mli \
lib/ffi_bindings.ml \
lib/ffi_generated.ml lib/ffi_generated.mli \
lib/ffi_generated_stubs.c \
lib/ffi.ml lib/ffi.mli \
lib/ssl.ml lib/ssl.mli \
lib/std.ml
endef
export PROJ_async_ssl

all: stubs byte-code-library native-code-library

install: all
ocamlfind install async_ssl $(LIBINSTALL_FILES)
uninstall:
ocamlfind remove async_ssl

stubgen: SUBPROJS=stubgen
stubgen: nc

stubs: stubgen
./$< -ml > lib/ffi_generated.ml
./$< -c > lib/ffi_generated_stubs.c

%:
@$(MAKE) -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@
Loading