Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a9ddcfff6f
Fetching contributors…

Cannot retrieve contributors at this time

file 312 lines (251 sloc) 10.94 kb
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 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
INSTALLDIR=/tmp/foobar


OCAMLKLIBDIR=/usr/local/lib/ocaml/camltk/
include $(OCAMLKLIBDIR)Makefile.camltk


# Compiler part
BINDIR=
CAMLC=$(BINDIR)ocamlc
CAMLOPT=$(BINDIR)ocamlopt
CAMLCP=$(BINDIR)ocamlcp
CAMLDEP=$(BINDIR)ocamldep
CAMLLEX=$(BINDIR)ocamllex
CAMLYACC=$(BINDIR)ocamlyacc



# Flags part
INCLUDEDIRS = -I parsing/ -I utils/ -I typing/ -I toplevel/ -I batch/ \
-I interface/
DEPFLAGS = $(INCLUDEDIRS)
COMPFLAG = -w A-4-6-9 -warn-error A $(INCLUDEDIRS) $(TKCOMPFLAGS)
LINKFLAG =



# Object part
TOPOBJS = utils/misc.cmo utils/tbl.cmo utils/config.cmo utils/clflags.cmo \
utils/terminfo.cmo utils/ccomp.cmo \
\
parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
parsing/asttypes.cmo parsing/syntaxerr.cmo parsing/pstream.cmo \
parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo \
\
typing/files.cmo typing/stdlibpath.cmo typing/listextra.cmo \
typing/ident.cmo typing/path.cmo typing/extendhandler.cmo \
typing/subst.cmo typing/printbasic.cmo typing/printparse.cmo \
typing/printscope.cmo typing/typecore.cmo typing/envscope.cmo \
typing/corescope.cmo typing/modscope.cmo typing/topscope.cmo \
typing/substcore.cmo typing/substmod.cmo typing/printtypes.cmo \
typing/envtype.cmo typing/inputpt.cmo typing/substract.cmo \
typing/freevars.cmo typing/outputp.cmo typing/infercore.cmo \
typing/printmod.cmo typing/infermod.cmo typing/error.cmo \
\
toplevel/main.cmo


BATCHOBJS = utils/misc.cmo utils/tbl.cmo utils/config.cmo utils/clflags.cmo \
utils/terminfo.cmo utils/ccomp.cmo \
\
parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
parsing/asttypes.cmo parsing/syntaxerr.cmo parsing/pstream.cmo \
parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo \
\
typing/files.cmo typing/stdlibpath.cmo typing/listextra.cmo \
typing/ident.cmo typing/path.cmo typing/extendhandler.cmo \
typing/subst.cmo typing/printbasic.cmo typing/printparse.cmo \
typing/printscope.cmo typing/typecore.cmo typing/envscope.cmo \
typing/corescope.cmo typing/modscope.cmo typing/topscope.cmo \
typing/substcore.cmo typing/substmod.cmo typing/printtypes.cmo \
typing/envtype.cmo typing/inputpt.cmo typing/substract.cmo \
typing/freevars.cmo typing/outputp.cmo typing/infercore.cmo \
typing/printmod.cmo typing/infermod.cmo typing/error.cmo \
\
batch/main.cmo


LINKOBJS = utils/misc.cmo utils/tbl.cmo utils/config.cmo utils/clflags.cmo \
utils/terminfo.cmo utils/ccomp.cmo \
\
parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
parsing/asttypes.cmo parsing/syntaxerr.cmo parsing/pstream.cmo \
parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo \
\
typing/files.cmo typing/stdlibpath.cmo typing/listextra.cmo \
typing/ident.cmo typing/path.cmo typing/extendhandler.cmo \
typing/subst.cmo typing/printbasic.cmo typing/printparse.cmo \
typing/printscope.cmo typing/typecore.cmo typing/envscope.cmo \
typing/corescope.cmo typing/modscope.cmo typing/topscope.cmo \
typing/substcore.cmo typing/substmod.cmo typing/printtypes.cmo \
typing/envtype.cmo typing/inputpt.cmo typing/substract.cmo \
typing/freevars.cmo typing/outputp.cmo typing/infercore.cmo \
typing/printmod.cmo typing/infermod.cmo typing/error.cmo \
\
link/main.cmo


INTERFACEOBJS = utils/misc.cmo utils/tbl.cmo utils/config.cmo \
utils/clflags.cmo utils/terminfo.cmo utils/ccomp.cmo \
\
parsing/linenum.cmo parsing/location.cmo parsing/longident.cmo \
parsing/asttypes.cmo parsing/syntaxerr.cmo parsing/pstream.cmo \
parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo \
\
typing/files.cmo typing/stdlibpath.cmo typing/listextra.cmo \
typing/ident.cmo typing/path.cmo typing/extendhandler.cmo \
typing/subst.cmo typing/printbasic.cmo typing/printparse.cmo \
typing/printscope.cmo typing/typecore.cmo typing/envscope.cmo \
typing/corescope.cmo typing/modscope.cmo typing/topscope.cmo \
typing/substcore.cmo typing/substmod.cmo \
interface/tklowprint.cmo interface/tkprinttypes.cmo \
typing/printtypes.cmo typing/envtype.cmo typing/inputpt.cmo \
typing/substract.cmo typing/freevars.cmo typing/outputp.cmo \
typing/infercore.cmo interface/tkprintmod.cmo \
typing/infermod.cmo typing/error.cmo \
\
interface/global.cmo interface/tkloadsrc.cmo \
interface/preferences.cmo interface/rootwindow.cmo \
interface/modselector.cmo interface/main.cmo



