diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..3ab1994a5d963b2e45f8a7cea77ea5a93ceef308 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,91 @@ +#------------------------------------------------------------------------------ +# +# Makefile.am +# +# IgH EtherCAT master +# +# $Id$ +# +# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH +# +# This file is part of the IgH EtherCAT Master. +# +# The IgH EtherCAT Master is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The IgH EtherCAT Master is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the IgH EtherCAT Master; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# The right to use EtherCAT Technology is granted and comes free of +# charge under condition of compatibility of product made by +# Licensee. People intending to distribute/sell products based on the +# code, have to sign an agreement to guarantee that products using +# software based on IgH EtherCAT master stay compatible with the actual +# EtherCAT specification (which are released themselves as an open +# standard) as the (only) precondition to have the right to use EtherCAT +# Technology, IP and trade marks. +# +#------------------------------------------------------------------------------ + +SUBDIRS = master/ devices/ + +initdir = $(sysconfdir)/init.d +sysdir = $(sysconfdir)/sysconfig + +include_HEADERS = include/ecdb.h include/ecrt.h +noinst_SCRIPTS = script/lsec.pl script/ethercat.sh script/sysconfig + +MINI_FILES = \ + examples/mini/Kbuild \ + examples/mini/Makefile.am \ + examples/mini/Makefile.in \ + examples/mini/mini.c + +RTAI_FILES = \ + examples/rtai/Kbuild \ + examples/rtai/Makefile.am \ + examples/rtai/Makefile.in \ + examples/rtai/rtai_sample.c + +MSR_FILES = \ + examples/msr/Kbuild \ + examples/msr/libm.o_shipped \ + examples/msr/Makefile.am \ + examples/msr/Makefile.in \ + examples/msr/msr_load \ + examples/msr/msr_param.h \ + examples/msr/msr_sample.c \ + examples/msr/msrserv.pl \ + examples/msr/msr_unload + +EXTRA_DIST = $(noinst_SCRIPTS) $(MINI_FILES) $(RTAI_FILES) $(MSR_FILES) + +install-data-local: + $(mkinstalldirs) $(bindir) + $(mkinstalldirs) $(initdir) + $(mkinstalldirs) $(sysdir) + $(INSTALL_SCRIPT) $(srcdir)/script/lsec.pl $(bindir)/lsec + $(INSTALL_SCRIPT) $(srcdir)/script/ethercat.sh $(initdir)/ethercat + $(INSTALL_DATA) $(srcdir)/script/sysconfig $(sysdir)/ethercat + +uninstall-local: + rm -rf $(LINUX_MODULES_DIR)/ethercat + rm $(bindir)/lsec + rm $(initdir)/ethercat + rm $(sysdir)/ethercat + +doc: + doxygen Doxyfile + +cleandoc: + @rm -rf documentation + +#------------------------------------------------------------------------------ diff --git a/devices/Makefile b/devices/Kbuild similarity index 71% rename from devices/Makefile rename to devices/Kbuild index eac889ad84fa1268f550a95a14b989d12607a9bc..edad4e7ae8ad9c2b3c823fcb84cce634704f1c77 100644 --- a/devices/Makefile +++ b/devices/Kbuild @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Makefile +# Kbuild # # IgH EtherCAT master device modules # @@ -35,11 +35,6 @@ # #------------------------------------------------------------------------------ -#------------------------------------------------------------------------------ -# kbuild section - -ifneq ($(KERNELRELEASE),) - obj-m := ec_8139too.o ec_8139too-objs := 8139too.o @@ -49,33 +44,3 @@ REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown") EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER) #------------------------------------------------------------------------------ -# default section - -else - -ifneq ($(wildcard ../ethercat.conf),) -include ../ethercat.conf -else -KERNEL := $(shell uname -r) -endif - -KERNEL_DIR := /lib/modules/$(KERNEL)/build -CURRENT_DIR := $(shell pwd) -INSTALL_MOD_DIR := ethercat/devices - -modules: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules - -install: modules_install - -modules_install: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \ - INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install - -clean: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean - @rm -f Modules.symvers - -#------------------------------------------------------------------------------ - -endif diff --git a/devices/Makefile.am b/devices/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..8008898d308f3ba5c7312f785e8185df928b1a0f --- /dev/null +++ b/devices/Makefile.am @@ -0,0 +1,56 @@ +#------------------------------------------------------------------------------ +# +# Makefile.am +# +# IgH EtherCAT master module +# +# $Id: Makefile 545 2006-09-19 13:28:40Z fp $ +# +# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH +# +# This file is part of the IgH EtherCAT Master. +# +# The IgH EtherCAT Master is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The IgH EtherCAT Master is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the IgH EtherCAT Master; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# The right to use EtherCAT Technology is granted and comes free of +# charge under condition of compatibility of product made by +# Licensee. People intending to distribute/sell products based on the +# code, have to sign an agreement to guarantee that products using +# software based on IgH EtherCAT master stay compatible with the actual +# EtherCAT specification (which are released themselves as an open +# standard) as the (only) precondition to have the right to use EtherCAT +# Technology, IP and trade marks. +# +#------------------------------------------------------------------------------ + +EXTRA_DIST = \ + Kbuild \ + ecdev.h \ + 8139too.c \ + original_8139too.c + +ABSSRCDIR = `cd $(srcdir) && pwd -P` + +all: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + +clean-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + +install-data-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + INSTALL_MOD_DIR="ethercat" modules_install + +#------------------------------------------------------------------------------ diff --git a/ethercat.conf.tmpl b/ethercat.conf.tmpl deleted file mode 100644 index 5ce7e6ad28355a0883f2290bd3a17f8b37452cf0..0000000000000000000000000000000000000000 --- a/ethercat.conf.tmpl +++ /dev/null @@ -1,17 +0,0 @@ -#------------------------------------------------------------------------------ -# -# EtherCAT configuration file -# -# $Id$ -# -# This file is a versioned template configuration. Copy it to "ethercat.conf" -# (which is ignored by Subversion) and adjust it to your needs. -# -#------------------------------------------------------------------------------ - -# -# The kernel to compile the EtherCAT sources against -# -KERNEL := $(shell uname -r) - -#------------------------------------------------------------------------------ diff --git a/examples/mini/Makefile b/examples/mini/Kbuild similarity index 69% rename from examples/mini/Makefile rename to examples/mini/Kbuild index c9131015c41a912a47c281c38658be2d84cdd6ce..6162938cbc2d3747de5bb2767984be905b14d1a5 100644 --- a/examples/mini/Makefile +++ b/examples/mini/Kbuild @@ -1,8 +1,6 @@ -#---------------------------------------------------------------- +#------------------------------------------------------------------------------ # -# Makefile -# -# Minimal EtherCAT module. +# Kbuild # # $Id$ # @@ -33,40 +31,10 @@ # standard) as the (only) precondition to have the right to use EtherCAT # Technology, IP and trade marks. # -#---------------------------------------------------------------- - -ifneq ($(KERNELRELEASE),) - -#---------------------------------------------------------------- -# kbuild section -#---------------------------------------------------------------- +#------------------------------------------------------------------------------ obj-m := ec_mini.o ec_mini-objs := mini.o -#---------------------------------------------------------------- - -else - -#---------------------------------------------------------------- -# default section -#---------------------------------------------------------------- - -ifneq ($(wildcard kernel.conf),) -include kernel.conf -else -KERNEL_DIR := /lib/modules/$(shell uname -r)/build -endif - -CURRENT_DIR := $(shell pwd) - -modules: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) - -clean: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean - -#---------------------------------------------------------------- - -endif +#------------------------------------------------------------------------------ diff --git a/examples/mini/Makefile.am b/examples/mini/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..c34279555a757343efe91d3d4e4967307d348b13 --- /dev/null +++ b/examples/mini/Makefile.am @@ -0,0 +1,50 @@ +#------------------------------------------------------------------------------ +# +# Makefile.am +# +# IgH EtherCAT master module +# +# $Id$ +# +# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH +# +# This file is part of the IgH EtherCAT Master. +# +# The IgH EtherCAT Master is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The IgH EtherCAT Master is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the IgH EtherCAT Master; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# The right to use EtherCAT Technology is granted and comes free of +# charge under condition of compatibility of product made by +# Licensee. People intending to distribute/sell products based on the +# code, have to sign an agreement to guarantee that products using +# software based on IgH EtherCAT master stay compatible with the actual +# EtherCAT specification (which are released themselves as an open +# standard) as the (only) precondition to have the right to use EtherCAT +# Technology, IP and trade marks. +# +#------------------------------------------------------------------------------ + +ABSSRCDIR = `cd $(srcdir) && pwd -P` + +all: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + +clean-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + +install-data-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + INSTALL_MOD_DIR="ethercat" modules_install + +#------------------------------------------------------------------------------ diff --git a/examples/mini/kernel.conf.tmpl b/examples/mini/kernel.conf.tmpl deleted file mode 100644 index 9a0ac0497e978579a748b02069621a67dabb2ea1..0000000000000000000000000000000000000000 --- a/examples/mini/kernel.conf.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Kernel configuration file for EtherCAT mini sample -# -# $Id$ -# -# This file is a versioned template configuration. Copy it to "kernel.conf" -# (which is ignored by Subversion) and adjust it to your needs. -# -#------------------------------------------------------------------------------ - -KERNELDIR := /lib/modules/$(shell uname -r)/build diff --git a/examples/msr/Kbuild b/examples/msr/Kbuild new file mode 100644 index 0000000000000000000000000000000000000000..c62652c7aed8ed6d09316b713c7f47d80049b289 --- /dev/null +++ b/examples/msr/Kbuild @@ -0,0 +1,58 @@ +#------------------------------------------------------------------------------ +# +# Kbuild +# +# $Id$ +# +# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH +# +# This file is part of the IgH EtherCAT Master. +# +# The IgH EtherCAT Master is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The IgH EtherCAT Master is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the IgH EtherCAT Master; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# The right to use EtherCAT Technology is granted and comes free of +# charge under condition of compatibility of product made by +# Licensee. People intending to distribute/sell products based on the +# code, have to sign an agreement to guarantee that products using +# software based on IgH EtherCAT master stay compatible with the actual +# EtherCAT specification (which are released themselves as an open +# standard) as the (only) precondition to have the right to use EtherCAT +# Technology, IP and trade marks. +# +#------------------------------------------------------------------------------ + +MODULE := ec_msr_sample + +obj-m := $(MODULE).o + +$(MODULE)-objs := msr_sample.o \ + rt_lib/msr-core/msr_lists.o \ + rt_lib/msr-core/msr_main.o \ + rt_lib/msr-core/msr_charbuf.o \ + rt_lib/msr-core/msr_reg.o \ + rt_lib/msr-core/msr_interpreter.o \ + rt_lib/msr-core/msr_messages.o \ + rt_lib/msr-core/msr_proc.o \ + rt_lib/msr-core/msr_error_reg.o \ + rt_lib/msr-utils/msr_utils.o \ + rt_lib/msr-utils/msr_time.o \ + rt_lib/msr-math/msr_base64.o \ + rt_lib/msr-math/msr_hex_bin.o \ + libm.o + +EXTRA_CFLAGS := -I$(src)/rt_lib/msr-include -I/usr/realtime/include \ + -D_SIMULATION -mhard-float + +#------------------------------------------------------------------------------ diff --git a/examples/msr/Makefile b/examples/msr/Makefile deleted file mode 100644 index d84adf8e3fe9204e03a8e912bba124d8ad905df1..0000000000000000000000000000000000000000 --- a/examples/msr/Makefile +++ /dev/null @@ -1,92 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Makefile -# -# Sample module for use with IgH MSR library. -# -# $Id$ -# -# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH -# -# This file is part of the IgH EtherCAT Master. -# -# The IgH EtherCAT Master is free software; you can redistribute it -# and/or modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 of the -# License, or (at your option) any later version. -# -# The IgH EtherCAT Master is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with the IgH EtherCAT Master; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# The right to use EtherCAT Technology is granted and comes free of -# charge under condition of compatibility of product made by -# Licensee. People intending to distribute/sell products based on the -# code, have to sign an agreement to guarantee that products using -# software based on IgH EtherCAT master stay compatible with the actual -# EtherCAT specification (which are released themselves as an open -# standard) as the (only) precondition to have the right to use EtherCAT -# Technology, IP and trade marks. -# -#------------------------------------------------------------------------------ - -MODULE := ec_msr_sample - -#------------------------------------------------------------------------------ -# kbuild section -#------------------------------------------------------------------------------ - -ifneq ($(KERNELRELEASE),) - -obj-m := $(MODULE).o - -$(MODULE)-objs := msr_sample.o \ - rt_lib/msr-core/msr_lists.o \ - rt_lib/msr-core/msr_main.o \ - rt_lib/msr-core/msr_charbuf.o \ - rt_lib/msr-core/msr_reg.o \ - rt_lib/msr-core/msr_interpreter.o \ - rt_lib/msr-core/msr_messages.o \ - rt_lib/msr-core/msr_proc.o \ - rt_lib/msr-core/msr_error_reg.o \ - rt_lib/msr-utils/msr_utils.o \ - rt_lib/msr-utils/msr_time.o \ - rt_lib/msr-math/msr_base64.o \ - rt_lib/msr-math/msr_hex_bin.o \ - libm.o - -EXTRA_CFLAGS := -I$(src)/rt_lib/msr-include -I/usr/realtime/include \ - -D_SIMULATION -mhard-float - -#------------------------------------------------------------------------------ -# default section -#------------------------------------------------------------------------------ - -else - -ifneq ($(wildcard kernel.conf),) -include kernel.conf -else -KERNEL := $(shell uname -r) -endif - -KERNEL_DIR := /lib/modules/$(KERNEL)/build -CURRENT_DIR := $(shell pwd) - -modules: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) - -clean: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean - -install: - @./install.sh $(MODULE) $(KERNEL) - -endif - -#------------------------------------------------------------------------------ diff --git a/examples/msr/install.sh b/examples/msr/Makefile.am old mode 100755 new mode 100644 similarity index 71% rename from examples/msr/install.sh rename to examples/msr/Makefile.am index 6b438ac0a33d19bc7c734b9f645526a4d667fae0..fb32a16d296a656b4094236d0c0530c57381af02 --- a/examples/msr/install.sh +++ b/examples/msr/Makefile.am @@ -1,8 +1,8 @@ -#!/bin/sh - #------------------------------------------------------------------------------ # -# Realtime module install script +# Makefile.am +# +# IgH EtherCAT master module # # $Id$ # @@ -35,42 +35,23 @@ # #------------------------------------------------------------------------------ -# Fetch parameters - -if [ $# -ne 2 ]; then - echo "Usage: $0 <MODULENAME> <KERNEL>" - exit 1 -fi - -MODULENAME=$1 -KERNEL=$2 - -MODULESDIR=/lib/modules/$KERNEL/kernel/drivers/rt - -echo "Realtime installer" -echo " target: $MODULENAME" -echo " kernel: $KERNEL" - -# Create target directory - -if [ ! -d $MODULESDIR ]; then - echo " creating $MODULESDIR..." - mkdir $MODULESDIR || exit 1 -fi - -# Install files - -echo " installing $MODULENAME..." -if ! cp $MODULENAME.ko $MODULESDIR/$MODULENAME.ko; then exit 1; fi +EXTRA_DIST = \ + Kbuild \ + msr_sample.c msr_param.h \ + libm.o_shipped \ + msr_load msr_unload \ + msrserv.pl -# Calculate dependencies +ABSSRCDIR = `cd $(srcdir) && pwd -P` -echo " building module dependencies..." -depmod +all: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules -# Finish +clean-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean -echo "done." -exit 0 +install-data-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + INSTALL_MOD_DIR="ethercat" modules_install #------------------------------------------------------------------------------ diff --git a/examples/msr/kernel.conf.tmpl b/examples/msr/kernel.conf.tmpl deleted file mode 100644 index 31164da2b9a7a2d4467d8d723ecf74bf145380fe..0000000000000000000000000000000000000000 --- a/examples/msr/kernel.conf.tmpl +++ /dev/null @@ -1,15 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Configuration file for MSR realtime modules -# -# $Id$ -# -# This file is a versioned template configuration. Copy it to "kernel.conf" -# (which is ignored by Subversion) and adjust it to your needs. -# -#------------------------------------------------------------------------------ - -# Kernel sources for module compilation -KERNEL := $(shell uname -r) - -#------------------------------------------------------------------------------ diff --git a/examples/rtai/Makefile b/examples/rtai/Kbuild similarity index 66% rename from examples/rtai/Makefile rename to examples/rtai/Kbuild index 66b5ff82ef66e493a753abcf6f213f38dbb36fae..40b09ceff846f18a855bb3e38d59d11f3c7acfd0 100644 --- a/examples/rtai/Makefile +++ b/examples/rtai/Kbuild @@ -1,8 +1,6 @@ #------------------------------------------------------------------------------ # -# Makefile -# -# RTAI sample module for the IgH EtherCAT master. +# Kbuild # # $Id$ # @@ -35,40 +33,8 @@ # #------------------------------------------------------------------------------ -ifneq ($(KERNELRELEASE),) - -#------------------------------------------------------------------------------ -# kbuild section -#------------------------------------------------------------------------------ - obj-m := ec_rtai_sample.o ec_rtai_sample-objs := rtai_sample.o -EXTRA_CFLAGS := -I/usr/realtime/include -mhard-float - -#------------------------------------------------------------------------------ - -else - #------------------------------------------------------------------------------ -# default section -#------------------------------------------------------------------------------ - -ifneq ($(wildcard kernel.conf),) -include kernel.conf -else -KERNEL_DIR := /lib/modules/$(shell uname -r)/build -endif - -CURRENT_DIR := $(shell pwd) - -modules: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) - -clean: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean - -#------------------------------------------------------------------------------ - -endif diff --git a/Makefile b/examples/rtai/Makefile.am similarity index 65% rename from Makefile rename to examples/rtai/Makefile.am index 704acd01acc07a2177a788bbfc40d7b3a440b2b3..f00511f3553850619ad3ec5399c5b5a4d770bdcd 100644 --- a/Makefile +++ b/examples/rtai/Makefile.am @@ -1,8 +1,8 @@ #------------------------------------------------------------------------------ # -# Makefile +# Makefile.am # -# IgH EtherCAT master +# IgH EtherCAT master module # # $Id$ # @@ -35,48 +35,18 @@ # #------------------------------------------------------------------------------ -#------------------------------------------------------------------------------ -# kbuild section - -ifneq ($(KERNELRELEASE),) - -obj-m := master/ devices/ - -#------------------------------------------------------------------------------ -# default section - -else +EXTRA_DIST = Kbuild rtai_sample.c -ifneq ($(wildcard ethercat.conf),) -include ethercat.conf -else -KERNEL := $(shell uname -r) -endif +ABSSRCDIR = `cd $(srcdir) && pwd -P` -KERNEL_DIR := /lib/modules/$(KERNEL)/build -CURRENT_DIR := $(shell pwd) -INSTALL_MOD_DIR := ethercat +all: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules -modules: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules +clean-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean -install: modules_install - @script/install.sh $(KERNEL) - -modules_install: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \ - INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install - -clean: cleandoc - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean - @rm -f Modules.symvers - -doc: - doxygen Doxyfile - -cleandoc: - @rm -rf doc +install-data-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + INSTALL_MOD_DIR="ethercat" modules_install #------------------------------------------------------------------------------ - -endif diff --git a/examples/rtai/kernel.conf.tmpl b/examples/rtai/kernel.conf.tmpl deleted file mode 100644 index c5c2cc2f3d1a01edc266b0401a46ebcf06cd4b7e..0000000000000000000000000000000000000000 --- a/examples/rtai/kernel.conf.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -#------------------------------------------------------------------------------ -# -# Kernel configuration file for RTAI sample. -# -# $Id$ -# -# This file is a versioned template configuration. Copy it to "kernel.conf" -# (which is ignored by Subversion) and adjust it to your needs. -# -#------------------------------------------------------------------------------ - -KERNELDIR := /lib/modules/$(shell uname -r)/build diff --git a/master/Makefile b/master/Kbuild similarity index 72% rename from master/Makefile rename to master/Kbuild index ef5d2d2e11f4b2bdcfc5f356bbaee5129c831718..51d18a8ffa934319c189ce49a25b508dbcaeba8d 100644 --- a/master/Makefile +++ b/master/Kbuild @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Makefile +# Kbuild # # IgH EtherCAT master module # @@ -35,11 +35,6 @@ # #------------------------------------------------------------------------------ -#------------------------------------------------------------------------------ -# kbuild section - -ifneq ($(KERNELRELEASE),) - obj-m := ec_master.o ec_master-objs := module.o master.o device.o slave.o datagram.o \ @@ -50,33 +45,3 @@ REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown") EXTRA_CFLAGS := -DSVNREV=$(REV) -DUSER=$(USER) #------------------------------------------------------------------------------ -# default section - -else - -ifneq ($(wildcard ../ethercat.conf),) -include ../ethercat.conf -else -KERNEL := $(shell uname -r) -endif - -KERNEL_DIR := /lib/modules/$(KERNEL)/build -CURRENT_DIR := $(shell pwd) -INSTALL_MOD_DIR := ethercat/master - -modules: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules - -install: modules_install - -modules_install: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \ - INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install - -clean: - $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean - @rm -f Modules.symvers - -#------------------------------------------------------------------------------ - -endif diff --git a/master/Makefile.am b/master/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..ff8e6bcba5c3ddd7cf5775aae2a17933b4860b3c --- /dev/null +++ b/master/Makefile.am @@ -0,0 +1,66 @@ +#------------------------------------------------------------------------------ +# +# Makefile.am +# +# IgH EtherCAT master module +# +# $Id: Makefile 545 2006-09-19 13:28:40Z fp $ +# +# Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH +# +# This file is part of the IgH EtherCAT Master. +# +# The IgH EtherCAT Master is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# The IgH EtherCAT Master is distributed in the hope that it will be +# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with the IgH EtherCAT Master; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# The right to use EtherCAT Technology is granted and comes free of +# charge under condition of compatibility of product made by +# Licensee. People intending to distribute/sell products based on the +# code, have to sign an agreement to guarantee that products using +# software based on IgH EtherCAT master stay compatible with the actual +# EtherCAT specification (which are released themselves as an open +# standard) as the (only) precondition to have the right to use EtherCAT +# Technology, IP and trade marks. +# +#------------------------------------------------------------------------------ + +EXTRA_DIST = \ + Kbuild \ + datagram.c datagram.h \ + debug.c debug.h \ + device.c device.h \ + domain.c domain.h \ + doxygen.c \ + ethernet.c ethernet.h \ + fsm.c fsm.h \ + globals.h \ + mailbox.c mailbox.h \ + master.c master.h \ + module.c \ + slave.c slave.h \ + xmldev.c xmldev.h + +ABSSRCDIR = `cd $(srcdir) && pwd -P` + +all: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" modules + +clean-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" clean + +install-data-local: + $(MAKE) -C "$(LINUX_DIR)" M="$(ABSSRCDIR)" \ + INSTALL_MOD_DIR="ethercat" modules_install + +#------------------------------------------------------------------------------