How can I tell lib/Makefile.am
to produce non-.o
targets out of certain input files (here .txt
) and tell it to do this before compiling regular C source files?
Background: I have a bunch of text files (.txt
) as input along with other C source files. I would like to process them with xxd
to produce an C array initializer list which gets included by one of the C source files. Thus, text file processing should happen before compiling .c
files.
In the C file I would include the processed .inc
file:
#include "data.inc"
I get this far:
SUFFIXES = .txt
.txt.$(OBJEXT):
$(XXD) -i $< @top_builddir@/include/$*.inc
The problem is that the makefile assumes a .o
file being generated out of the rule (.txt
--> .o
) which is not what I need. I need to tell it that .inc
is the final form and that it lives in the top_builddir
. What would be the preferred way to do this?