devices/Makefile
changeset 364 9028b20e3c12
parent 363 58588a3a1562
child 365 7aede8ed6025
equal deleted inserted replaced
363:58588a3a1562 364:9028b20e3c12
     1 #------------------------------------------------------------------------------
       
     2 #
       
     3 #  Makefile
       
     4 #
       
     5 #  IgH EtherCAT master device modules
       
     6 #
       
     7 #  $Id$
       
     8 #
       
     9 #  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
       
    10 #
       
    11 #  This file is part of the IgH EtherCAT Master.
       
    12 #
       
    13 #  The IgH EtherCAT Master is free software; you can redistribute it
       
    14 #  and/or modify it under the terms of the GNU General Public License
       
    15 #  as published by the Free Software Foundation; either version 2 of the
       
    16 #  License, or (at your option) any later version.
       
    17 #
       
    18 #  The IgH EtherCAT Master is distributed in the hope that it will be
       
    19 #  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    20 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    21 #  GNU General Public License for more details.
       
    22 #
       
    23 #  You should have received a copy of the GNU General Public License
       
    24 #  along with the IgH EtherCAT Master; if not, write to the Free Software
       
    25 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
       
    26 #
       
    27 #  The right to use EtherCAT Technology is granted and comes free of
       
    28 #  charge under condition of compatibility of product made by
       
    29 #  Licensee. People intending to distribute/sell products based on the
       
    30 #  code, have to sign an agreement to guarantee that products using
       
    31 #  software based on IgH EtherCAT master stay compatible with the actual
       
    32 #  EtherCAT specification (which are released themselves as an open
       
    33 #  standard) as the (only) precondition to have the right to use EtherCAT
       
    34 #  Technology, IP and trade marks.
       
    35 #
       
    36 #------------------------------------------------------------------------------
       
    37 
       
    38 #------------------------------------------------------------------------------
       
    39 #  kbuild section
       
    40 
       
    41 ifneq ($(KERNELRELEASE),)
       
    42 
       
    43 obj-m := ec_8139too.o
       
    44 
       
    45 ec_8139too-objs := 8139too.o
       
    46 
       
    47 REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
       
    48 
       
    49 EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER)
       
    50 
       
    51 #------------------------------------------------------------------------------
       
    52 #  default section
       
    53 
       
    54 else
       
    55 
       
    56 ifneq ($(wildcard ../ethercat.conf),)
       
    57 include ../ethercat.conf
       
    58 else
       
    59 KERNEL := $(shell uname -r)
       
    60 endif
       
    61 
       
    62 KERNEL_DIR := /lib/modules/$(KERNEL)/build
       
    63 CURRENT_DIR := $(shell pwd)
       
    64 INSTALL_MOD_DIR := ethercat/devices
       
    65 
       
    66 modules:
       
    67 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules
       
    68 
       
    69 install: modules_install
       
    70 
       
    71 modules_install:
       
    72 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \
       
    73 		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install
       
    74 
       
    75 clean:
       
    76 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
       
    77 	@rm -f Modules.symvers
       
    78 
       
    79 #------------------------------------------------------------------------------
       
    80 
       
    81 endif