devices/Makefile
changeset 272 efb1c792a6a4
parent 267 88177083f137
child 281 c91bbf7bc52c
equal deleted inserted replaced
271:29ac97eb9d79 272:efb1c792a6a4
     1 #------------------------------------------------------------------------------
     1 #------------------------------------------------------------------------------
     2 #
     2 #
     3 #  kbuild Makefile
     3 #  Makefile
     4 #
     4 #
     5 #  IgH EtherCAT master device modules
     5 #  IgH EtherCAT master device modules
     6 #
     6 #
     7 #  $Id$
     7 #  $Id$
     8 #
     8 #
    33 #  standard) as the (only) precondition to have the right to use EtherCAT
    33 #  standard) as the (only) precondition to have the right to use EtherCAT
    34 #  Technology, IP and trade marks.
    34 #  Technology, IP and trade marks.
    35 #
    35 #
    36 #------------------------------------------------------------------------------
    36 #------------------------------------------------------------------------------
    37 
    37 
    38 ifneq ($(KERNELRELEASE),)
       
    39 
       
    40 #------------------------------------------------------------------------------
    38 #------------------------------------------------------------------------------
    41 #  kbuild section
    39 #  kbuild section
       
    40 
       
    41 ifneq ($(KERNELRELEASE),)
    42 
    42 
    43 obj-m := ec_8139too.o
    43 obj-m := ec_8139too.o
    44 
    44 
    45 ec_8139too-objs := 8139too.o
    45 ec_8139too-objs := 8139too.o
    46 
    46 
    47 REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
    47 REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
    48 
    48 
    49 EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER)
    49 EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER)
    50 
    50 
    51 #------------------------------------------------------------------------------
    51 #------------------------------------------------------------------------------
       
    52 #  default section
    52 
    53 
    53 else
    54 else
    54 
       
    55 #------------------------------------------------------------------------------
       
    56 #  default section
       
    57 
    55 
    58 ifneq ($(wildcard ../ethercat.conf),)
    56 ifneq ($(wildcard ../ethercat.conf),)
    59 include ../ethercat.conf
    57 include ../ethercat.conf
    60 else
    58 else
    61 KERNEL := $(shell uname -r)
    59 KERNEL := $(shell uname -r)
    63 
    61 
    64 KERNEL_DIR := /lib/modules/$(KERNEL)/build
    62 KERNEL_DIR := /lib/modules/$(KERNEL)/build
    65 CURRENT_DIR := $(shell pwd)
    63 CURRENT_DIR := $(shell pwd)
    66 
    64 
    67 modules:
    65 modules:
    68 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
    66 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules
       
    67 
       
    68 install: modules_install
       
    69 
       
    70 modules_install:
       
    71 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules_install
    69 
    72 
    70 clean:
    73 clean:
    71 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
    74 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
    72 
    75 
    73 #------------------------------------------------------------------------------
    76 #------------------------------------------------------------------------------