views:

53

answers:

1

Hello,

Currently, I have a build chain, completly manage by automake, like:

.vala > .c > .o > .exe

I would like add a new step for preprocess a XML file .ui into a vala source:

.ui > .vala > .c > .o > .exe

I did this, in makefile.am

gtkbuilder2vala_SOURCES = \
    abstract-window.ui \
    main.vala \
    $(NULL)

And:

XSLTPROC = xsltproc
.ui.vala:
    $(XSLTPROC) ...

But make don't understand:

make: *** No rule to make target `abstract-window.c', needed by `gtkbuilder2vala-abstract-window.o'.  Stop.

This seems to be a limitation of make:

http://www.ensta.fr/~diam/dev/online/autoconf/autobook/autobook_180.html

if the translation takes three steps--from .m' to.x', then from .x' to.c', and finally to `.o'---then Automake's simplistic approach will break.

Have you another idea?

+3  A: 

I would do something along these lines

BUILT_SOURCES += abstract-window.vala
EXTRA_DIST += abstract-window.ui
gtkbuilder2vala_SOURCES += abstract-window.vala

SUFFIXES = .ui .vala
.ui.vala:
    $(XSLTPROC) ...

I would leave the XSLTPROC definition to an AC_SUBST (or even better, an AC_ARG_VAR) in configure.ac.

ndim

related questions