Makefile
changeset 250 440ae5f6d2c3
parent 246 0bf7c769de06
child 272 efb1c792a6a4
--- a/Makefile	Thu May 18 17:49:52 2006 +0000
+++ b/Makefile	Fri May 19 09:56:55 2006 +0000
@@ -33,34 +33,32 @@
 #
 #------------------------------------------------------------------------------
 
-ifneq ($(KERNELRELEASE),)
-
 #------------------------------------------------------------------------------
 #  kbuild section
 
+ifneq ($(KERNELRELEASE),)
+
 obj-m := master/ devices/
 
 #------------------------------------------------------------------------------
+#  default section
 
 else
 
-#------------------------------------------------------------------------------
-#  default section
-
 ifneq ($(wildcard ethercat.conf),)
 include ethercat.conf
 else
-KERNEL := `uname -r`
-DEVICEINDEX := 99
+KERNEL := $(shell uname -r)
 endif
 
-KERNELDIR := /lib/modules/$(KERNEL)/build
+KERNEL_DIR := /lib/modules/$(KERNEL)/build
+CURRENT_DIR := $(shell pwd)
 
 modules:
-	$(MAKE) -C $(KERNELDIR) M=`pwd`
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
 
 clean: cleandoc
-	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
 
 doc:
 	doxygen Doxyfile
@@ -69,7 +67,7 @@
 	@rm -rf doc
 
 install:
-	@./install.sh $(KERNEL) $(DEVICEINDEX)
+	@script/install.sh $(KERNEL)
 
 #------------------------------------------------------------------------------