31 # standard) as the (only) precondition to have the right to use EtherCAT |
31 # standard) as the (only) precondition to have the right to use EtherCAT |
32 # Technology, IP and trade marks. |
32 # Technology, IP and trade marks. |
33 # |
33 # |
34 #------------------------------------------------------------------------------ |
34 #------------------------------------------------------------------------------ |
35 |
35 |
36 ifneq ($(KERNELRELEASE),) |
|
37 |
|
38 #------------------------------------------------------------------------------ |
36 #------------------------------------------------------------------------------ |
39 # kbuild section |
37 # kbuild section |
|
38 |
|
39 ifneq ($(KERNELRELEASE),) |
40 |
40 |
41 obj-m := master/ devices/ |
41 obj-m := master/ devices/ |
42 |
42 |
43 #------------------------------------------------------------------------------ |
43 #------------------------------------------------------------------------------ |
|
44 # default section |
44 |
45 |
45 else |
46 else |
46 |
|
47 #------------------------------------------------------------------------------ |
|
48 # default section |
|
49 |
47 |
50 ifneq ($(wildcard ethercat.conf),) |
48 ifneq ($(wildcard ethercat.conf),) |
51 include ethercat.conf |
49 include ethercat.conf |
52 else |
50 else |
53 KERNEL := `uname -r` |
51 KERNEL := $(shell uname -r) |
54 DEVICEINDEX := 99 |
|
55 endif |
52 endif |
56 |
53 |
57 KERNELDIR := /lib/modules/$(KERNEL)/build |
54 KERNEL_DIR := /lib/modules/$(KERNEL)/build |
|
55 CURRENT_DIR := $(shell pwd) |
58 |
56 |
59 modules: |
57 modules: |
60 $(MAKE) -C $(KERNELDIR) M=`pwd` |
58 $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) |
61 |
59 |
62 clean: cleandoc |
60 clean: cleandoc |
63 $(MAKE) -C $(KERNELDIR) M=`pwd` clean |
61 $(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean |
64 |
62 |
65 doc: |
63 doc: |
66 doxygen Doxyfile |
64 doxygen Doxyfile |
67 |
65 |
68 cleandoc: |
66 cleandoc: |
69 @rm -rf doc |
67 @rm -rf doc |
70 |
68 |
71 install: |
69 install: |
72 @./install.sh $(KERNEL) $(DEVICEINDEX) |
70 @script/install.sh $(KERNEL) |
73 |
71 |
74 #------------------------------------------------------------------------------ |
72 #------------------------------------------------------------------------------ |
75 |
73 |
76 endif |
74 endif |