Automake: How to add a building step?

I currently have a build chain fully managed by automake, for example:

.vala > .c > .o > .exe

      

I would like to add a new step to preprocess the .ui XML file in the 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 appears 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 be simplified.

Do you have any other idea?

+2


a source to share


1 answer


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 definition XSLTPROC

AC_SUBST

(or even better, AC_ARG_VAR

) in configure.ac

.

+4


a source







All Articles