manpagez: man pages & more
info automake
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Build ‘bindir.c’, not ‘bindir.h’.

Another attractive idea is to define bindir as a variable or function exported from ‘bindir.o’, and build ‘bindir.c’ instead of ‘bindir.h’.

 
noinst_PROGRAMS = foo
foo_SOURCES = foo.c bindir.h
nodist_foo_SOURCES = bindir.c
CLEANFILES = bindir.c
bindir.c: Makefile
        echo 'const char bindir[] = "$(bindir)";' >$@

bindir.h’ contains just the variable's declaration and doesn't need to be built, so it won't cause any trouble. ‘bindir.o’ is always dependent on ‘bindir.c’, so ‘bindir.c’ will get built first.


© manpagez.com 2000-2024
Individual documents may contain additional copyright information.