# Sources part
GENERATEDSRCS = parsing/linenum.ml parsing/parser.ml parsing/lexer.ml


TOPSRCS = $(GENERATEDSRCS) \
parsing/location.ml parsing/longident.ml parsing/syntaxerr.ml \
parsing/asttypes.ml parsing/pstream.ml parsing/parse.ml \
\
utils/misc.ml utils/tbl.ml utils/config.ml utils/clflags.ml \
utils/terminfo.ml utils/ccomp.ml \
\
typing/files.ml typing/stdlibpath.ml typing/listextra.ml \
typing/ident.ml typing/path.ml typing/subst.ml typing/envscope.ml \
typing/corescope.ml typing/extendhandler.ml typing/modscope.ml \
typing/topscope.ml typing/printbasic.ml typing/printparse.ml \
typing/printscope.ml typing/typecore.ml typing/substcore.ml \
typing/inputpt.ml typing/substmod.ml typing/envtype.ml \
typing/printtypes.ml typing/substract.ml typing/freevars.ml \
typing/outputp.ml typing/infermod.ml typing/infercore.ml \
typing/printmod.ml typing/error.ml \
\
toplevel/main.ml


BATCHSRCS = $(GENERATEDSRCS) \
parsing/location.ml parsing/longident.ml parsing/syntaxerr.ml \
parsing/asttypes.ml parsing/pstream.ml parsing/parse.ml \
\
utils/misc.ml utils/tbl.ml utils/config.ml utils/clflags.ml \
utils/terminfo.ml utils/ccomp.ml \
\
typing/files.ml typing/stdlibpath.ml typing/listextra.ml \
typing/ident.ml typing/path.ml typing/subst.ml typing/envscope.ml \
typing/corescope.ml typing/extendhandler.ml typing/modscope.ml \
typing/topscope.ml typing/printbasic.ml typing/printparse.ml \
typing/printscope.ml typing/typecore.ml typing/substcore.ml \
typing/inputpt.ml typing/substmod.ml typing/envtype.ml \
typing/printtypes.ml typing/substract.ml typing/freevars.ml \
typing/outputp.ml typing/infermod.ml typing/infercore.ml \
typing/printmod.ml typing/error.ml \
\
batch/main.ml


LINKSRCS = parsing/location.ml parsing/longident.ml parsing/syntaxerr.ml \
parsing/asttypes.ml parsing/pstream.ml parsing/parse.ml \
\
utils/misc.ml utils/tbl.ml utils/config.ml utils/clflags.ml \
utils/terminfo.ml utils/ccomp.ml \
\
typing/files.ml typing/stdlibpath.ml typing/listextra.ml \
typing/ident.ml typing/path.ml typing/subst.ml typing/envscope.ml \
typing/corescope.ml typing/extendhandler.ml typing/modscope.ml \
typing/topscope.ml typing/printbasic.ml typing/printparse.ml \
typing/printscope.ml typing/typecore.ml typing/substcore.ml \
typing/inputpt.ml typing/substmod.ml typing/envtype.ml \
typing/printtypes.ml typing/substract.ml typing/freevars.ml \
typing/outputp.ml typing/infermod.ml typing/infercore.ml \
typing/printmod.ml typing/error.ml \
\
link/main.ml


INTERFACESRCS = parsing/location.ml parsing/longident.ml parsing/syntaxerr.ml \
parsing/asttypes.ml parsing/pstream.ml parsing/parse.ml \
\
utils/misc.ml utils/tbl.ml utils/config.ml utils/clflags.ml \
utils/terminfo.ml utils/ccomp.ml \
\
typing/files.ml typing/stdlibpath.ml typing/listextra.ml \
typing/ident.ml typing/path.ml typing/subst.ml typing/envscope.ml \
typing/corescope.ml typing/extendhandler.ml typing/modscope.ml \
typing/topscope.ml typing/printbasic.ml typing/printparse.ml \
typing/printscope.ml typing/typecore.ml typing/substcore.ml \
typing/inputpt.ml typing/substmod.ml typing/envtype.ml \
interface/printcontext.mli \
interface/tkprinttypes.ml typing/printtypes.ml typing/substract.ml \
typing/freevars.ml typing/outputp.ml typing/infermod.ml \
typing/infercore.ml interface/tkprintmod.ml typing/error.ml \
\
interface/global.ml interface/tklowprint.ml interface/tkloadsrc.ml \
interface/preferences.ml interface/rootwindow.ml \
interface/modselector.ml interface/main.ml



