Menu

Ignoring autogenerated header?

Help
2008-06-28
2013-03-15
  • Henrik Goldman

    Henrik Goldman - 2008-06-28

    I have a very classic situation that *should* be easy to solve... but apparently not so easily described in the manual:

    Assume you have a auto-generated header file that comes with the svn tag. Then I obviously want to ignore that it gets updated every time I do a svn commit. Currently the build takes up to 5 minutes longer without a good reason because files are unnecessarily being updated.

    My build-rule looks like:

    svnrevision.h:
    cp svnrevision.h.template svnrevision.h
    &template -d REV=$(shell svnversion -n $(TOP)) -o +<svnrevision.h

    From the manual it said that I should either write my own signature method or use one of the build check methods like: only_action or ignore_action.
    However I had limited success with these.

    How can I get this file ignore altogether so it only gets created if it doesn't exist? This will save unnecesary rebuilds of other files.

    Thanks.

    -- Henrik

     
    • Daniel Pfeiffer

      Daniel Pfeiffer - 2008-06-28

      Hi Henrik,

      I don't know svn, to understand why you check in a file, if you don't change it.  Nor do I understand, why you copy and then edit inplace.  This does what I understood you want, namely build only if the svnversion output changes:

      svnrevision.h: svnrevision.template.h :build_check only_action
              &template -d REV=$(shell svnversion -n $(TOP)) $(input) -o $(output)

      ignore_action does just the opposite, look at the input but not the svnversion output.

      best regards
      Daniel

       
      • Henrik Goldman

        Henrik Goldman - 2008-06-29

        Svn commits are atomic over the entire change and not on a per-file basis like in cvs. Compared with cvs it's almost identical except that a commit marks the entire tree with the specific revision.

        The template I have is auto-generating the header file. It looks like:

        #ifndef SVN_REVISION_H
        #define SVN_REVISION_H

        #define SVN_REVISION_STR "@REV@"

        #endif /* SVN_REVISION_H */

        Then the REV tag gets replaced with something real.
        I'll try your suggestion.

         
        • Henrik Goldman

          Henrik Goldman - 2008-07-03

          Unfortunate the suggestion didn't help. The behavior is the same as before with a new re-compile every time svn gets updated. Could this be a bug or did I just misunderstand it? Essentially I just want the header file to be ignore completely. Maybe if I wrap it as a system include like "#include <file.h>" it would make makepp to ignore it?

          Thanks.

           
          • Daniel Pfeiffer

            Daniel Pfeiffer - 2008-07-05

            Hi Henrik!

            what didn't help?  Show me the code!  If you ignore_action on the rule to make the include file, then it won't be remade, unless you actually change the template.  I tried both variants from my above reply, and they both do what I said.

            As for pretending it's a system include, that's dirty, but it should also work.

            regards
            Daniel

            PS: are you progressing with the close-after-each-open patch, to solve your Windows problems?

             
            • Henrik Goldman

              Henrik Goldman - 2008-07-05

              Essentially the target continues to rebuild each time there is a commit to SVN.

              The code in question looks like:

              svnrevision.h: svnrevision.h.template : build_check only_action
              cp svnrevision.h.template svnrevision.h
              &template -d REV=$(shell svnversion -n $(TOP)) -o +<svnrevision.h

              Perhaps the problem is that I'm using the template command?

              As for the Windows filelocking problem I think I found out how to get around it. The actual problem wasn't makepp but most likely TortoiseSVN which equally locks files at it's own will. The problems where showing up whenever we would copy directories that included .svn subdirs. Thus we wrote a copy function that ignores the .svn dirs. Thus the new directories won't be locked when we try to delete them and everyone is happy. So far we have not seen a single file locking issue for the past 2-3 weeks. Before they were happening more often. So I don't think any further patching will be needed as the actual problem wasn't makepp.

               
              • Daniel Pfeiffer

                Daniel Pfeiffer - 2008-07-05

                No, you're using only_action when it sounds like you want ignore_action.  This _should_ do what you want, namely rebuild only when the template file changes:

                svnrevision.h: svnrevision.h.template : build_check ignore_action
                    &template -d REV=$(shell svnversion -n $(TOP)) $(input) -o $(output)

                best regards
                Daniel

                PS: glad to hear makepp wasn't the cause of those Windoze problems ;-)

                 
                • Nobody/Anonymous

                  Yes it looks like it solved it. I see far less rebuilds now.

                   

Log in to post a comment.