mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-08-18 09:07:24 +08:00
Improved installation, added quick modules_install target.
This commit is contained in:
@@ -43,6 +43,10 @@ EXTRA_DIST = \
|
||||
globals.h \
|
||||
LICENSE
|
||||
|
||||
modules_install:
|
||||
$(MAKE) -C master modules_install
|
||||
$(MAKE) -C devices modules_install
|
||||
|
||||
mydist:
|
||||
@SVNREV=`svnversion $(srcdir)` && \
|
||||
$(MAKE) dist-bzip2 \
|
||||
|
||||
+23
-4
@@ -36,7 +36,7 @@ AC_ARG_WITH([linux-dir],
|
||||
modulesdir=/lib/modules/${version}
|
||||
if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
|
||||
echo
|
||||
AC_MSG_ERROR([Invalid modules directory ${modulesdir}])
|
||||
AC_MSG_ERROR([Failed to find Linux sources. Use --with-linux-dir!])
|
||||
fi
|
||||
sourcedir=`cd ${modulesdir}/build && pwd -P`
|
||||
]
|
||||
@@ -45,12 +45,31 @@ AC_ARG_WITH([linux-dir],
|
||||
AC_MSG_CHECKING([for Linux kernel sources])
|
||||
|
||||
if test \! -r ${sourcedir}/.config; then
|
||||
echo
|
||||
AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
|
||||
echo
|
||||
AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
|
||||
fi
|
||||
|
||||
# Try to get kernel release string
|
||||
if test -r ${sourcedir}/.kernelrelease; then
|
||||
kernelrelease=`cat $sourcedir/.kernelrelease`
|
||||
elif test -r ${sourcedir}/include/linux/version.h; then
|
||||
hdr=$sourcedir/include/linux/version.h
|
||||
kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
|
||||
fi
|
||||
|
||||
if test -z "$kernelrelease"; then
|
||||
echo
|
||||
AC_MSG_ERROR([Failed to extract Linux kernel version!])
|
||||
fi
|
||||
|
||||
# Extract three numbers from kernel release string
|
||||
linuxversion=`echo $kernelrelease | grep -oE [[0-9]]+\.[[0-9]]+\.[[0-9]]+`
|
||||
|
||||
AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
|
||||
AC_MSG_RESULT($LINUX_SOURCE_DIR)
|
||||
AC_SUBST(LINUX_KERNEL_RELEASE,[$kernelrelease])
|
||||
AC_SUBST(LINUX_KERNEL_VERSION,[$linuxversion])
|
||||
AC_SUBST(LINUX_MOD_PATH,[/lib/modules/$kernelrelease/ethercat])
|
||||
AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $LINUX_KERNEL_RELEASE)])
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Debug interface
|
||||
|
||||
+4
-4
@@ -45,9 +45,9 @@ all-local:
|
||||
clean-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
|
||||
|
||||
install-data-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
|
||||
INSTALL_MOD_PATH="$(DESTDIR)" \
|
||||
INSTALL_MOD_DIR="ethercat" modules_install
|
||||
install-data-local: modules_install
|
||||
|
||||
modules_install:
|
||||
cp $(srcdir)/ec_8139too.ko $(DESTDIR)$(LINUX_MOD_PATH)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -43,9 +43,9 @@ all:
|
||||
clean-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
|
||||
|
||||
install-data-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
|
||||
INSTALL_MOD_PATH="$(DESTDIR)" \
|
||||
INSTALL_MOD_DIR="ethercat" modules_install
|
||||
install-data-local: modules_install
|
||||
|
||||
modules_install:
|
||||
cp $(srcdir)/ec_mini.ko $(DESTDIR)$(LINUX_MOD_PATH)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -44,9 +44,9 @@ all:
|
||||
clean-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
|
||||
|
||||
install-data-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
|
||||
INSTALL_MOD_PATH="$(DESTDIR)" \
|
||||
INSTALL_MOD_DIR="ethercat" modules_install
|
||||
install-data-local: modules_install
|
||||
|
||||
modules_install:
|
||||
cp $(srcdir)/ec_msr_sample.ko $(DESTDIR)$(LINUX_MOD_PATH)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -43,9 +43,9 @@ all:
|
||||
clean-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
|
||||
|
||||
install-data-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
|
||||
INSTALL_MOD_PATH="$(DESTDIR)" \
|
||||
INSTALL_MOD_DIR="ethercat" modules_install
|
||||
install-data-local: modules_install
|
||||
|
||||
modules_install:
|
||||
cp $(srcdir)/ec_rtai_sample.ko $(DESTDIR)$(LINUX_MOD_PATH)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
+4
-4
@@ -58,9 +58,9 @@ all-local:
|
||||
clean-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" clean
|
||||
|
||||
install-data-local:
|
||||
$(MAKE) -C "$(LINUX_SOURCE_DIR)" M="@abs_srcdir@" \
|
||||
INSTALL_MOD_PATH="$(DESTDIR)" \
|
||||
INSTALL_MOD_DIR="ethercat" modules_install
|
||||
install-data-local: modules_install
|
||||
|
||||
modules_install:
|
||||
cp $(srcdir)/ec_master.ko $(DESTDIR)$(LINUX_MOD_PATH)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user