title: Create data file by Automake
body: <p>I want Automake to create an .img file in my hobby project (to test the compiled program in a virtual machine).</p>
  
  <p>I can use Automake to compile programs, eg.:</p>
  
  <pre><code>noinst_PROGRAMS = loader.elf
  
  loader_elf_SOURCES = init.s console.c disk.c elf.c ext2.c fat.c lib.c loader.c multiboot.c
  loader_elf_LDFLAGS = $(AM_LDFLAGS) -T $(srcdir)/loader.ld
  loader_elf_LDADD = $(LDADD) -lgcc
  
  </code></pre>
  
  <p>But it doesn't work for data files:</p>
  
  <pre><code>noinst_DATA = x.img
  x_img_DEPENDENCIES = loader.elf
  x_img_LINK = makeimg.sh
  </code></pre>
  
  <p>When I execute <em>autoreconf -i</em> then I get this error message:</p>
  
  <pre><code>automake: warnings are treated as errors
  arch/i386/emulator/Makefile.am:14: warning: variable 'x_img_DEPENDENCIES' is defined but no program or
  arch/i386/emulator/Makefile.am:14: library has 'x_img' as canonical name (possible typo)
  autoreconf: automake failed with exit status: 1
  </code></pre>
  
  <p>I'm trying to turn my Makefile into Makefile.am. It was as simle in Makefile as:</p>
  
  <pre><code>x.img: loader.elf
      makeimg.sh $@ $&lt;
  </code></pre>
  
  <p>I studied the Automake manual at the gnu ftp page, and I think there is no possibility to add sources or dependencies to a DATA file in Automake. What should I do? Should I put the .img file into the PROGRAMS primary instead of DATA?</p>
  
  <p>I'm using Automake 1.16.1 and Autoconf 2.69 (if that matters).</p>