octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: removing graphics.h from stamp-prereq in src/Makefile.in


From: John W. Eaton
Subject: Re: removing graphics.h from stamp-prereq in src/Makefile.in
Date: Wed, 06 Feb 2008 05:39:37 -0500

On  6-Feb-2008, Michael Goffioul wrote:

| On Wed, Feb 6, 2008 at 10:45 AM, Michael Goffioul
| <address@hidden> wrote:
| > I found another problem: make does not know how to build y.tab.c,
| > which is part of parse.cc/parse.df dependencies. This can be worked
| > around by adding y.tab.c to PHONY targets, but how do you cope
| > with that under Linux?

GCC doesn't look at the #line directives when generating
dependencies.  Why are those appearing as dependencies?  I would only
expect a dependency generator to be searching include files.

| OK, adding y.tab.c to PHONY targets does not work, because it creates
| a circular dependency. Another solution is in the attached patch.
| 
| Michael.
| 
| ChangeLog
| 
| 2008-02-06  Michael Goffioul <address@hidden>
| 
|     * Makeconf.in (YFLAGS): Add 'l' flag to avoid '#line' generation in
|     the yacc output files.

I'd rather not do that unconditionally, as I think having the line
numbers can help with debugging by pointing to the original source
file (parse.y) instad of the generated parse.cc file.

To avoid the y.tab.c lines, we might use the following patch.
The renaming trick is necessary for real YACCs, but since we require
Bison anyway, and I think it should be safe to use -o to specify the
output file.

jwe


src/ChangeLog:

2008-02-06  John W. Eaton  <address@hidden>

        * Makefile.in (parse.cc): Use "-o $@" instead of renaming y.tab.c.
        (maintainer-clean): Don't remove y.tab.c.


Index: src/Makefile.in
===================================================================
RCS file: /cvs/octave/src/Makefile.in,v
retrieving revision 1.462
diff -u -u -r1.462 Makefile.in
--- src/Makefile.in     6 Feb 2008 08:27:01 -0000       1.462
+++ src/Makefile.in     6 Feb 2008 10:36:57 -0000
@@ -526,7 +526,7 @@
 .PHONY: distclean
 
 maintainer-clean: distclean
-       rm -f tags TAGS y.tab.c y.tab.h y.output yy.lex.c lex.cc parse.cc
+       rm -f tags TAGS y.tab.h y.output yy.lex.c lex.cc parse.cc
        rm -f oct-gperf.h $(OPT_HANDLERS)
 .PHONY: maintainer-clean
 
@@ -561,14 +561,7 @@
 
 parse.cc : parse.y
        @echo "expect 14 shift/reduce conflicts"
-       $(YACC) $(YFLAGS) $<
-       @if [ -s y.tab.c ]; then \
-         mv y.tab.c $(@F); \
-       else \
-         echo "y.tab.c is empty!" 1>&2; \
-         rm -f y.tab.c; \
-         exit 1; \
-       fi
+       $(YACC) $(YFLAGS) -o $@ $<
 
 lex.cc : lex.l
        $(LEX) $(LFLAGS) $< > $(@F)-t

reply via email to

[Prev in Thread] Current Thread [Next in Thread]