xen-devel
Re: [Xen-devel] Re: [PATCH V5 2/3] libxl: Introduce libxl_internal_types
On Mon, 2011-06-27 at 16:40 +0100, Anthony PERARD wrote:
> On Mon, Jun 27, 2011 at 16:20, Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
> wrote:
> > On Mon, 2011-06-27 at 16:12 +0100, Anthony PERARD wrote:
> >> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> >> ---
> >> tools/libxl/Makefile | 10 +++++++++-
> >> tools/libxl/gentypes.py | 15 ++++++++-------
> >> tools/libxl/libxl_internal.h | 1 +
> >> tools/libxl/libxl_internal_types.idl | 10 ++++++++++
> >
> > Do you not need to update .hgignore?
>
> I don't use mercurial! :)
> But no, the file generated will be catch by:
> ^tools/libxl/_.*\.h$
>
> >> 4 files changed, 28 insertions(+), 8 deletions(-)
> >> create mode 100644 tools/libxl/libxl_internal_types.idl
> >>
> >> diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
> >> index bfe9c58..f148ad3 100644
> >> --- a/tools/libxl/Makefile
> >> +++ b/tools/libxl/Makefile
> >> @@ -35,7 +35,7 @@ LIBXL_OBJS-$(CONFIG_IA64) += libxl_nocpuid.o
> >> LIBXL_OBJS = flexarray.o libxl.o libxl_create.o libxl_dm.o libxl_pci.o \
> >> libxl_dom.o libxl_exec.o libxl_xshelp.o
> >> libxl_device.o \
> >> libxl_internal.o libxl_utils.o libxl_uuid.o
> >> $(LIBXL_OBJS-y)
> >> -LIBXL_OBJS += _libxl_types.o libxl_flask.o
> >> +LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_internal_types.o
> >>
> >> $(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
> >> $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl)
> >>
> >> @@ -79,14 +79,22 @@ _libxl_paths.h: genpath
> >> libxl_paths.c: _libxl_paths.h
> >>
> >> libxl.h: _libxl_types.h
> >> +libxl_internal.h: _libxl_internal_types.h
> >>
> >> $(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS): libxl.h
> >> +$(LIBXL_OBJS): libxl_internal.h
> >>
> >> _libxl_%.h _libxl_%.c: libxl.idl gen%.py libxl%.py
> >> $(PYTHON) gen$*.py libxl.idl __libxl_$*.h __libxl_$*.c
> >
> > If you simply s/gen$*.py/gentypes.py/ and s/libxl.idl/libxl$*.idl/g and
> > leave the other patterns does this rule work for both IDL files?
>
> Yes, it's works, with a `mv libxl.idl libxl_types.idl`.
Can you incorporate the _types into the rule itself or does make not
allow for % to match zero-characters?
> I thought this rules was used by something else.
No it's just used once. The reason it is currently a pattern rule is to
work around make which will run a rule with multiple targets multiple
times _unless_ it is a pattern rule. e.g.
A B: C
DO SOMETHING
will "DO SOMETHING" twice, rather than once.
Using a pattern rule is something of a hack. Another option might be to
artificially split the multi pattern rule, e.g. do something like
_libxl_xxx.c: _libxl_xxx.h
_libxl_xxx.h: libxl.idl etc etc
genwrap.py ... etc etc
mv ...
At first I thought the better way was your use of .NOTPARALLEL but
actually it is probably still running the rule multiple times for no
reason and you have just worked around the problem with multiple
parallel invocations of the mv's.
>
> >> mv __libxl_$*.h _libxl_$*.h
> >> mv __libxl_$*.c _libxl_$*.c
> >>
> >> +.NOTPARALLEL: _libxl_internal_types.h _libxl_internal_types.c
> >
> > I'd been wondering how to do that!
>
> Better than a -j1, first time I use it but seams to work fine.
>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
|
|