################################################################### # [LibNN - Neural Networks Library] # http://libnn.org # Copyright (C) 2002 - 2003 LAGACHERIE Matthieu RICORDEAU Olivier # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. 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. # # SPECIAL NOTE (the beerware clause): # This software is free software. However, it also falls under the beerware # special category. That is, if you find this software useful, or use it # every day, or want to grant us for our modest contribution to the # free software community, feel free to send us a beer from one of # your local brewery. Our preference goes to Belgium abbey beers and # irish stout (Guiness for strength!), but we like to try new stuffs. # # Authors: # LAGACHERIE Matthieu # Paper mail : 7 rue Delescluzes 94280 LE KREMLIN BICETRE, FRANCE # E-mail : matthieu@libnn.org # # RICORDEAU Olivier # Paper mail : 69 avenue d'Italie 75013 PARIS, FRANCE # E-mail : olivier@libnn.org # ################################################################### # # NB: This file is highly inspired from # the "sample Makefile for Objective Caml" file # by Jean-Christophe FILLIATRE # http://www.lri.fr/~filliatr/ftp/ocaml/misc/Makefile.in # # (* Sources *) # subdirs where stuffs are supposed to be compiled. # NB: these subdirectories are expected to contain a Makefile which knows # how to make: # * all (alias for "make byte opt") # * re (alias for "make clean all") # * byte (alias for "make lib$SUBDIRNAME.cma") # * opt (alias for "make lib$SUBDIRNAME.cmxa") # * lib$SUBDIRNAME.cma (where $SUBDIRNAME is the name of the subdirectory) # * lib$SUBDIRNAME.cmxa (where $SUBDIRNAME is the name of the subdirectory) # * doc (generate as much output formats as possible) # * man-generation (man pages generated from code) # * html-generation (html pages generated from code) # * dvi (dvi file generated from code) # * pdf (pdf file generated from code) # * clean (cleans generated doc and compiled files) # * doc-clean (cleans generated doc) # * dist-clean and distclean SUBDIRS = misc \ networks \ init \ input \ error \ propagate \ learn # sources, directory by directory. # misc/ #subdirectory name MISC_DIR = misc # name of the compiled bytecode .cma lib (without path!) MISC_CMA = lib$(MISC_DIR).cma # name of the compiled bytecode .cma lib (with path!) MISC_CMA_LIB = $(MISC_DIR)/lib$(MISC_DIR).cma # .ml sources (without paths!) MISC_ML = pattern.ml \ corpus.ml \ defaultVisitor.ml \ env.ml # .mli sources (without paths!) MISC_MLI = # compiled native code .cmx files (without path!) MISC_CMX = $(MISC_ML:.ml=.cmx) # compiled native code .cmx files (with path!) MISC_CMX_LIB = $(MISC_CMX: = $(MISC_DIR)/) # networks/ #subdirectory name NETWORKS_DIR = networks # name of the compiled bytecode .cma lib (without path!) NETWORKS_CMA = lib$(NETWORKS_DIR).cma # name of the compiled bytecode .cma lib (with path!) NETWORKS_CMA_LIB = $(NETWORKS_DIR)/lib$(NETWORKS_DIR).cma # .ml sources (without paths!) NETWORKS_ML = nn.ml \ mlpNN.ml \ tdNN.ml # .mli sources (without paths!) NETWORKS_MLI = # compiled native code .cmx files (without path!) NETWORKS_CMX = $(NETWORKS_ML:.ml=.cmx) # compiled native code .cmx files (with path!) NETWORKS_CMX_LIB = $(NETWORKS_CMX: = $(NETWORKS_DIR)/) # init/ #subdirectory name INIT_DIR = init # name of the compiled bytecode .cma lib (without path!) INIT_CMA = lib$(INIT_DIR).cma # name of the compiled bytecode .cma lib (with path!) INIT_CMA_LIB = $(INIT_DIR)/lib$(INIT_DIR).cma # .ml sources (without paths!) INIT_ML = initVisitor.ml \ initMlpnnVisitor.ml \ initTdnnVisitor.ml # .mli sources (without paths!) INIT_MLI = # compiled native code .cmx files (without path!) INIT_CMX = $(INIT_ML:.ml=.cmx) # compiled native code .cmx files (with path!) INIT_CMX_LIB = $(INIT_CMX: = $(INIT_DIR)/) # input/ #subdirectory name INPUT_DIR = input # name of the compiled bytecode .cma lib (without path!) INPUT_CMA = lib$(INPUT_DIR).cma # name of the compiled bytecode .cma lib (with path!) INPUT_CMA_LIB = $(INPUT_DIR)/lib$(INPUT_DIR).cma # .ml sources (without paths!) INPUT_ML = inputVisitor.ml \ inputMlpnnVisitor.ml \ inputTdnnVisitor.ml # .mli sources (without paths!) INPUT_MLI = # compiled native code .cmx files (without path!) INPUT_CMX = $(INPUT_ML:.ml=.cmx) # compiled native code .cmx files (with path!) INPUT_CMX_LIB = $(INPUT_CMX: = $(INPUT_DIR)/) # error/ #subdirectory name ERROR_DIR = error # name of the compiled bytecode .cma lib (without path!) ERROR_CMA = lib$(ERROR_DIR).cma # name of the compiled bytecode .cma lib (with path!) ERROR_CMA_LIB = $(ERROR_DIR)/lib$(ERROR_DIR).cma # .ml sources (without paths!) ERROR_ML = errorVisitor.ml \ errorMlpnnVisitor.ml # .mli sources (without paths!) ERROR_MLI = # compiled native code .cmx files (without path!) ERROR_CMX = $(ERROR_ML:.ml=.cmx) # compiled native code .cmx files (with path!) ERROR_CMX_LIB = $(ERROR_CMX: = $(ERROR_DIR)/) # propagate/ #subdirectory name PROPAGATE_DIR = propagate # name of the compiled bytecode .cma lib (without path!) PROPAGATE_CMA = lib$(PROPAGATE_DIR).cma # name of the compiled bytecode .cma lib (with path!) PROPAGATE_CMA_LIB = $(PROPAGATE_DIR)/lib$(PROPAGATE_DIR).cma # .ml sources (without paths!) PROPAGATE_ML = propagateVisitor.ml \ backpropVisitor.ml \ propagateMlpnnVisitor.ml \ propagateTdnnVisitor.ml # .mli sources (without paths!) PROPAGATE_MLI = # compiled native code .cmx files (without path!) PROPAGATE_CMX = $(PROPAGATE_ML:.ml=.cmx) # compiled native code .cmx files (with path!) PROPAGATE_CMX_LIB = $(PROPAGATE_CMX: = $(PROPAGATE_DIR)/) # learn/ #subdirectory name LEARN_DIR = learn # name of the compiled bytecode .cma lib (without path!) LEARN_CMA = lib$(LEARN_DIR).cma # name of the compiled bytecode .cma lib (with path!) LEARN_CMA_LIB = $(LEARN_DIR)/lib$(LEARN_DIR).cma # .ml sources (without paths!) LEARN_ML = learnVisitor.ml \ learnMlpnnEnhancedBackpropVisitor.ml \ learnMlpnnWeightDecayVisitor.ml \ learnMlpnnStochVisitor.ml # .mli sources (without paths!) LEARN_MLI = # compiled native code .cmx files (without path!) LEARN_CMX = $(LEARN_ML:.ml=.cmx) # compiled native code .cmx files (with path!) LEARN_CMX_LIB = $(LEARN_CMX: = $(LEARN_DIR)/) # (* Libs compilation *) # all .cma files required for the libnn.cma bytecode lib. ALL_CMA_LIB = $(MISC_CMA_LIB) \ $(NETWORKS_CMA_LIB) \ $(INIT_CMA_LIB) \ $(INPUT_CMA_LIB) \ $(ERROR_CMA_LIB) \ $(PROPAGATE_CMA_LIB) \ $(LEARN_CMA_LIB) # all .cmx files required for the libnn.cmxa native code lib. ALL_CMX_LIB = misc/pattern.cmx \ misc/corpus.cmx \ misc/defaultVisitor.cmx \ misc/env.cmx \ networks/nn.cmx \ networks/mlpNN.cmx \ networks/tdNN.cmx \ init/initMlpnnVisitor.cmx \ init/initTdnnVisitor.cmx \ init/initVisitor.cmx \ input/inputVisitor.cmx \ input/inputMlpnnVisitor.cmx \ input/inputTdnnVisitor.cmx \ error/errorVisitor.cmx \ error/errorMlpnnVisitor.cmx \ propagate/propagateVisitor.cmx \ propagate/backpropVisitor.cmx \ propagate/propagateMlpnnVisitor.cmx \ propagate/propagateTdnnVisitor.cmx \ learn/learnVisitor.cmx \ learn/learnMlpnnEnhancedBackpropVisitor.cmx \ learn/learnMlpnnWeightDecayVisitor.cmx \ learn/learnMlpnnStochVisitor.cmx # (* /Sources *) # where to install the binaries prefix=@prefix@ exec_prefix=@exec_prefix@ BINDIR=@bindir@ # where to install the man page MANDIR=@mandir@ # other variables set by ./configure OCAMLC = @OCAMLC@ OCAMLOPT = @OCAMLOPT@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLDEP = @OCAMLDEP@ OCAMLLEX = @OCAMLLEX@ OCAMLYACC= @OCAMLYACC@ OCAMLLIB = @OCAMLLIB@ OCAMLBEST= @OCAMLBEST@ OCAMLVERSION = @OCAMLVERSION@ OCAMLWEB = @OCAMLWEB@ OCAMLDOC = @OCAMLDOC@ OCAMLWIN32 = @OCAMLWIN32@ EXE = @EXE@ BYTE = @BYTE@ OPT = @OPT@ LATEX_HERE = @LATEX_HERE@ DVIPDF_HERE = @DVIPDF_HERE@ DVIPS_HERE = @DVIPS_HERE@ TEXI2HTML_HERE = @TEXI2HTML_HERE@ INCLUDES = -I ../misc -I ../networks # General compilation flags. ############################ # bytecode BFLAGS = -g $(INCLUDES) -w A # native code OFLAGS = $(INCLUDES) -w A -compact # Flags for linking. #################### # bytecode BLFLAGS = -a # native code OLFLAGS = -lnn -L/usr/local/libnn RM = rm -f TMP = /tmp # 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) $< .mly.ml: $(OCAMLYACC) -v $< .mly.mli: $(OCAMLYACC) -v $< .tex.dvi: latex $< && latex $< .dvi.ps: dvips $< -o $@ .tex.html: hevea $<