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
|
#
# This Makefile.in is adapted from the sample "makefile for Objective Caml"
# Copyright (C) 2001 Jean-Christophe FILLIATRE
#
# See LICENCE file for informations about mlglade's licence
#
# where to install the binaries
prefix=@prefix@
exec_prefix=@exec_prefix@
BINDIR=@bindir@
# where to install the man page
MANDIR=@mandir@
WEBDIR=/auto/demons/monate/.webdir/mlglade/
# other variables set by ./configure
OCAMLC = @OCAMLC@
OCAMLOPT = @OCAMLOPT@
OCAMLDEP = @OCAMLDEP@
OCAMLLEX = @OCAMLLEX@
OCAMLYACC= @OCAMLYACC@
OCAMLLIB = @OCAMLLIB@
OCAMLBEST= @OCAMLBEST@
OCAMLVERSION = @OCAMLVERSION@
OCAMLWEB = @OCAMLWEB@
INCLUDES = -I lindig
BFLAGS = -g $(INCLUDES)
OFLAGS = $(INCLUDES) -unsafe -noassert
# main target
#############
PROG = mlglade
include VERSION
all: $(OCAMLBEST)
# bytecode and native-code compilation
######################################
CMO = lindig/error.cmo lindig/xml.cmo lindig/xmlstate.cmo lindig/xmlparse.cmo \
lindig/xmlscan.cmo this.cmo glade.cmo main.cmo
CMX = $(CMO:.cmo=.cmx)
GENERATED = lindig/xmlparse.ml lindig/xmlparse.mli lindig/xmlscan.ml this.ml
byte: $(PROG).byte
opt: $(PROG).opt
$(PROG).byte: lindig/mylib.cma $(CMO)
$(OCAMLC) $(BFLAGS) str.cma -o $@ $^
ln -sf $@ $(PROG)
$(PROG).opt: lindig/mylib.cmxa $(CMX)
$(OCAMLOPT) $(OFLAGS) str.cmxa -o $@ $^
ln -sf $@ $(PROG)
MYLIBCMO = lindig/pp.cmo lindig/pc.cmo lindig/lc.cmo \
lindig/pc2.cmo lindig/std.cmo
MYLIBCMX = $(MYLIBCMO:.cmo=.cmx)
lindig/mylib.cma: $(MYLIBCMO)
$(OCAMLC) $(CFLAGS) -a -o $@ $^
lindig/mylib.cmxa: $(MYLIBCMX)
$(OCAMLOPT) $(OFLAGS) -a -o $@ $^
this.ml: this.in
sed -e 's/@this@/$(PROG)-$(VERSION)/' \
-e 's/@arch@/$(ARCH)/' \
this.in > $@
# installation
##############
install:
mkdir -p $(BINDIR)
cp -f $(PROG).$(OCAMLBEST) $(BINDIR)/$(PROG)
# mkdir -p $(MANDIR)/man1
# cp -f $(PROG).1 $(MANDIR)/man1
install-byte: mlglade.byte
mkdir -p $(BINDIR)
cp -f $(PROG).byte $(BINDIR)/$(PROG)
docs:
cd WWW ;\
hevea -fix introduction.tex
cd tutorial ;\
hevea -fix tutorial.tex
# DO NOT USE THESE ENTRIES
web: all
cd WWW ;\
hevea -fix introduction.tex && \
cp -f introduction.html $(WEBDIR)
cd tutorial ;\
hevea -fix tutorial.tex &&\
cp -f tutorial.html hello.png $(WEBDIR)
cp -f README $(WEBDIR)
# literate programming
######################
SOURCES =
$(PROG).tex: $(SOURCES)
$(OCAMLWEB) -o $@ $^
$(PROG).dvi: $(PROG).tex
latex $^ && latex $^
$(PROG).ps: $(PROG).dvi
dvips $^ -o $@
# generic rules
###############
.SUFFIXES: .mli .ml .cmi .cmo .cmx .mll .mly
.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 $<
# Emacs tags
############
tags:
find . -name "*.ml*" | sort -r | xargs \
etags "--regex=/let[ \t]+\([^ \t]+\)/\1/" \
"--regex=/let[ \t]+rec[ \t]+\([^ \t]+\)/\1/" \
"--regex=/and[ \t]+\([^ \t]+\)/\1/" \
"--regex=/type[ \t]+\([^ \t]+\)/\1/" \
"--regex=/exception[ \t]+\([^ \t]+\)/\1/" \
"--regex=/val[ \t]+\([^ \t]+\)/\1/" \
"--regex=/module[ \t]+\([^ \t]+\)/\1/"
# myself
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
configure: configure.in
autoconf
# clean
#######
clean::
rm -f *.cm[iox] *.o *~
rm -f lindig/*.cm[iox] lindig/*.o lindig/*~
rm -f lindig/mylib.cma lindig/mylib.cmxa lindig/mylib.a
rm -f $(GENERATED)
rm -f $(PROG).byte $(PROG).opt $(PROG) a.out lindig/xmlparse.output
rm -f *.aux *.log $(PROG).tex $(PROG).dvi $(PROG).ps
rm -f {WWW,tutorial}/*.{dvi,html,aux,log,rel,haux}
dist-clean: clean
rm -f config.cache config.status Makefile
# depend
########
.depend depend:: $(GENERATED)
rm -f .depend
$(OCAMLDEP) $(INCLUDES) lindig/*.ml lindig/*.mli *.ml *.mli > .depend
include .depend
|