[Cook] looking at ways to exclude files from compilation

Pendergraft, Jerry JPendergraft at sjm.com
Wed Dec 29 16:49:27 EST 2010


Perhaps something like:
  sources =
 sources = [stripdot
                   [collect find . –type f –name ‘*.c’                             print]]];
Then do:
 manifest = [filter_out %0%_32.c [sources]];
You are correct that you can't pass 2 patterns to the same filter_out, but you don't need a loop, just nest the 2 ala:
 manifest = [filter_out %0%_32.c
               [filter_out %0%_16.c
                  [sources]]];

OR you could do the filtering in the collect command ala:
 manifest = [stripdot
              [collect find . -type f -name '*.c' -print
                 | egrep -v 'scan_(16|32).c']];

________________________________
From: cook-users-bounces+jpendergraft=sjm.com at lists.auug.org.au [cook-users-bounces+jpendergraft=sjm.com at lists.auug.org.au] on behalf of Henderson, Michael D [michael.d.henderson at lmco.com]
Sent: Tuesday, December 28, 2010 4:45 PM
To: cook-users at lists.auug.org.au
Subject: [Cook] looking at ways to exclude files from compilation

I have a project that includes files from a vendor that are used to build a library. I put those files into a directory called “vendlib”. I have been using a manifest to find the .c files in that directory and compile them into the library.

That’s been working well but now I need to break it. We’re now receiving files from the vendor that have names like “scan_16.c” and “scan_32.c” and “scan_64.c”. I don’t want to compile the *_32.c files but want the *_16 and *_64.c files.

I can hardwire the bit in the cook file that builds the manifest to ignore those files. I tried something like:
  manifest = [filter_out %0%_32.c
               [stripdot
                 [collect find . –type f –name ‘*.c’ print]]];

It works but I’m trying to keep that part of the cook file generic since it’s included in many projects. I would like something like

  if [filterFile] then
    manifest = [filter_out [filterFile]
                 [stripdot
                   [collect find . –type f –name ‘*.c’ print]]];
  else
    manifest = [stripdot
                 [collect find . –type f –name ‘*.c’ print]];

So, now that that’s working, I’m wondering “so what to do when I need to filter out *_32.c and *_16.c”? I don’t see a way to pass two patterns to filter on without going through a loop

  manifest [stripdot [collect find . –type f –name ‘*.c’ print]];
  loop local aFilter = [filterFile] {
    manifest = [filter_out [aFile] [manifest]];
  }

Is there a better way to handle that?

Thanks,
Michael D Henderson
   no problem is too big if you don't have to solve all of it



This communication, including any attachments, may contain information that is proprietary, privileged, confidential or legally exempt from disclosure. If you are not a named addressee, you are hereby notified that you are not authorized to read, print, retain a copy of or disseminate any portion of this communication without the consent of the sender and that doing so may be unlawful. If you have received this communication in error, please immediately notify the sender via return e-mail and delete it from your system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.auug.org.au/pipermail/cook-users/attachments/20101229/672dbc3b/attachment.html>


More information about the Cook-users mailing list