# Exec file names
TOPNAME = bin/ocamlexc
BATCHNAME = bin/ocamlexcc
LINKNAME = bin/ocamlexcl
INTERFACENAME = bin/ocamlexcli


# *******************************************************************
# Avanti...

# Building the world (but the toplevel)
all: batch link toplevel interface
opt: batchopt linkopt toplevelopt interfaceopt

install: batch link toplevel interface stdlibcme
cp -R bin $(INSTALLDIR)
ln -s $(INSTALLDIR)/bin/batch /usr/local/bin/batch
ln -s $(INSTALLDIR)/bin/link /usr/local/bin/link
ln -s $(INSTALLDIR)/bin/toplevel /usr/local/bin/toplevel
ln -s $(INSTALLDIR)/bin/interface /usr/local/bin/interface
cp -R stdlib $(INSTALLDIR)

installopt: batchopt linkopt toplevelopt interfaceopt stdlibcme
cp -R bin $(INSTALLDIR)
ln -s $(INSTALLDIR)/bin/batchopt /usr/local/bin/batch.opt
ln -s $(INSTALLDIR)/bin/linkopt /usr/local/bin/link.opt
ln -s $(INSTALLDIR)/bin/toplevelopt /usr/local/bin/toplevel.opt
ln -s $(INSTALLDIR)/bin/interfaceopt /usr/local/bin/interface.opt
cp -R stdlib $(INSTALLDIR)

stdlibcme:
./bin/makelibcme


toplevel: $(TOPOBJS)
$(CAMLC) $(LINKFLAG) $(TOPOBJS) -o $(TOPNAME)

batch: $(BATCHOBJS)
$(CAMLC) $(LINKFLAG) $(BATCHOBJS) -o $(BATCHNAME)

link: $(LINKOBJS)
$(CAMLC) $(LINKFLAG) $(LINKOBJS) -o $(LINKNAME)

interface: $(INTERFACEOBJS)
$(CAMLC) -custom unix.cma $(WITH_TK) $(INTERFACEOBJS) \
-cclib -lunix -o $(INTERFACENAME)



toplevelopt: $(TOPOBJS:.cmo=.cmx)
$(CAMLOPT) $(LINKFLAG) $(TOPOBJS:.cmo=.cmx) -o $(TOPNAME).opt

batchopt: $(BATCHOBJS:.cmo=.cmx)
$(CAMLOPT) $(LINKFLAG) $(BATCHOBJS:.cmo=.cmx) -o $(BATCHNAME).opt

linkopt: $(LINKOBJS:.cmo=.cmx)
$(CAMLOPT) $(LINKFLAG) $(LINKOBJS:.cmo=.cmx) -o $(LINKNAME).opt

interfaceopt: $(INTERFACEOBJS:.cmo=.cmx)
$(CAMLOPT) unix.cmxa $(WITH_TK_OPT) $(INTERFACEOBJS:.cmo=.cmx)\
-cclib -lunix -o $(INTERFACENAME).opt



parsing/parser.mli parsing/parser.ml: parsing/parser.mly
$(CAMLYACC) parsing/parser.mly

parsing/lexer.ml: parsing/lexer.mll
$(CAMLLEX) parsing/lexer.mll

parsing/linenum.ml: parsing/linenum.mll
$(CAMLLEX) parsing/linenum.mll


.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
$(CAMLC) $(COMPFLAG) -c $<

.mli.cmi:
$(CAMLC) $(COMPFLAG) -c $<

.ml.cmx:
$(CAMLOPT) $(COMPFLAG) -c $<


# Clean up
clean:
rm -f parsing/*.cm[iox] parsing/*.o parsing/*~
rm -f parsing/parser.mli
rm -f utils/*.cm[iox] utils/*.o utils/*~
rm -f typing/*.cm[iox] typing/*.o typing/*~
rm -f toplevel/*.cm[iox] toplevel/*.o toplevel/*~
rm -f batch/*.cm[iox] batch/*.o batch/*~
rm -f link/*.cm[iox] link/*.o link/*~
rm -f interface/*.cm[iox] interface/*.o interface/*~
rm -f oldlib/*.cme oldlib/*~
rm -f stdlib/*.cme stdlib/*~
rm -f tests/*.cme tests/*/*.cme
rm -f $(GENERATEDSRCS)
rm -f $(TOPNAME) $(BATCHNAME) $(LINKNAME) $(INTERFACENAME)
rm -f $(TOPNAME).opt $(BATCHNAME).opt $(LINKNAME).opt \
$(INTERFACENAME).opt
rm -f *~

# Dependencies
depend: $(GENERATEDSRCS)
$(CAMLDEP) $(DEPFLAGS) batch/*.ml{,i} interface/*.ml{,i} \
link/*.ml{,i} parsing/*.ml{,i} toplevel/*.ml{,i} \
typing/*.ml{,i} utils/*.ml{,i} > .depend

include .depend
# DO NOT DELETE
Something went wrong with that request. Please try again.