Bryan Duxbury | 23f2348 | 2010-07-28 18:23:22 +0000 | [diff] [blame] | 1 | NOTE (bryanduxbury): OCamlMakefile is safe to include in the project after |
| 2 | https://issues.apache.org/jira/browse/LEGAL-58. |
| 3 | |
David Reiss | 1dd17f5 | 2008-04-03 20:16:45 +0000 | [diff] [blame] | 4 | --------------------------------------------------------------------------- |
| 5 | |
| 6 | Distribution of "ocaml_make" |
| 7 | Copyright (C) 1999 - 2006 Markus Mottl - free to copy and modify! |
| 8 | USE AT YOUR OWN RISK! |
| 9 | |
| 10 | --------------------------------------------------------------------------- |
| 11 | |
| 12 | PREREQUISITES |
| 13 | |
| 14 | *** YOU WILL NEED GNU-MAKE VERSION >3.80 *** |
| 15 | |
| 16 | --------------------------------------------------------------------------- |
| 17 | |
| 18 | Contents of this distribution |
| 19 | |
| 20 | Changes - guess what? ;-) |
| 21 | |
| 22 | OCamlMakefile - Makefile for easy handling of compilation of not so easy |
| 23 | OCaml-projects. It generates dependencies of OCaml-files |
| 24 | automatically, is able to handle "ocamllex"-, |
| 25 | "ocamlyacc"-, IDL- and C-files, knows how to run |
| 26 | preprocessors and generates native- or byte-code, as |
| 27 | executable or as library - with thread-support if you |
| 28 | want! Profiling and debugging support can be added on |
| 29 | the fly! There is also support for installing libraries. |
| 30 | Ah, yes, and you can also create toplevels from any |
| 31 | sources: this allows you immediate interactive testing. |
| 32 | Automatic generation of documentation is easy due to |
| 33 | integration of support for OCamldoc. |
| 34 | |
| 35 | README - this file |
| 36 | |
| 37 | calc/ - Directory containing a quite fully-featured example |
| 38 | of what "OCamlMakefile" can do for you. This example |
| 39 | makes use of "ocamllex", "ocamlyacc", IDL + C and |
| 40 | threads. |
| 41 | |
| 42 | camlp4/ - This simple example demonstrates how to automatically |
| 43 | preprocess files with the camlp4-preprocessor. |
| 44 | |
| 45 | gtk/ - Demonstration of how to use OCamlMakefile with GTK |
| 46 | and threads. Courtesy of Tim Freeman <tim@fungible.com>. |
| 47 | |
| 48 | idl/ - Contains a very small example of how to use |
| 49 | "camlidl" together with "OCamlMakefile". Also intended |
| 50 | to show, how easy it is to interface OCaml and C. |
| 51 | |
| 52 | threads/ - Two examples of how to use threads (originally |
| 53 | posted by Xavier Leroy some time ago). Shows the use of |
| 54 | "OCamlMakefile" in an environment of multiple compilation |
| 55 | targets. |
| 56 | |
| 57 | --------------------------------------------------------------------------- |
| 58 | |
| 59 | Why should you use it? |
| 60 | |
| 61 | For several reasons: |
| 62 | |
| 63 | * It is well-tested (I use it in all of my projects). |
| 64 | |
| 65 | * In contrast to most other approaches it generates dependencies |
| 66 | correctly by ensuring that all automatically generated OCaml-files |
| 67 | exist before dependency calculation. This is the only way to |
| 68 | guarantee that "ocamldep" works correctly. |
| 69 | |
| 70 | * It is extremely convenient (at least I think so ;-). |
| 71 | Even quite complex compilation processes (see example "calc.ml") |
| 72 | need very little information to work correctly - actually just about |
| 73 | the minimum (file names of sources). |
| 74 | |
| 75 | --------------------------------------------------------------------------- |
| 76 | |
| 77 | When you shouldn't use it... |
| 78 | |
| 79 | In projects where every compilation unit needs different flags - but |
| 80 | in such complicated cases you will be on your own anyway. Luckily, |
| 81 | this doesn't happen too frequently... |
| 82 | |
| 83 | --------------------------------------------------------------------------- |
| 84 | |
| 85 | How to use "OCamlMakefile" in your own project |
| 86 | (Take a look at the examples for a quick introduction!) |
| 87 | |
| 88 | Create your project-specific "Makefile" in the appropriate directory. |
| 89 | |
| 90 | Now there are two ways of making use of "OCamlMakefile": |
| 91 | |
| 92 | 1) Have a look at the default settings in "OCamlMakefile" and set |
| 93 | them to the values that are vaild on your system - whether the |
| 94 | path to the standard libraries is ok, what executables shall be |
| 95 | used, etc... |
| 96 | |
| 97 | 2) Copy it into the directory of the project to be compiled. |
| 98 | Add "-include OCamlMakefile" as a last line of your "Makefile". |
| 99 | |
| 100 | 3) Put it somewhere else on the system. In this case you will have to |
| 101 | set a variable "OCAMLMAKEFILE" in your project-specific "Makefile". |
| 102 | This is the way in which the examples are written: so you need |
| 103 | only one version of "OCamlMakefile" to manage all your projects! |
| 104 | See the examples for details. |
| 105 | |
| 106 | You should usually specify two further variables for your project: |
| 107 | |
| 108 | * SOURCES (default: foo.ml) |
| 109 | * RESULT (default: foo) |
| 110 | |
| 111 | Put all the sources necessary for a target into variable "SOURCES". |
| 112 | Then set "RESULT" to the name of the target. If you want to generate |
| 113 | libraries, you should *not* specify the suffix (".cma", ".cmxa", ".a") |
| 114 | - it will be added automatically if you specify that you want to build |
| 115 | a library. |
| 116 | |
| 117 | ** Don't forget to add the ".mli"-files, too! ** |
| 118 | ** Don't forget that order of the source files matters! ** |
| 119 | |
| 120 | The order is important, because it matters during linking anyway |
| 121 | due to potential side effects caused at program startup. This is |
| 122 | why OCamlMakefile does not attempt to partially order dependencies by |
| 123 | itself, which might confuse users even more. It just compiles and links |
| 124 | OCaml-sources in the order specified by the user, even if it could |
| 125 | determine automatically that the order cannot be correct. |
| 126 | |
| 127 | The minimum of your "Makefile" looks like this (assuming that |
| 128 | "OCamlMakefile" is in the search path of "make"): |
| 129 | |
| 130 | -include OCamlMakefile |
| 131 | |
| 132 | This will assume that you want to compile a file "foo.ml" to a binary |
| 133 | "foo". |
| 134 | |
| 135 | Otherwise, your Makefile will probably contain something like this: |
| 136 | |
| 137 | SOURCES = foo.ml |
| 138 | RESULT = foo |
| 139 | -include OCamlMakefile |
| 140 | |
| 141 | Be careful with the names you put into these variables: if they are wrong, |
| 142 | a "make clean" might erase the wrong files - but I know you will not do |
| 143 | that ;-) |
| 144 | |
| 145 | A simple "make" will generate a byte-code executable. If you want to |
| 146 | change this, you may add an "all"-rule that generates something else. |
| 147 | |
| 148 | E.g.: |
| 149 | |
| 150 | SOURCES = foo.ml |
| 151 | RESULT = foo |
| 152 | all: native-code-library |
| 153 | -include OCamlMakefile |
| 154 | |
| 155 | This will build a native-code library "foo.cmxa" (+ "foo.a") from file |
| 156 | "foo.ml". |
| 157 | |
| 158 | You may even build several targets at once. To produce byte- and native-code |
| 159 | executables with one "make", add the following rule: |
| 160 | |
| 161 | all: byte-code native-code |
| 162 | |
| 163 | You will probably want to use a different suffix for each of these targets |
| 164 | so that the result will not be overwritten (see optional variables below |
| 165 | for details). |
| 166 | |
| 167 | You may also tell "make" at the command-line what kind of target to |
| 168 | produce (e.g. "make nc"). Here all the possibilities with shortcuts |
| 169 | between parenthesis: |
| 170 | |
| 171 | * byte-code (bc) |
| 172 | * byte-code-nolink (bcnl) - no linking stage |
| 173 | * byte-code-library (bcl) |
| 174 | * native-code (nc) |
| 175 | * native-code-nolink (ncnl) - no linking stage |
| 176 | * native-code-library (ncl) |
| 177 | * debug-code (dc) |
| 178 | * debug-code-nolink (dcnl) - no linking stage |
| 179 | * debug-code-library (dcl) |
| 180 | * profiling-byte-code (pbc) |
| 181 | * profiling-byte-code-library (pbcl) |
| 182 | * profiling-native-code (pnc) |
| 183 | * profiling-native-code-library (pncl) |
| 184 | * byte-code-dll (bcd) |
| 185 | * native-code-dll (ncd) |
| 186 | * pack-byte-code (pabc) |
| 187 | * pack-native-code (panc) |
| 188 | * toplevel interpreter (top) |
| 189 | * subprojs |
| 190 | |
| 191 | Here a short note concerning building and linking byte code libraries |
| 192 | with C-files: |
| 193 | |
| 194 | OCaml links C-object files only when they are used in an executable. |
| 195 | After compilation they should be placed in some directory that is in |
| 196 | your include path if you link your library against an executable. |
| 197 | |
| 198 | It is sometimes more convenient to link all C-object files into a |
| 199 | single C-library. Then you have to override the automatic link flags |
| 200 | of your library using "-noautolink" and add another linkflag that |
| 201 | links in your C-library explicitly. |
| 202 | |
| 203 | What concerns maintainance: |
| 204 | |
| 205 | "make clean" removes all (all!) automatically generated files - so |
| 206 | again: make sure your variables are ok! |
| 207 | |
| 208 | "make cleanup" is similar to "make clean" but leaves executables. |
| 209 | |
| 210 | Another way to destroy some important files is by having "OCamlMakefile" |
| 211 | automatically generate files with the same name. Read the documentation |
| 212 | about the tools in the OCaml-distribution to see what kind of files are |
| 213 | generated. "OCamlMakefile" additionally generates ('%' is basename of |
| 214 | source file): |
| 215 | |
| 216 | %_idl.c - "camlidl" generates a file "%.c" from "%.idl", but this is |
| 217 | not such a good idea, because when generating native-code, |
| 218 | both the file "%.c" and "%.ml" would generate files "%.o" |
| 219 | which would overwrite each other. Thus, "OCamlMakefile" |
| 220 | renames "%.c" to "%_idl.c" to work around this problem. |
| 221 | |
| 222 | The dependencies are stored in three different subdirectories (dot dirs): |
| 223 | |
| 224 | ._d - contains dependencies for .ml-files |
| 225 | ._bcdi - contains byte code dependencies for .mli-files |
| 226 | ._ncdi - contains native code dependencies for .mli-files |
| 227 | |
| 228 | The endings of the dependency files are: "%.d" for those generated from |
| 229 | "%.ml"-files, "%.di" for ones derived from "%.mli"-files. |
| 230 | |
| 231 | --------------------------------------------------------------------------- |
| 232 | |
| 233 | Debugging |
| 234 | |
| 235 | This is easy: if you discover a bug, just do a "make clean; make dc" |
| 236 | to recompile your project with debugging information. Then you can |
| 237 | immediately apply "ocamldebug" to the executable. |
| 238 | |
| 239 | --------------------------------------------------------------------------- |
| 240 | |
| 241 | Profiling |
| 242 | |
| 243 | For generating code that can be profiled with "ocamlprof" (byte code) |
| 244 | or "gprof" (native code), compile your project with one of the profiling |
| 245 | targets (see targets above). E.g.: |
| 246 | |
| 247 | * "make pbc" will build byte code that can be profiled with |
| 248 | "ocamlprof". |
| 249 | |
| 250 | * "make pnc" will build native code that can be profiled with |
| 251 | "gprof". |
| 252 | |
| 253 | Please note that it is not currently possible to profile byte code with |
| 254 | threads. OCamlMakefile will force an error if you try to do this. |
| 255 | |
| 256 | A short hint for DEC Alpha-users (under Digital Unix): you may also |
| 257 | compile your sources to native code without any further profiling |
| 258 | options/targets. Then call "pixie my_exec", "my_exec" being your |
| 259 | executable. This will produce (among other files) an executable |
| 260 | "my_exec.pixie". Call it and it will produce profiling information which |
| 261 | can be analysed using "prof -pixie my_exec". The resulting information |
| 262 | is extremely detailed and allows analysis up to the clock cycle level... |
| 263 | |
| 264 | --------------------------------------------------------------------------- |
| 265 | |
| 266 | Using Preprocessors |
| 267 | |
| 268 | Because one could employ any kind of program that reads from standard |
| 269 | input and prints to standard output as preprocessor, there cannot be any |
| 270 | default way to handle all of them correctly without further knowledge. |
| 271 | |
| 272 | Therefore you have to cooperate a bit with OCamlMakefile to let |
| 273 | preprocessing happen automatically. Basically, this only requires |
| 274 | that you put a comment into the first line of files that should be |
| 275 | preprocessed, e.g.: |
| 276 | |
| 277 | (*pp cat *) |
| 278 | ... rest of program ... |
| 279 | |
| 280 | OCamlMakefile looks at the first line of your files, and if it finds |
| 281 | a comment that starts with "(*pp", then it will assume that the |
| 282 | rest of the comment tells it how to correctly call the appropriate |
| 283 | preprocessor. In this case the program "cat" will be called, which will, |
| 284 | of course, just output the source text again without changing it. |
| 285 | |
| 286 | If you are, for example, an advocate of the new "revised syntax", |
| 287 | which is supported by the camlp4 preprocessor, you could simply write: |
| 288 | |
| 289 | (*pp camlp4r *) |
| 290 | ... rest of program in revised syntax ... |
| 291 | |
| 292 | Simple, isn't it? |
| 293 | |
| 294 | If you want to write your own syntax extensions, just take a look at the |
| 295 | example in the directory "camlp4": it implements the "repeat ... until" |
| 296 | extension as described in the camlp4-tutorial. |
| 297 | |
| 298 | --------------------------------------------------------------------------- |
| 299 | |
| 300 | Library (Un-)Installation Support |
| 301 | |
| 302 | OCamlMakefile contains two targets using "ocamlfind" for this purpose: |
| 303 | |
| 304 | * libinstall |
| 305 | * libuninstall |
| 306 | |
| 307 | These two targets require the existence of the variable |
| 308 | "LIBINSTALL_FILES", which should be set to all the files that you |
| 309 | want to install in the library directory (usually %.mli, %.cmi, %.cma, |
| 310 | %.cmxa, %.a and possibly further C-libraries). The target "libinstall" |
| 311 | has the dependency "all" to force compilation of the library so make |
| 312 | sure you define target "all" in your Makefile appropriately. |
| 313 | |
| 314 | The targets inform the user about the configured install path and ask |
| 315 | for confirmation to (un)install there. If you want to use them, it |
| 316 | is often a good idea to just alias them in your Makefile to "install" |
| 317 | and "uninstall" respectively. |
| 318 | |
| 319 | Two other targets allow installation of files into a particular |
| 320 | directory (without using ocamlfind): |
| 321 | |
| 322 | * rawinstall |
| 323 | * rawuninstall |
| 324 | |
| 325 | --------------------------------------------------------------------------- |
| 326 | |
| 327 | Building toplevels |
| 328 | |
| 329 | There is just one target for this: |
| 330 | |
| 331 | * top |
| 332 | |
| 333 | The generated file can be used immediately for interactive sessions - |
| 334 | even with scanners, parsers, C-files, etc.! |
| 335 | |
| 336 | --------------------------------------------------------------------------- |
| 337 | |
| 338 | Generating documentation |
| 339 | |
| 340 | The following targets are supported: |
| 341 | |
| 342 | * htdoc - generates HTML-documentation |
| 343 | * ladoc - generates Latex-documentation |
| 344 | * psdoc - generates PostScript-documentation |
| 345 | * pdfdoc - generates PDF-documentation |
| 346 | * doc - generates all supported forms of documentation |
| 347 | * clean-doc - generates all supported forms of documentation |
| 348 | |
| 349 | All of them generate a sub-directory "doc". More precisely, for HTML it |
| 350 | is "doc/$(RESULT)/html" and for Latex, PostScript and PDF the directory |
| 351 | "doc/$(RESULT)/latex". See the OCamldoc-manual for details and the |
| 352 | optional variables below for settings you can control. |
| 353 | |
| 354 | --------------------------------------------------------------------------- |
| 355 | |
| 356 | Handling subprojects |
| 357 | |
| 358 | You can have several targets in the same directory and manage them |
| 359 | from within an single Makefile. |
| 360 | |
| 361 | Give each subproject a name, e.g. "p1", "p2", etc. Then you export |
| 362 | settings specific to each project by using variables of the form |
| 363 | "PROJ_p1", "PROJ_p2", etc. E.g.: |
| 364 | |
| 365 | define PROJ_p1 |
| 366 | SOURCES="foo.ml main.ml" |
| 367 | RESULT="p1" |
| 368 | OCAMLFLAGS="-unsafe" |
| 369 | endef |
| 370 | export PROJ_p1 |
| 371 | |
| 372 | define PROJ_p2 |
| 373 | ... |
| 374 | endef |
| 375 | export PROJ_p2 |
| 376 | |
| 377 | You may also export common settings used by all projects directly, e.g. |
| 378 | "export THREADS = y". |
| 379 | |
| 380 | Now it is a good idea to define, which projects should be affected by |
| 381 | commands by default. E.g.: |
| 382 | |
| 383 | ifndef SUBPROJS |
| 384 | export SUBPROJS = p1 p2 |
| 385 | endif |
| 386 | |
| 387 | This will automatically generate a given target for all those |
| 388 | subprojects if this variable has not been defined in the shell |
| 389 | environment or in the command line of the make-invocation by the user. |
| 390 | E.g., "make dc" will generate debug code for all subprojects. |
| 391 | |
| 392 | Then you need to define a default action for your subprojects if "make" |
| 393 | has been called without arguments: |
| 394 | |
| 395 | all: bc |
| 396 | |
| 397 | This will build byte code by default for all subprojects. |
| 398 | |
| 399 | Finally, you'll have to define a catch-all target that uses the target |
| 400 | provided by the user for all subprojects. Just add (assuming that |
| 401 | OCAMLMAKEFILE has been defined appropriately): |
| 402 | |
| 403 | %: |
| 404 | @make -f $(OCAMLMAKEFILE) subprojs SUBTARGET=$@ |
| 405 | |
| 406 | See the "threads"-directory in the distribution for a short example! |
| 407 | |
| 408 | --------------------------------------------------------------------------- |
| 409 | |
| 410 | Optional variables that may be passed to "OCamlMakefile" |
| 411 | |
| 412 | * LIB_PACK_NAME - packs all modules of a library into a module whose |
| 413 | name is given in variable "LIB_PACK_NAME". |
| 414 | |
| 415 | * RES_CLIB_SUF - when building a library that contains C-stubs, this |
| 416 | variable controls the suffix appended to the name |
| 417 | of the C-library (default: "_stubs"). |
| 418 | |
| 419 | * THREADS - say "THREADS = yes" if you need thread support compiled in, |
| 420 | otherwise leave it away. |
| 421 | |
| 422 | * VMTHREADS - say "VMTHREADS = yes" if you want to force VM-level |
| 423 | scheduling of threads (byte-code only). |
| 424 | |
| 425 | * ANNOTATE - say "ANNOTATE = yes" to generate type annotation files |
| 426 | (.annot) to support displaying of type information |
| 427 | in editors. |
| 428 | |
| 429 | * USE_CAMLP4 - say "USE_CAMLP4 = yes" in your "Makefile" if you |
| 430 | want to include the camlp4 directory during the |
| 431 | build process, otherwise leave it away. |
| 432 | |
| 433 | * INCDIRS - directories that should be searched for ".cmi"- and |
| 434 | ".cmo"-files. You need not write "-I ..." - just the |
| 435 | plain names. |
| 436 | * LIBDIRS - directories that should be searched for libraries |
| 437 | Also just put the plain paths into this variable |
| 438 | * EXTLIBDIRS - Same as "LIBDIRS", but paths in this variable are |
| 439 | also added to the binary via the "-R"-flag so that |
| 440 | dynamic libraries in non-standard places can be found. |
| 441 | * RESULTDEPS - Targets on which results (executables or libraries) |
| 442 | should additionally depend. |
| 443 | |
| 444 | * PACKS - adds packages under control of "findlib". |
| 445 | |
| 446 | * PREDS - specifies "findlib"-predicates. |
| 447 | |
| 448 | * LIBS - OCaml-libraries that should be linked (just plain names). |
| 449 | E.g. if you want to link the Str-library, just write |
| 450 | "str" (without quotes). |
| 451 | The new OCaml-compiler handles libraries in such |
| 452 | a way that they "remember" whether they have to |
| 453 | be linked against a C-library and it gets linked |
| 454 | in automatically. |
| 455 | If there is a slash in the library name (such as |
| 456 | "./str" or "lib/foo") then make is told that the |
| 457 | generated files depend on the library. This |
| 458 | helps to ensure that changes to your libraries are |
| 459 | taken into account, which is important if you are |
| 460 | regenerating your libraries frequently. |
| 461 | * CLIBS - C-libraries that should be linked (just plain names). |
| 462 | |
| 463 | * PRE_TARGETS - set this to a list of target files that you want |
| 464 | to have buildt before dependency calculation actually |
| 465 | takes place. E.g. use this to automatically compile |
| 466 | modules needed by camlp4, which have to be available |
| 467 | before other modules can be parsed at all. |
| 468 | |
| 469 | ** WARNING **: the files mentioned in this variable |
| 470 | will be removed when "make clean" is executed! |
| 471 | |
| 472 | * LIBINSTALL_FILES - the files of a library that should be installed |
| 473 | using "findlib". Default: |
| 474 | |
| 475 | $(RESULT).mli $(RESULT).cmi $(RESULT).cma |
| 476 | $(RESULT).cmxa $(RESULT).a lib$(RESULT).a |
| 477 | |
| 478 | * OCAML_LIB_INSTALL - target directory for "rawinstall/rawuninstall". |
| 479 | (default: $(OCAMLLIBPATH)/contrib) |
| 480 | |
| 481 | * DOC_FILES - names of files from which documentation is generated. |
| 482 | (default: all .mli-files in your $(SOURCES)). |
| 483 | |
| 484 | * DOC_DIR - name of directory where documentation should be stored. |
| 485 | |
| 486 | * OCAMLFLAGS - flags passed to the compilers |
| 487 | * OCAMLBCFLAGS - flags passed to the byte code compiler only |
| 488 | * OCAMLNCFLAGS - flags passed to the native code compiler only |
| 489 | |
| 490 | * OCAMLLDFLAGS - flags passed to the OCaml-linker |
| 491 | * OCAMLBLDFLAGS - flags passed to the OCaml-linker when linking byte code |
| 492 | * OCAMLNLDFLAGS - flags passed to the OCaml-linker when linking |
| 493 | native code |
| 494 | |
| 495 | * OCAMLMKLIB_FLAGS - flags passed to the OCaml library tool |
| 496 | |
| 497 | * OCAMLCPFLAGS - profiling flags passed to "ocamlcp" (default: "a") |
| 498 | |
| 499 | * PPFLAGS - additional flags passed to the preprocessor (default: none) |
| 500 | |
| 501 | * LFLAGS - flags passed to "ocamllex" |
| 502 | * YFLAGS - flags passed to "ocamlyacc" |
| 503 | * IDLFLAGS - flags passed to "camlidl" |
| 504 | |
| 505 | * OCAMLDOCFLAGS - flags passed to "ocamldoc" |
| 506 | |
| 507 | * OCAMLFIND_INSTFLAGS - flags passed to "ocamlfind" during installation |
| 508 | (default: none) |
| 509 | |
| 510 | * DVIPSFLAGS - flags passed to dvips |
| 511 | (when generating documentation in PostScript). |
| 512 | |
| 513 | * STATIC - set this variable if you want to force creation |
| 514 | of static libraries |
| 515 | |
| 516 | * CC - the C-compiler to be used |
| 517 | * CXX - the C++-compiler to be used |
| 518 | |
| 519 | * CFLAGS - additional flags passed to the C-compiler. |
| 520 | The flag "-DNATIVE_CODE" will be passed automatically |
| 521 | if you choose to build native code. This allows you |
| 522 | to compile your C-files conditionally. But please |
| 523 | note: You should do a "make clean" or remove the |
| 524 | object files manually or touch the %.c-files: |
| 525 | otherwise, they may not be correctly recompiled |
| 526 | between different builds. |
| 527 | |
| 528 | * CXXFLAGS - additional flags passed to the C++-compiler. |
| 529 | |
| 530 | * CPPFLAGS - additional flags passed to the C-preprocessor. |
| 531 | |
| 532 | * CFRAMEWORKS - Objective-C framework to pass to linker on MacOS X. |
| 533 | |
| 534 | * LDFLAGS - additional flags passed to the C-linker |
| 535 | |
| 536 | * RPATH_FLAG - flag passed through to the C-linker to set a path for |
| 537 | dynamic libraries. May need to be set by user on |
| 538 | exotic platforms. (default: "-R"). |
| 539 | |
| 540 | * ELF_RPATH_FLAG - this flag is used to set the rpath on ELF-platforms. |
| 541 | (default: "-R") |
| 542 | |
| 543 | * ELF_RPATH - if this flag is "yes", then the RPATH_FLAG will be |
| 544 | passed by "-Wl" to the linker as normal on |
| 545 | ELF-platforms. |
| 546 | |
| 547 | * OCAMLLIBPATH - path to the OCaml-standard-libraries |
| 548 | (first default: `$(OCAMLC) -where`) |
| 549 | (second default: "/usr/local/lib/ocaml") |
| 550 | |
| 551 | * OCAML_DEFAULT_DIRS - additional path in which the user can supply |
| 552 | default directories to his own collection of |
| 553 | libraries. The idea is to pass this as an environment |
| 554 | variable so that the Makefiles do not have to contain |
| 555 | this path all the time. |
| 556 | |
| 557 | * OCAMLFIND - ocamlfind from findlib (default: "ocamlfind") |
| 558 | * OCAMLC - byte-code compiler (default: "ocamlc") |
| 559 | * OCAMLOPT - native-code compiler (default: "ocamlopt") |
| 560 | * OCAMLMKTOP - top-level compiler (default: "ocamlmktop") |
| 561 | * OCAMLCP - profiling byte-code compiler (default: "ocamlcp") |
| 562 | * OCAMLDEP - dependency generator (default: "ocamldep") |
| 563 | * OCAMLLEX - scanner generator (default: "ocamllex") |
| 564 | * OCAMLYACC - parser generator (default: "ocamlyacc") |
| 565 | * OCAMLMKLIB - tool to create libraries (default: "ocamlmklib") |
| 566 | * CAMLIDL - IDL-code generator (default: "camlidl") |
| 567 | * CAMLIDLDLL - IDL-utility (default: "camlidldll") |
| 568 | * CAMLP4 - camlp4 preprocessor (default: "camlp4") |
| 569 | * OCAMLDOC - OCamldoc-command (default: "ocamldoc") |
| 570 | |
| 571 | * LATEX - Latex-processor (default: "latex") |
| 572 | * DVIPS - dvips-command (default: "dvips") |
| 573 | * PS2PDF - PostScript-to-PDF converter (default: "ps2pdf") |
| 574 | |
| 575 | * CAMELEON_REPORT - report tool of Cameleon (default: "report") |
| 576 | * CAMELEON_REPORT_FLAGS - flags for the report tool of Cameleon |
| 577 | |
| 578 | * CAMELEON_ZOGGY - zoggy tool of Cameleon |
| 579 | (default: "camlp4o pa_zog.cma pr_o.cmo") |
| 580 | * CAMELEON_ZOGGY_FLAGS - flags for the zoggy tool of Cameleon |
| 581 | |
| 582 | * OCAML_GLADECC - Glade compiler for OCaml (default: "lablgladecc2") |
| 583 | * OCAML_GLADECC_FLAGS - flags for the Glade compiler |
| 584 | |
| 585 | * OXRIDL - OXRIDL-generator (default: "oxridl") |
| 586 | |
| 587 | * NOIDLHEADER - set to "yes" to prohibit "OCamlMakefile" from using |
| 588 | the default camlidl-flag "-header". |
| 589 | |
| 590 | * NO_CUSTOM - Prevent linking in custom mode. |
| 591 | |
| 592 | * QUIET - unsetting this variable (e.g. "make QUIET=") |
| 593 | will print all executed commands, including |
| 594 | intermediate ones. This allows more comfortable |
| 595 | debugging when things go wrong during a build. |
| 596 | |
| 597 | * REALLY_QUIET - when set this flag turns off output from some commands. |
| 598 | |
| 599 | * OCAMLMAKEFILE - location of (=path to) this "OCamlMakefile". |
| 600 | Because it calles itself recursively, it has to |
| 601 | know where it is. (default: "OCamlMakefile" = |
| 602 | local directory) |
| 603 | |
| 604 | * BCSUFFIX - Suffix for all byte-code files. E.g.: |
| 605 | |
| 606 | RESULT = foo |
| 607 | BCSUFFIX = _bc |
| 608 | |
| 609 | This will produce byte-code executables/libraries |
| 610 | with basename "foo_bc". |
| 611 | |
| 612 | * NCSUFFIX - Similar to "BCSUFFIX", but for native-code files. |
| 613 | * TOPSUFFIX - Suffix added to toplevel interpreters (default: ".top") |
| 614 | |
| 615 | * SUBPROJS - variable containing the names of subprojects to be |
| 616 | compiled. |
| 617 | |
| 618 | * SUBTARGET - target to be built for all projects in variable |
| 619 | SUBPROJS. |
| 620 | |
| 621 | --------------------------------------------------------------------------- |
| 622 | |
| 623 | Optional variables for Windows users |
| 624 | |
| 625 | * MINGW - variable to detect the MINGW-environment |
| 626 | * MSVC - variable to detect the MSVC-compiler |
| 627 | |
| 628 | --------------------------------------------------------------------------- |
| 629 | |
| 630 | Up-to-date information (newest release of distribution) can always be |
| 631 | found at: |
| 632 | |
| 633 | http://www.ocaml.info/home/ocaml_sources.html |
| 634 | |
| 635 | --------------------------------------------------------------------------- |
| 636 | |
| 637 | Enjoy! |
| 638 | |
| 639 | New York, 2007-04-22 |
| 640 | Markus Mottl |
| 641 | |
| 642 | e-mail: markus.mottl@gmail.com |
| 643 | WWW: http://www.ocaml.info |