1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
|
# sample Makefile for Objective Caml
# Copyright (C) 2001 Jean-Christophe FILLIATRE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License version 2, as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU Library General Public License version 2 for more details
# (enclosed in the file LGPL).
# where to install the binaries
DESTDIR=
# prefix=@prefix@
# exec_prefix=@exec_prefix@
# BINDIR=$(DESTDIR)@bindir@
LIBDIR=$(DESTDIR)@OCAMLLIB@/
# DATADIR=$(DESTDIR)@datadir@/ocplib-simplex
# where to install the man page
MANDIR=$(DESTDIR)@mandir@
# other variables set by ./configure
OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLDEP = @OCAMLDEP@
OCAMLBEST = @OCAMLBEST@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWIN32 = @OCAMLWIN32@
OCAMLLIB = @OCAMLLIB@
LIBNAME=ocplibSimplex
EXE =@EXE@
ARCH = $(shell uname -m)
VERSION=$(shell grep "=" src/version.ml | cut -d"=" -f2 | head -n 1)
LOCAL_INC = -I src
INCLUDES = $(LOCAL_INC)
#for coverage # -I /usr/local/lib/ocaml/3.12.1/bisect -pp "camlp4o str.cma /usr/local/lib/ocaml/3.12.1/bisect/bisect_pp.cmo"
OFLAGS_LIGHT = -annot -absname -bin-annot -short-paths -strict-sequence -w +A -g -inline 100 $(INCLUDES)
BFLAGS_LIGHT = -annot -absname -bin-annot -short-paths -strict-sequence -w +A -g $(INCLUDES)
BFLAGS = $(BFLAGS_LIGHT) -for-pack OcplibSimplex
OFLAGS = $(OFLAGS_LIGHT) -for-pack OcplibSimplex
BIBBYTE =
# for coverage bisect.cma
BIBOPT = $(BIBBYTE:.cma=.cmxa)
GENERATED = src/extSigs.ml src/coreSig.ml #src/ocplibSimplex.mli
CMO = src/version.cmo src/rat2.cmo src/extSigs.cmo src/polys.cmo src/coreSig.cmo src/core.cmo \
src/result.cmo src/assertBounds.cmo src/solveBounds.cmo src/basic.cmo
CMX = $(CMO:.cmo=.cmx)
# Build
#########
all: $(OCAMLBEST)
byte: src/$(LIBNAME).cma
opt: src/$(LIBNAME).cma src/$(LIBNAME).cmxa src/$(LIBNAME).cmxs
src/$(LIBNAME).cma: src/$(LIBNAME).cmo
$(OCAMLC) -a $(BFLAGS_LIGHT) -o $@ $^
src/$(LIBNAME).cmxa: src/$(LIBNAME).cmx
$(OCAMLOPT) -a $(OFLAGS_LIGHT) -o $@ $^
src/$(LIBNAME).cmxs: src/$(LIBNAME).cmx
$(OCAMLOPT) -shared $(OFLAGS_LIGHT) -o $@ $^
src/$(LIBNAME).cmo: $(CMO) # src/$(LIBNAME).cmi
$(OCAMLC) $(BFLAGS_LIGHT) -pack -o src/$(LIBNAME).cmo $^
src/$(LIBNAME).cmx: $(CMX) # src/$(LIBNAME).cmi
$(OCAMLOPT) $(OFLAGS_LIGHT) -pack -o src/$(LIBNAME).cmx $^
src/extSigs.ml: src/extSigs.mli
cp src/extSigs.mli src/extSigs.ml
src/coreSig.ml: src/coreSig.mli
cp src/coreSig.mli src/coreSig.ml
.PHONY: all
META: config.status
@echo "description = \"ocplib-simplex: A library implementing a simplex algorithm, in a functional style, for solving systems of linear inequalities\"" > META
@echo "version = \""$(VERSION)"\"" >> META
@echo "archive(byte) = \"$(LIBNAME).cma\"" >> META
@echo "archive(native) = \"$(LIBNAME).cmxa\"" >> META
@echo "archive(native, plugin) = \"$(LIBNAME).cmxs\"" >> META
@echo "archive(byte, plugin) = \"$(LIBNAME).cma\"" >> META
@echo "requires = \"\"" >> META
@echo "exists_if = \"$(LIBNAME).cma\"" >> META
# installation
##############
install: all META
OCAMLFIND_DESTDIR=$(LIBDIR) \
ocamlfind install ocplib-simplex src/$(LIBNAME).* src/*.mli META
uninstall:
ocamlfind remove ocplib-simplex
# generic rules
###############
.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly .tex .dvi .ps .html
.mli.cmi:
$(OCAMLC) -c $(BFLAGS) $<
.ml.cmo:
$(OCAMLC) -c $(BFLAGS) $<
.ml.o:
$(OCAMLOPT) -c $(OFLAGS) $<
.ml.cmx:
$(OCAMLOPT) -c $(OFLAGS) $<
.mll.ml:
$(OCAMLLEX) $< > /dev/null
.mly.ml:
$(OCAMLYACC) -v $<
.mly.mli:
$(OCAMLYACC) -v $<
# clean
#######
clean:
@for dd in . src tests; do \
rm -f $$dd/*.cm* $$dd/*.a $$dd/*.o $$dd/*~ $$dd/*.annot $$dd/*.owz $(GENERATED) *.byte *.opt;\
done
@rm -rf META
# depend
########
.depend depend: $(GENERATED)
$(OCAMLDEP) $(LOCAL_INC) src/*.ml* > .depend
include .depend
#show-dest-dirs:
# @echo INSTALL DIR = $(INSTALLDIR)
# Makefile.configurable is rebuilt whenever Makefile.configurable.in
# or configure.in is modified
######################################################################
configure: configure.in
autoconf
./configure
Makefile.configurable: Makefile.in configure.in
./config.status
config.status: configure
./config.status --recheck
archi: depend
ocamldot .depend > archi.dot && dot -Tpdf archi.dot > archi.pdf && evince archi.pdf &
lint:
ocp-lint --path /home/omig/Bureau/pro/alt-ergo/ocplib-simplex/src --disable-plugin-indent
edit:
emacs src/*ml* &
opam-deps:
opam install ocamlfind
repin:
opam remove ocplib-simplex
opam pin add . --y
local-tests: all
## minimal example with solve: byte and opt >> lib is local
$(OCAMLC) -o standalone_minimal_local.byte -I src -I tests ocplibSimplex.cma nums.cma tests/standalone_minimal.ml
./standalone_minimal_local.byte 2> /dev/null
$(OCAMLOPT) -o standalone_minimal_local.opt -I src -I tests ocplibSimplex.cmxa nums.cmxa tests/standalone_minimal.ml
./standalone_minimal_local.opt 2> /dev/null
## minimal example with maximization: byte and opt >> lib is local
$(OCAMLC) -o standalone_minimal_maximization_local.byte -I src -I tests ocplibSimplex.cma nums.cma tests/standalone_minimal_maximization.ml
./standalone_minimal_maximization_local.byte 2> /dev/null
$(OCAMLOPT) -o standalone_minimal_maximization_local.opt -I src -I tests ocplibSimplex.cmxa nums.cmxa tests/standalone_minimal_maximization.ml
./standalone_minimal_maximization_local.opt 2> /dev/null
opam-installed-tests: repin
## minimal example with solve: byte and opt >> lib is pinned with OPAM
$(OCAMLC) -o standalone_minimal_opam.byte -I `ocamlfind query ocplib-simplex` -I tests ocplibSimplex.cma nums.cma tests/standalone_minimal.ml
./standalone_minimal_opam.byte 2> /dev/null
$(OCAMLOPT) -o standalone_minimal_opam.opt -I `ocamlfind query ocplib-simplex` -I tests ocplibSimplex.cmxa nums.cmxa tests/standalone_minimal.ml
./standalone_minimal_opam.opt 2> /dev/null
## minimal example with maximization: byte and opt >> lib is pinned with OPAM
$(OCAMLC) -o standalone_minimal_maximization_opam.byte -I `ocamlfind query ocplib-simplex` -I tests ocplibSimplex.cma nums.cma tests/standalone_minimal_maximization.ml
./standalone_minimal_maximization_opam.byte 2> /dev/null
$(OCAMLOPT) -o standalone_minimal_maximization_opam.opt -I `ocamlfind query ocplib-simplex` -I tests ocplibSimplex.cmxa nums.cmxa tests/standalone_minimal_maximization.ml
./standalone_minimal_maximization_opam.opt 2> /dev/null
tests: local-tests opam-installed-tests
|