automake
[Top][All Lists]
Advanced

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

Re: Files used in EXTRA_DIST not working with distcheck


From: Stepan Kasal
Subject: Re: Files used in EXTRA_DIST not working with distcheck
Date: Wed, 17 Aug 2005 18:39:50 +0200
User-agent: Mutt/1.4.1i

Hello,

1) You have to add the "$(srcdir)/" prefix for distributed files.
(In the commands only, make searches the VPATH when looking for
prerequisities.)

2) You should mention cspm.tab.h as a target, not only in CLEANFILES.

3) You should keep BUILT_SOURCES minimal.  BUILT_SOURCES is explained at
        http://sources.redhat.com/automake/automake.html#Sources

4) The rule which calls bison has multiple outputs: you have to be
careful.  See
        http://sources.redhat.com/automake/automake.html#Multiple-Outputs
for a detailed discussion.

I edited the example you posted:
---- Makefile.am:
EXTRA_DIST = cspm.lex cspm.y

if DO_CSPT
bin_PROGRAMS = cspt
cspt_CXXFLAGS = -Wno-deprecated -DYYDEBUG=1 -include iostream.h
cspt_SOURCES = ParseNode.cc ParseNode.h ParseNodes.cc ParseNodes.h \
               Symbols.cc Symbols.h TranContext.cc TranContext.h
nodist_cspt_SOURCES = lex.yy.cc cspm.tab.cc cspm.tab.h
cspt_LDADD = $(LEXLIB)

# A hint is needed so that the header is built early.
BUILT_SOURCES = cspm.tab.h

lex.yy.cc: cspm.lex cspm.tab.cc ParseNode.h
        $(LEX) -+ -o$@ $(srcdir)/cspm.lex
        grep -v "class istream" lex.yy.cc > lex.yy.tmp  # get rid of "class 
istream"
        /bin/rm lex.yy.cc
        /bin/mv lex.yy.tmp lex.yy.cc

cspm.tab.h cspm.tab.cc: cspm.y ParseNodes.h Symbols.h
        bison -v -d $(srcdir)/cspm.y
        mv cspm.tab.c cspm.tab.cc
cspm.tab.cc: cspm.tab.h

CLEANFILES = $(nodist_cspt_SOURCES) cspm.output
endif
------

And here is the diff which shows what I changed:
--- old 2005-08-17 18:35:46.935434937 +0200
+++ new 2005-08-17 18:37:40.258692942 +0200
@@ -7,8 +7,10 @@
                Symbols.cc Symbols.h TranContext.cc TranContext.h
-nodist_cspt_SOURCES = lex.yy.cc cspm.tab.cc
-BUILT_SOURCES = lex.yy.cc cspm.tab.cc
+nodist_cspt_SOURCES = lex.yy.cc cspm.tab.cc cspm.tab.h
 cspt_LDADD = $(LEXLIB)
 
+# A hint is needed so that the header is built early.
+BUILT_SOURCES = cspm.tab.h
+
 lex.yy.cc: cspm.lex cspm.tab.cc ParseNode.h
-        $(LEX) -+ -o$@ cspm.lex
+        $(LEX) -+ -o$@ $(srcdir)/cspm.lex
         grep -v "class istream" lex.yy.cc > lex.yy.tmp  # get rid of "class 
istream"
@@ -17,7 +19,8 @@
 
-cspm.tab.cc: cspm.y ParseNodes.h Symbols.h
-        bison -v -d cspm.y
+cspm.tab.h cspm.tab.cc: cspm.y ParseNodes.h Symbols.h
+        bison -v -d $(srcdir)/cspm.y
         mv cspm.tab.c cspm.tab.cc
+cspm.tab.cc: cspm.tab.h
 
-CLEANFILES = lex.yy.cc cspm.output cspm.tab.cc cspm.tab.h
+CLEANFILES = $(nodist_cspt_SOURCES) cspm.output
 endif

Have a nice day,
        Stepan Kasal




reply via email to

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