开发者

Automake: How to add a building step?

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 approa开发者_StackOverflow中文版ch will break.

Have you another idea?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