master/Makefile
changeset 272 efb1c792a6a4
parent 267 88177083f137
child 281 c91bbf7bc52c
equal deleted inserted replaced
271:29ac97eb9d79 272:efb1c792a6a4
    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_master.o
    43 obj-m := ec_master.o
    44 
    44 
    45 ec_master-objs := module.o master.o device.o slave.o command.o types.o \
    45 ec_master-objs := module.o master.o device.o slave.o command.o types.o \
    46 		domain.o mailbox.o canopen.o ethernet.o debug.o fsm.o
    46 		domain.o mailbox.o canopen.o ethernet.o debug.o fsm.o
    48 REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
    48 REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
    49 
    49 
    50 EXTRA_CFLAGS := -DSVNREV=$(REV) -DUSER=$(USER)
    50 EXTRA_CFLAGS := -DSVNREV=$(REV) -DUSER=$(USER)
    51 
    51 
    52 #------------------------------------------------------------------------------
    52 #------------------------------------------------------------------------------
       
    53 #  default section
    53 
    54 
    54 else
    55 else
    55 
       
    56 #------------------------------------------------------------------------------
       
    57 #  default section
       
    58 
    56 
    59 ifneq ($(wildcard ../ethercat.conf),)
    57 ifneq ($(wildcard ../ethercat.conf),)
    60 include ../ethercat.conf
    58 include ../ethercat.conf
    61 else
    59 else
    62 KERNEL := $(shell uname -r)
    60 KERNEL := $(shell uname -r)
    64 
    62 
    65 KERNEL_DIR := /lib/modules/$(KERNEL)/build
    63 KERNEL_DIR := /lib/modules/$(KERNEL)/build
    66 CURRENT_DIR := $(shell pwd)
    64 CURRENT_DIR := $(shell pwd)
    67 
    65 
    68 modules:
    66 modules:
    69 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
    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) modules_install
    70 
    73 
    71 clean:
    74 clean:
    72 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
    75 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
    73 
    76 
    74 #------------------------------------------------------------------------------
    77 #------------------------------------------------------------------------------