Hi,

Markus Mottl wrote:
> On 11/5/07, Samuel Mimram <[EMAIL PROTECTED]> wrote:
>> It would be nice if OCamlMakefile could provide a debug-native-code (or
>> dnc) target which would build programs in native mode with the -g option
>> which was introduced in OCaml 3.10.
> 
> I'm afraid I don't maintain OCamlMakefile anymore, because we
> exclusively use "omake" at work.  But if you want to contribute a
> patch, please feel free to do so.  Thanks!

This is really too bad! OCamlMakefile is a great tool to have a simple
portable build system which requires only make which you can assume is
installed on most systems... Anyway, here is the patch.

Thanks!

Cheers,

Samuel.
--- OCamlMakefile.old   2007-11-06 21:50:53.000000000 +0000
+++ OCamlMakefile       2007-11-06 21:59:26.000000000 +0000
@@ -791,6 +791,23 @@
                                OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
 dcnl:  debug-code-nolink
 
+# generates byte-code with debugging information (native code)
+debug-native-code:     $(PRE_TARGETS)
+                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(NCRESULT) \
+                               REAL_RESULT="$(NCRESULT)" make_deps=yes \
+                               REAL_OCAMLC="$(OCAMLOPT)" \
+                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
+                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
+dnc:   debug-native-code
+
+debug-nativecode-nolink:       $(PRE_TARGETS)
+                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) nolink \
+                               REAL_RESULT="$(NCRESULT)" make_deps=yes \
+                               REAL_OCAMLC="$(OCAMLOPT)" \
+                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
+                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
+dncnl: debug-native-code-nolink
+
 # generates byte-code libraries with debugging information
 debug-code-library:    $(PRE_TARGETS)
                        $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
@@ -801,6 +818,17 @@
                                OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
 dcl:   debug-code-library
 
+# generates byte-code libraries with debugging information (native code)
+debug-native-code-library:     $(PRE_TARGETS)
+                       $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) \
+                               $(RES_CLIB) $(NCRESULT).cma \
+                               REAL_RESULT="$(NCRESULT)" make_deps=yes \
+                               REAL_OCAMLC="$(OCAMLOPT)" \
+                               CREATE_LIB=yes \
+                               OCAMLFLAGS="-g $(OCAMLFLAGS)" \
+                               OCAMLLDFLAGS="-g $(OCAMLLDFLAGS)"
+dncl:  debug-native-code-library
+
 # generates byte-code for profiling
 profiling-byte-code:           $(PRE_TARGETS)
                        $(QUIET)$(MAKE) -r -f $(OCAMLMAKEFILE) $(BCRESULT) \

Reply via email to