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 #------------------------------------------------------------------------------ |