automake: Suffixes

1 
1 18.2 Handling new file extensions
1 =================================
1 
1 It is sometimes useful to introduce a new implicit rule to handle a file
1 type that Automake does not know about.
1 
1    For instance, suppose you had a compiler that could compile ‘.foo’
1 files to ‘.o’ files.  You would simply define a suffix rule for your
1 language:
1 
1      .foo.o:
1              foocc -c -o $@ $<
1 
1    Then you could directly use a ‘.foo’ file in a ‘_SOURCES’ variable
1 and expect the correct results:
1 
1      bin_PROGRAMS = doit
1      doit_SOURCES = doit.foo
1 
1    This was the simpler and more common case.  In other cases, you will
1 have to help Automake to figure out which extensions you are defining
1 your suffix rule for.  This usually happens when your extension does not
1 start with a dot.  Then, all you have to do is to put a list of new
1 suffixes in the ‘SUFFIXES’ variable *before* you define your implicit
1 rule.
1 
1    For instance, the following definition prevents Automake from
1 misinterpreting the ‘.idlC.cpp:’ rule as an attempt to transform ‘.idlC’
1 files into ‘.cpp’ files.
1 
1      SUFFIXES = .idl C.cpp
1      .idlC.cpp:
1              # whatever
1 
1    As you may have noted, the ‘SUFFIXES’ variable behaves like the
1 ‘.SUFFIXES’ special target of ‘make’.  You should not touch ‘.SUFFIXES’
1 yourself, but use ‘SUFFIXES’ instead and let Automake generate the
1 suffix list for ‘.SUFFIXES’.  Any given ‘SUFFIXES’ go at the start of
1 the generated suffixes list, followed by Automake generated suffixes not
1 already in the list.
1