* [Caml-list] [ANN] Announcing yet another Makefile for OCaml @ 2014-01-22 1:03 Christian Rinderknecht 2014-01-22 7:43 ` William R 0 siblings, 1 reply; 9+ messages in thread From: Christian Rinderknecht @ 2014-01-22 1:03 UTC (permalink / raw) To: caml-list Dear list members, I would like to announce a Makefile for small OCaml projects. Although this list is read by many seasoned programmers who likely use ocamlbuild, those who prefer total control over the build process and beginners alike may find it useful. It is distributed along with a manual and a detailed documentation in ASCII. The requirements, beyond the obvious, are GNU Make 3.82 or 4.00 (later recommended for paralellism), GNU Sed, Linux (with GNU coreutils) or Darwin (OS X) and dash or bash. Particular emphasis has been brought to reporting only independent errors and minimising recompilations. The makefile has no interface with control version systems, but it detects modifications, deletions and creations of source files between build cycles, and it reacts appropriately so there is no need to restart a build cycle from a clean slate to correct an inconsistency. Note that, as usual with makefiles, this build system relies only on time stamps to determine its actions. Since this is a beta release, you are very welcome to report any errors. Let me also know if you improve portability (e.g., the sed regular expressions are mostly compatible with BSD sed, but not quite). The urls are http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile.man http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile.doc Best regards, Christian ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-22 1:03 [Caml-list] [ANN] Announcing yet another Makefile for OCaml Christian Rinderknecht @ 2014-01-22 7:43 ` William R 2014-01-22 19:22 ` Christian Rinderknecht 0 siblings, 1 reply; 9+ messages in thread From: William R @ 2014-01-22 7:43 UTC (permalink / raw) To: caml-list Hello, could you explain differences with OCamlMakefile (and pros!) , which seems to be similar to your project, but which is maintained from quite a long time now ? https://bitbucket.org/mmottl/ocaml-makefile why not contribute to this project if you introduced compatible clever ideas ? Regards On 01/22/2014 02:03 AM, Christian Rinderknecht wrote: > Dear list members, > > I would like to announce a Makefile for small OCaml projects. > > Although this list is read by many seasoned programmers who likely use > ocamlbuild, those who prefer total control over the build process and > beginners alike may find it useful. It is distributed along with a > manual and a detailed documentation in ASCII. The requirements, beyond > the obvious, are GNU Make 3.82 or 4.00 (later recommended for > paralellism), GNU Sed, Linux (with GNU coreutils) or Darwin (OS X) and > dash or bash. > > Particular emphasis has been brought to reporting only independent > errors and minimising recompilations. The makefile has no interface > with control version systems, but it detects modifications, deletions > and creations of source files between build cycles, and it reacts > appropriately so there is no need to restart a build cycle from a > clean slate to correct an inconsistency. Note that, as usual with > makefiles, this build system relies only on time stamps to determine > its actions. > > Since this is a beta release, you are very welcome to report any > errors. Let me also know if you improve portability (e.g., the sed > regular expressions are mostly compatible with BSD sed, but not > quite). > > The urls are > > http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile > http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile.man > http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile.doc > > Best regards, > > Christian > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-22 7:43 ` William R @ 2014-01-22 19:22 ` Christian Rinderknecht 2014-01-22 23:30 ` John Whitington 2014-01-23 9:35 ` Goswin von Brederlow 0 siblings, 2 replies; 9+ messages in thread From: Christian Rinderknecht @ 2014-01-22 19:22 UTC (permalink / raw) To: William R, caml-list [-- Attachment #1: Type: text/plain, Size: 3011 bytes --] Dear William and list members, On 01/22/2014 08:43 AM, William R wrote: > could you explain differences with OCamlMakefile This is a fair question, since Markus' work has been around for quite a while, but I am afraid that I never used it. Nevertheless, I went through the documentation and the source code and here are the main differences I can see at the moment (my apologies to Markus if I am mistaken): OCamlMakefile vs my Makefile * User specifies SOURCES and RESULT vs optional OBJ and BIN * Order of linking must be specified vs optional * Builds library and toplevels vs none * Supports -pack/-for-pack and profiling vs none * Preprocessors in special comments, no command-line options per source file vs one tag file per source file + global options * Generates documentation vs none * Subprojects vs mono-project * Support for ocamlfind vs none * Included in another Makefile vs includes another Makefile * One native code compilation vs two * 1300 lines vs 830 lines * Plethora of phony targets vs two * Short documentation vs long OCamlMakefile supports more features than I do, although I use tag files à la ocamlbuild. This is not surprising, as my makefile was not developed to cover many use-cases, just mine and those of beginners. Accordingly, I put an extreme emphasis on different issues, like having the laziest makefile possible: it works a lot in order to compile as little as possible and requires the programmer to configure as little as possible. The output on the terminal is entirely generated by the Makefile, not by the tools it calls, and, if available, it leverages the --output-sync option of GNU Make 4.0 to keep everything readable while using parallelism. Also, there is an impact analysis in case of errors, so there are no redundant error messages (one error implying another in another module) and no useless recompilations (bound to fail). Another feature is that my makefile keeps track of source deletions, which are a major source of inconsistencies, while updating compilation dependencies locally, and, generally speaking, the main design principle is that you should *never* have to do [make clean] if you don't really want to (the only case where you should is compiling to native code when maximising cross-module optimisations and inlining). > why not contribute to this project if you introduced compatible > clever ideas ? OCamlMakefile and my Makefile address different crowds, but these can actually benefit from each other, you are right. I will keep that in mind, but before I add more features à la OCamlMakefile, or the other way around, I would like to have bug reports. You can simply try my makefile by putting it in a single-directory project and setting BIN to the main module's basename in Makefile.cfg. (Each file requiring camlp4 or special options for certain tools require a tag file. See Makefile.man) Best regards, Christian PS I did not know about obuild. I will have a look at it. [-- Attachment #2: Type: text/html, Size: 3926 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-22 19:22 ` Christian Rinderknecht @ 2014-01-22 23:30 ` John Whitington 2014-01-23 0:08 ` Christian Rinderknecht 2014-01-23 9:35 ` Goswin von Brederlow 1 sibling, 1 reply; 9+ messages in thread From: John Whitington @ 2014-01-22 23:30 UTC (permalink / raw) To: rinderkn; +Cc: William R, caml-list Hi, Thanks for this work -- I'll have a look since I use OCamlmakefile exclusively at the moment. Per-module options look interesting! Christian Rinderknecht wrote: > Dear William and list members, > > On 01/22/2014 08:43 AM, William R wrote: >> could you explain differences with OCamlMakefile > > This is a fair question, since Markus' work has been around for quite > a while, but I am afraid that I never used it. Nevertheless, I went > through the documentation and the source code and here are the main > differences I can see at the moment (my apologies to Markus if I am > mistaken): To correct a few: in OCamlmakefile: > * Builds library and toplevels vs none make top, make byte-code-no-link, make native-code-nolink > * Generates documentation vs none make htdoc/ltdoc/psdoc/pdfdoc > * Support for ocamlfind vs none PACKS = camlpdf to use ocamlfind packages. To get it to use ocamlfind all over, use REAL_OCAMLFIND=ocamlfind (not documented) Thanks, -- John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/ ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-22 23:30 ` John Whitington @ 2014-01-23 0:08 ` Christian Rinderknecht 0 siblings, 0 replies; 9+ messages in thread From: Christian Rinderknecht @ 2014-01-23 0:08 UTC (permalink / raw) To: John Whitington; +Cc: William R, caml-list [-- Attachment #1: Type: text/plain, Size: 864 bytes --] Thank you, John, for the technical details. I had these in mind when I wrote "OCamlMakefile vs my Makefile", so the format "XXX vs YYY" was meant to attribute feature XXX to OCamlMakefile and YYY to my makefile. I should have been more explicit, sorry, but, then, I hardly ever use printf;-) For those of you who have students learning OCaml, I am particularly interested in your feedback with using my makefile. Thanks! Best, Christian > To correct a few: in OCamlmakefile: > >> * Builds library and toplevels vs none > > make top, make byte-code-no-link, make native-code-nolink > >> * Generates documentation vs none > > make htdoc/ltdoc/psdoc/pdfdoc > >> * Support for ocamlfind vs none > > PACKS = camlpdf > > to use ocamlfind packages. > > To get it to use ocamlfind all over, use > > REAL_OCAMLFIND=ocamlfind > > (not documented) [-- Attachment #2: Type: text/html, Size: 1458 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-22 19:22 ` Christian Rinderknecht 2014-01-22 23:30 ` John Whitington @ 2014-01-23 9:35 ` Goswin von Brederlow 2014-01-23 10:36 ` Malcolm Matalka ` (2 more replies) 1 sibling, 3 replies; 9+ messages in thread From: Goswin von Brederlow @ 2014-01-23 9:35 UTC (permalink / raw) To: caml-list On Wed, Jan 22, 2014 at 08:22:30PM +0100, Christian Rinderknecht wrote: > Dear William and list members, > > On 01/22/2014 08:43 AM, William R wrote: > >could you explain differences with OCamlMakefile > > This is a fair question, since Markus' work has been around for quite > a while, but I am afraid that I never used it. Nevertheless, I went > through the documentation and the source code and here are the main > differences I can see at the moment (my apologies to Markus if I am > mistaken): > > OCamlMakefile vs my Makefile > * Support for ocamlfind vs none No ocamlfind? That realy sucks. Anything non trivial will require some extras, if only batteries, core or unix. You realy need support for ocamlfind so adding libraries becomes easy. MfG Goswin ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-23 9:35 ` Goswin von Brederlow @ 2014-01-23 10:36 ` Malcolm Matalka 2014-01-23 14:47 ` Christian Rinderknecht 2014-01-24 16:18 ` Christian Rinderknecht 2 siblings, 0 replies; 9+ messages in thread From: Malcolm Matalka @ 2014-01-23 10:36 UTC (permalink / raw) To: Goswin von Brederlow; +Cc: caml-list FWIW, I have my own Makefile approach, with ocamlfind support. I started it because I wanted to understand how to compile things in Ocaml and the various files needed to build different variables. Since then it's grown into the base for all of my Ocaml. I should probably use ocamlbuild but I've never really found it that compelling and my Makefile solution handles making and running tests and examples for me just how I like it. It is in a repo I clone from whenever I start a new repo: https://github.com/orbitz/ocaml-template I don't actually suggest using it unless one understands Makefile's a bit, it's made specifically for things I want. /M Goswin von Brederlow <goswin-v-b@web.de> writes: > On Wed, Jan 22, 2014 at 08:22:30PM +0100, Christian Rinderknecht wrote: >> Dear William and list members, >> >> On 01/22/2014 08:43 AM, William R wrote: >> >could you explain differences with OCamlMakefile >> >> This is a fair question, since Markus' work has been around for quite >> a while, but I am afraid that I never used it. Nevertheless, I went >> through the documentation and the source code and here are the main >> differences I can see at the moment (my apologies to Markus if I am >> mistaken): >> >> OCamlMakefile vs my Makefile >> * Support for ocamlfind vs none > > No ocamlfind? That realy sucks. Anything non trivial will require some > extras, if only batteries, core or unix. You realy need support for > ocamlfind so adding libraries becomes easy. > > MfG > Goswin ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-23 9:35 ` Goswin von Brederlow 2014-01-23 10:36 ` Malcolm Matalka @ 2014-01-23 14:47 ` Christian Rinderknecht 2014-01-24 16:18 ` Christian Rinderknecht 2 siblings, 0 replies; 9+ messages in thread From: Christian Rinderknecht @ 2014-01-23 14:47 UTC (permalink / raw) To: caml-list [-- Attachment #1: Type: text/plain, Size: 840 bytes --] On 01/23/2014 10:35 AM, Goswin von Brederlow wrote: >> [...] >> OCamlMakefile vs my Makefile >> * Support for ocamlfind vs none > > No ocamlfind? That realy sucks. Anything non trivial will require > some extras, if only batteries, core or unix. You realy need support > for ocamlfind so adding libraries becomes easy. If you want to use ocamlfind as a driver to ocamldep, the compilers ocamlc and ocamlopt and the linkers, you can simply prefix the calls to these in the Makefile like so: instead of ${OCAMLC} .... write ocamlfind ${OCAMLC} ... Then use the tag files for .mli, .ml and for the two linkers (byte-code and native-code), to pass options specific to ocamlfind as if they were for ocamlc, ocamlopt etc. Adding libraries and performing queries should be done outside the Makefile. Hope this helps, Christian [-- Attachment #2: Type: text/html, Size: 1351 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] [ANN] Announcing yet another Makefile for OCaml 2014-01-23 9:35 ` Goswin von Brederlow 2014-01-23 10:36 ` Malcolm Matalka 2014-01-23 14:47 ` Christian Rinderknecht @ 2014-01-24 16:18 ` Christian Rinderknecht 2 siblings, 0 replies; 9+ messages in thread From: Christian Rinderknecht @ 2014-01-24 16:18 UTC (permalink / raw) To: caml-list [-- Attachment #1: Type: text/plain, Size: 820 bytes --] Dear Goswin and list members, On 01/23/2014 10:35 AM, Goswin von Brederlow wrote: > No ocamlfind? That realy sucks. [...] You realy need support for > ocamlfind so adding libraries becomes easy. I committed the very simple fix I suggested to you in my last email. Now you can simply set OCAMLFIND := ocamlfind in Makefile.cfg and you use the tag files as usual, except the command lines will be passed to ocamlfind. For example, a tag file may be ocamldep: -syntax camlp4o ocamlc: -syntax camlp4o (Note: the warnings emitted by [ocamlfind ocamldep ...] are printed the first time and lost.) The urls are http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile.man http://pnyf.inf.elte.hu/rinderkn/Software/OCaml/Makefile.doc Best regards, Christian [-- Attachment #2: Type: text/html, Size: 1595 bytes --] ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-01-24 16:19 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2014-01-22 1:03 [Caml-list] [ANN] Announcing yet another Makefile for OCaml Christian Rinderknecht 2014-01-22 7:43 ` William R 2014-01-22 19:22 ` Christian Rinderknecht 2014-01-22 23:30 ` John Whitington 2014-01-23 0:08 ` Christian Rinderknecht 2014-01-23 9:35 ` Goswin von Brederlow 2014-01-23 10:36 ` Malcolm Matalka 2014-01-23 14:47 ` Christian Rinderknecht 2014-01-24 16:18 ` Christian Rinderknecht
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox