devices/Makefile
changeset 267 88177083f137
parent 246 0bf7c769de06
child 272 efb1c792a6a4
equal deleted inserted replaced
266:0234b0c26c52 267:88177083f137
    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)
    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 
    52 
    59 include ../ethercat.conf
    59 include ../ethercat.conf
    60 else
    60 else
    61 KERNEL := $(shell uname -r)
    61 KERNEL := $(shell uname -r)
    62 endif
    62 endif
    63 
    63 
    64 KERNELDIR := /lib/modules/$(KERNEL)/build
    64 KERNEL_DIR := /lib/modules/$(KERNEL)/build
       
    65 CURRENT_DIR := $(shell pwd)
    65 
    66 
    66 modules:
    67 modules:
    67 	$(MAKE) -C $(KERNELDIR) M=`pwd`
    68 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
    68 
    69 
    69 clean:
    70 clean:
    70 	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
    71 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
    71 
    72 
    72 #------------------------------------------------------------------------------
    73 #------------------------------------------------------------------------------
    73 
    74 
    74 endif
    75 endif