Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
161 lines (132 sloc) 5.31 KB
#################################################################################
# Genet #
# #
# Copyright (C) 2012-2013 Institut National de Recherche en Informatique #
# et en Automatique. All rights reserved. #
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License version 3 #
# or later as published by the Free Software Foundation. #
# #
# This program 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 General Public License for more details. #
# #
# You should have received a copy of the GNU General Public License #
# along with this program; if not, write to the Free Software Foundation, #
# Inc., 59 Temple Place, Suite 330, Boston, MA #
# 02111-1307 USA #
# #
# Contact: Maxence.Guesdon@inria.fr #
# #
# #
#################################################################################
# Various commands and dir
##########################
OCAMLBIN= @OCAMLBIN@
OCAMLC = @OCAMLC@
OCAMLOPT =@OCAMLOPT@ -inline 10000
OCAMLDEP = @OCAMLDEP@
OCAMLLEX = @OCAMLLEX@
OCAMLYACC= @OCAMLYACC@
OCAMLLIB = @OCAMLLIB@
OCAMLMKTOP = @OCAMLMKTOP@
OCAMLMKLIB = @OCAMLMKLIB@
CAMMKTOP = @CAMMKTOP@
OCAMLDOCDIR= $(OCAMLLIB)/ocamldoc
OCAMLDOC_PLUGINSDIR=$(DESTDIR)@OCAMLDOC_PLUGINSDIR@
OCAMLVERSION = @OCAMLVERSION@
OCAMLFIND= @OCAMLFIND@
EXTRAC_CRC = $(OCAMLLIB)/extract_crc
OCAMLDOC= @OCAMLDOC@
OCAMLDOCOPT= @OCAMLDOC_OPT@
OCAMLPP=
MENHIR= @MENHIR@
MENHIR_LINK_FLAGS= @MENHIR_LINK_FLAGS@
MENHIR_LINK_FLAGS_BYTE= @MENHIR_LINK_FLAGS_BYTE@
LATEX=TEXINPUTS=$(ROOT)/doc: latex
PDFLATEX=TEXINPUTS=$(ROOT)/doc: pdflatex
HEVEA= @HEVEA@ -fix -I $(ROOT)/doc -exec xxdate.exe
HACHA= @HACHA@
DVIPS=dvips
DVIPDF=dvipdf
BIBTEX= @BIBTEX@
HEVEA_CSS_STYLE=ocamldoc_style.css
OCAMLCFLAGS= -warn-error FSPUYZ -g -annot -thread -rectypes # -w Ae
LABLGLADECC=@LABLGLADECC@
LESSC=lessc
MENHIR_INCLUDES=@MENHIR_INCLUDES@
VERSION=@VERSION@
# For installation
##############
MKDIR=mkdir -p
CP=cp -f
CPDIR=$(CP) -r
RM=rm -fR
MV=mv
DESTDIR= # For debian packagers
LIBDIR=$(DESTDIR)@LIBDIR@
BINDIR=$(DESTDIR)@BINDIR@
MANDIR=$(DESTDIR)@mandir@
SHAREDIR=$(DESTDIR)@SHAREDIR@
GLADEDIR=$(DESTDIR)@GLADEDIR@
GENET_PREFIX=genet
GENET=$(GENET_PREFIX)
GENET_BYTE=$(GENET).byte
GENET_CHEAT=$(GENET_PREFIX)-cheat
GENET_CHEAT_BYTE=$(GENET_CHEAT).byte
GENRDFS=$(GENET_PREFIX)-genrdfs
GENRDFS_BYTE=$(GENRDFS).byte
GENET_REST=$(GENET_PREFIX)-rest
GENET_REST_BYTE=$(GENET_PREFIX)-rest.byte
GENET_GUI=$(GENET_PREFIX)-gtk
GENET_GUI_BYTE=$(GENET_PREFIX)-gtk.byte
#shut up autconf @datarootdir@
# Compilation
#############
ROOT=@ROOT@
RDF_MYSQL=@RDF_MYSQL@
RDF_POSTGRESQL=@RDF_POSTGRESQL@
# generic rules :
#################
.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly \
.html .tex .dvi .ps .pdf .png .dot
%.cmi:%.mli
$(OCAMLFIND) ocamlc $(OF_FLAGS) $(OCAMLCFLAGS) $(OCAMLPP) $(COMPFLAGS) -c $<
%.cmo:%.ml
if test -f `dirname $<`/`basename $< .ml`.mli && test ! -f `dirname $<`/`basename $< .ml`.cmi ; then \
$(OCAMLFIND) ocamlc $(OF_FLAGS) $(OCAMLCFLAGS) $(OCAMLPP) $(COMPFLAGS) -c `dirname $<`/`basename $< .ml`.mli; fi
$(OCAMLFIND) ocamlc $(OF_FLAGS) $(OCAMLCFLAGS) $(OCAMLPP) $(COMPFLAGS) -c $<
%.cmi %.cmo:%.ml
if test -f `dirname $<`/`basename $< .ml`.mli && test ! -f `dirname $<`/`basename $< .ml`.cmi ; then \
$(OCAMLFIND) ocamlc $(OF_FLAGS) $(OCAMLCFLAGS) $(OCAMLPP) $(COMPFLAGS) -c `dirname $<`/`basename $< .ml`.mli; fi
$(OCAMLFIND) ocamlc $(OF_FLAGS) $(OCAMLCFLAGS) $(OCAMLPP) $(COMPFLAGS) -c $<
%.cmx %.o:%.ml
$(OCAMLFIND) ocamlopt $(OF_FLAGS) $(OCAMLCFLAGS) $(OCAMLPP) $(COMPFLAGS) -c $<
%.o: %.c
$(OCAMLFIND) ocamlopt $(OF_FLAGS) $(OCAMLCFLAGS) $(COMPFLAGS) -c $< && $(MV) `basename $@` `dirname $@`
%.ml:%.mll
$(OCAMLLEX) $<
%.mli %.ml:%.mly
$(OCAMLYACC) -v $<
%.pdf: %.tex
$(PDFLATEX) $<
(grep bibliography $< > /dev/null && $(BIBTEX) `basename $< .tex` || true)
$(PDFLATEX) $<
$(PDFLATEX) $<
%.html: %.tex
$(HEVEA) $<
$(HACHA) -tocbis -o `basename $@ .html`_index.html $@
rpl '<META name="GENERATOR" content="hevea 1.' \
'<link href="$(HEVEA_CSS_STYLE)" rel="stylesheet" type="text/css"> <META name="GENERATOR" content="hevea 1.' \
*.html
%.png: %.dot
dot -Tpng -o $@ $<
%.pdf: %.dot
dot -Tpdf -o $@ $<
# some common targets :
#######################
first:all
cleandoc:
$(RM) *.ps *.dvi *.html *.pdf *.log *.aux *.toc *.bbl *.blg *.htoc *.haux *~