[Buildroot] LIBFOO_SITE in .mk file

Thomas De Schampheleire patrickdepinguin+buildroot at gmail.com
Wed Nov 30 19:44:22 UTC 2011


Hi,

On Wed, Nov 30, 2011 at 7:11 PM, Jeff Krasky <jeff.krasky at dspcg.com> wrote:
>> * create one .mk file, with one set of build rules, that combine the
>> build steps for the application and for the kernel.
>
> I'll try this one first.  Here is the latest EtherCAT.mk:
>
> #############################################################
> #
> # EtherCAT
> #
> #############################################################
> ETHERCAT_VERSION = 1.0
> ETHERCAT_SOURCE = etherlabmaster-1.0.tar.bz2
> ###ETHERCAT_SITE = file:///home/user1/Desktop/EtherCAT4Atmel/
> ETHERCAT_SITE = http://127.0.0.1/home/user1/Desktop/EtherCAT4Atmel/
> ETHERCAT_INSTALL_STAGING = YES
> ETHERCAT_INSTALL_TARGET = YES
> ETHERCAT_CONF_OPT = --enable-generic
> ETHERCAT_DEPENDENCIES = linux
> ETHERCAT_INSTALL_MOD_DIR = ethercat
> #####ETHERCAT_INSTALL_MOD_PATH
>
> define ETHERCAT_BUILD_CMDS
>       $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) M=$(@D) modules
> endef
>
> define ETHERCAT_INSTALL_TARGET_CMDS
>       $(MAKE) $(LINUX26_MAKE_FLAGS) -C $(LINUX26_DIR) M=$(@D) \
>               INSTALL_MOD_STRIP=1 \
>               INSTALL_MOD_DIR=$(ETHERCAT_INSTALL_MOD_DIR) \
>               modules_install
> endef
>
> define ETHERCAT_UNINSTALL_TARGET_CMDS
>       rm -rf
> $(TARGET_DIR)/lib/modules/$(LINUX26_VERSION_PROBED)/$(ETHERCAT_INSTALL_MOD_D
> IR)
> endef
>
> $(eval $(call GENTARGETS))
>
> #####$(eval $(call AUTOTARGETS,package,ethercat))

You do realize that these rules are purely intended for the module, right.

Based on what ThomasP says, things may be a little more complicated
than I originally thought.

>
>
>> Do keep in mind that in previous
>> versions of buildroot, the LINUX_ prefix was called LINUX26_, so for
>> example LINUX_MAKE_FLAGS needs to be renamed to LINUX26_MAKE_FLAGS,
>> likewise with LINUX_DIR.
>
> Thanks.  I changed them, but I left
>
> ETHERCAT_DEPENDENCIES = linux
>
> as just "linux".  Should it be "linux26"?  The build is going on now, but it
> takes a while, so if it should be "linux26" can you tell me (or if anything
> else is wrong in .mk) so I can stop the build and fix it?

In buildroot 2010.05, it was possible to use both linux as linux26, so
you should be fine.

>
>> If you still have questions, I suggest you provide us with your
>> current.mk file and the problems (e.g. build errors) you still
>> experience with it.
>
> I'll see how this latest build goes, but I think the result needs to be that
>
>
> /lib/modules/2.6.33
>
> needs to have an 'ethercat' subdirectory containing ec_master.ko, among
> other files.  So far, no build has done this.

Just checking: you are looking into output/target/lib/modules or
/lib/modules on the target right, not /lib/modules on the host?
If the modules_install step in your .mk file goes well, this should
put the file there.
Seeing the build log of that part should hint you what is wrong, if anything.

>
> Thanks so much, time is short and this is really helping.
>



More information about the buildroot mailing list