[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unikraft makefile - how to copy files in Makefile.uk



Hi,

Thanks guys, that's what i was looking for. :)
Seems with build_cmd i can execute cp/mv/ln/.. whatever I desire. Very nice.

Another question: my library likes to do #include <..>, which can conflict with headerfiles of another version of the library installed on the system i build on.
Have you encountered this before? I could change it to #include "..", but that would be a rather clumsy patch, is there a clever way to specify order of include paths?

Thanks for your help so far!

-Felix

On Thu, Jul 9, 2020 at 5:23 PM Simon Kuenzer <simon.kuenzer@xxxxxxxxx> wrote:
Hi Felix,

On 07.07.20, 14:00, "Minios-devel on behalf of Sharan Santhanam" <minios-devel-bounces@xxxxxxxxxxxxxxxxxxxx on behalf of Sharan.Santhanam@xxxxxxxxx> wrote:

    Hello,

    Please find the comment inline:

    On 7/7/20 1:20 PM, felix nasch wrote:
    > Hi,
    >
    > I was hanging out in the IRC channel, but it seems inactive, so I am
    > asking here, hope that's ok. :)
    > I am trying to port a library to Unikraft, and as part of the build process I
    > want to copy around a few files after extracting the source files.
    > This is to solve these two problems:
    >
    > 1. Some source files have the same name (in different dirs), but the
    >      unikraft build system places all .obj files into the root directory, thus
    >      colliding object files overwrite each other.  I want to rename conflicting
    >      files prior to compilation.

    Our approach to solve the problem, has been to resolve name collision
    with a '|' directive. The '|' would prepend the object file with the
    name following the pipe.

    For eg, if you look at the Makefile.uk in plat/kvm/

    LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) +=
    $(UK_PLAT_COMMON_BASE)/x86/trace.c|common

    LIBKVMPLAT_SRCS-$(CONFIG_ARCH_X86_64) += $(LIBKVMPLAT_BASE)/x86/trace.c


    >
    > 2. Include paths - when extracting the source package, the include path is not
    >      how consumers of the library expect it. I would want to create an
    > appropriately
    >      named subdir and move the header files into it.
    >
    > However, I can't figure out how to execute a simple "cp <src> <dest>"
    > in Makefile.uk, since new targets cannot be defined.:

    This is a feature we do not support yet. If you believe the problem is
    very specific to a single library, you can do something like [1].

    [1] https://github.com/unikraft/lib-lua/blob/master/Makefile.uk
    <https://github.com/unikraft/lib-lua/blob/master/Makefile.uk>

This is right, in liblua we created symbolic links of the public library header files as part of the prepare step (ln -s <src> <dest>). You can take Sharan's link as an example. In general, you should make sure that every file generated, copied, or linked should go to the build sub directory of the library (LIBNAME_BUILD). In there you are free to organize your substructure.

    >
    > How can I do that?
    >
    > Thanks,
    > f.
    >

Thanks,

Simon



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.