diff --git a/Makefile b/Makefile index f82ad98f338df5a94e8b3a4fd7218f2a6d70b1fe..64d06385c9608ecff620bf275664883df13fc54d 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,7 @@ ifneq ($(wildcard ethercat.conf),) include ethercat.conf else KERNELDIR := /usr/src/linux +INSTALLDIR := /opt/ethercat endif modules: @@ -34,6 +35,9 @@ modules: clean: $(MAKE) -C $(KERNELDIR) M=`pwd` clean +install: + @./install.sh $(INSTALLDIR) + #------------------------------------------------------------------------------ endif diff --git a/ethercat.conf.tmpl b/ethercat.conf.tmpl index a95d6ed5105424e5955f56d1bee019a11aa8b390..8ffedbca57cd61d848c221273913e07f87e6ca53 100644 --- a/ethercat.conf.tmpl +++ b/ethercat.conf.tmpl @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# EtherCAT Konfigurationsdatei Kernel 2.6 +# EtherCAT configuration file # # $Id$ # @@ -9,5 +9,10 @@ # #------------------------------------------------------------------------------ +# The kernel to compile the EtherCAT sources against KERNELDIR = /usr/src/linux +# Install directory used by "make install" +INSTALLDIR := /opt/ethercat + +#------------------------------------------------------------------------------ diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000000000000000000000000000000000..c19b54cc2e2dab98c6519d7bd2d3c2ead94dad56 --- /dev/null +++ b/install.sh @@ -0,0 +1,36 @@ +#!/bin/sh + +#------------------------------------------------------------------------------ +# +# EtherCAT install script +# +# $Id$ +# +#------------------------------------------------------------------------------ + +# Fetch parameter + +if [ $# -eq 0 ]; then + echo "Usage: $0 <INSTALLDIR>" + exit 1 +fi + +INSTALLDIR=$1 + +# Create install directory + +if [ ! -d $INSTALLDIR ]; then + echo "Creating directory $INSTALLDIR..." + if ! mkdir $INSTALLDIR; then exit 1; fi +fi + +# Copy files + +if ! cp master/ec_master.ko $INSTALLDIR; then exit -1; fi +if ! cp devices/ec_8139too.ko $INSTALLDIR; then exit -1; fi + +# Finished + +exit 0 + +#------------------------------------------------------------------------------