On 12/01/18 18:38, 'fishy' via Machinekit wrote:
okay I have made a huge terrible hack that seems to work for kinematics comp of genserkins out of tree but someone needs to add command line args to comp to scan filelist to add extra %s-objs and search in machinekit tree for paths etc..


add in the following code


    print >>f, "obj-m += %s " % objname
    nname=os.path.basename(os.path.splitext(filename)[0] )
    print >>f, "%s-objs := %s " % (nname, objname)
    print >>f, "%s-objs += machinekit/src/libnml/posemath/gomath.o "% nname
    print >>f, "%s-objs += machinekit/src/libnml/posemath/sincos.o "% nname
    print >>f, " "

    print >>f, "include %s" % find_modinc()

    print >>f, "$(RTLIBDIR)/%s$(MODULE_EXT): $(addprefix $(OBJDIR)/,$(%s-objs))" % (nname,nname)



I may get time to do this over weekend unless someone else has better idea or more free time?, comments/advice/ideas..............


Unfortunately that is not a tenable method for general use.
Comp is a pre-processor to allow the writing of fairly simple components in psuedo-code, without any in depth knowledge of C.
It can be used to compile other code, but that is not its purpose

Anyway comp already has the provision to specify extra compile args and extra link args, they just aren't documented.
https://github.com/machinekit/machinekit/blob/master/src/hal/utils/comp.g#L658

I submitted a patch for this before I joined Machinekit, but even Linuxcnc only documents the 'extra_link_args' option.
http://linuxcnc.org/docs/html/hal/comp.html#_options
Need to update our docs I suppose :)

What you are doing is creating a mini Makefile within the comp build, when what you should really be doing, is as Charles first suggested,
is just simply change the existing Makefile and Submakefile to build your module in the source tree.

At every instance where you find genserkins, copy it and substitute your own kins name - nothing magic about it

https://github.com/machinekit/machinekit/blob/master/src/emc/kinematics/Submakefile#L3
https://github.com/machinekit/machinekit/blob/master/src/emc/kinematics/Submakefile#L22
https://github.com/machinekit/machinekit/blob/master/src/Makefile#L504
https://github.com/machinekit/machinekit/blob/master/src/Makefile#L1581
https://github.com/machinekit/machinekit/blob/master/src/Makefile#L1897

If the real problem is that your platform is incapable of building Machinekit from sources due to processor and memory shortcomings,
that is a different matter.

If you don't want to use a more capable platform, you can either use your hacked comp, script the steps to build as you have done just using gcc
or longer term perhaps become familiar with chroot / Docker / VM builds and build whatever component on a proper computer then copy to your platform.

If you can convince us there is any general merit to your '..kins' component, it could even be added to the source code and get built into packages for all to use.

regards

regards

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to