Hello,
I'm trying to get automake to set a compiler flag when compiling a
specific binary. My Makefile.am looks (in part) like this:
------------
CFLAGS = -W -Wall -ansi -pedantic -g
[...]
bin_PROGRAMS = ctops-gui gen_gui_data
gen_gui_data_SOURCES = \
gen_gui_data.c \
[...]
ctops_gui_SOURCES = \
main.c \
[...]
gui_data.c gui_data.h : gen_gui_data
./gen_gui_data
gen_gui_data_CFLAGS = -DCODE_GENERATOR
[...]
------------
Well, this just doesn't work. The -DCODE_GENERATOR option isn't set
when compiling the sources for gen_gui_data. I looked at the resulting
Makefile, and sure enough at some point it contains the line
gen_gui_data_CFLAGS = -DCODE_GENERATOR
but the gen_gui_data_CFLAGS variable isn't used at any point.
Says the Autotools doc:
--------------
Automake allows you to set compilation flags on a per-program (or
per-library) basis.
[...]
These per-target compilation flags are [...] _CFLAGS,
[...]
-------------
So why doesn't it work? I tried it in both versions 1.4-p6 and 1.9.5.
The situation is the same if I use CPPFLAGS insead of CFLAGS.
Thanks,
--Daniel
--
[EMAIL PROTECTED]