r31 - unstable/rt2x00/debian/patches

benh at alioth.debian.org benh at alioth.debian.org
Sat Oct 6 23:39:31 UTC 2007


Author: benh
Date: 2007-10-06 23:39:31 +0000 (Sat, 06 Oct 2007)
New Revision: 31

Modified:
   unstable/rt2x00/debian/patches/002_out_of_tree.diff
Log:
Changed to follow out-of-tree Makefile template from Linux Device Drivers.


Modified: unstable/rt2x00/debian/patches/002_out_of_tree.diff
===================================================================
--- unstable/rt2x00/debian/patches/002_out_of_tree.diff	2007-10-06 18:00:21 UTC (rev 30)
+++ unstable/rt2x00/debian/patches/002_out_of_tree.diff	2007-10-06 23:39:31 UTC (rev 31)
@@ -1,27 +1,35 @@
 --- rt2x00.orig/drivers/net/wireless/rt2x00/Makefile
 +++ rt2x00/drivers/net/wireless/rt2x00/Makefile
-@@ -1,3 +1,9 @@
-+SUBDIRS ?= $(shell pwd)
+@@ -1,3 +1,12 @@
++# If KERNELRELEASE is defined, we've been invoked from the
++# kernel build system and can use its language.
++ifneq ($(KERNELRELEASE),)
 +
-+# Include kernel and rt2x00 config
-+include $(KSRC)/.config
-+include $(SUBDIRS)/config
++# Include rt2x00 config
++include $(M)/config
 +
++CPPFLAGS += -I$(M)/../../../../include
++
  rt2x00lib-objs := rt2x00dev.o rt2x00mac.o rt2x00config.o
  
  ifeq ($(CONFIG_RT2X00_LIB_DEBUGFS),y)
-@@ -20,3 +26,22 @@
+@@ -20,3 +29,29 @@
  obj-$(CONFIG_RT61PCI)		+= rt61pci.o
  obj-$(CONFIG_RT2500USB)		+= rt2500usb.o
  obj-$(CONFIG_RT73USB)		+= rt73usb.o
 +
-+CPPFLAGS += -I$(SUBDIRS)/../../../../include
++# Otherwise we were called directly from the command
++# line; invoke the kernel build system.
++else
 +
-+default: $(SUBDIRS)/config.h
-+	$(MAKE) -C $(KSRC) SUBDIRS=$(SUBDIRS) modules
++KSRC ?= /lib/modules/$(shell uname -r)/build
++PWD := $(shell pwd)
 +
-+$(SUBDIRS)/config.h: $(SUBDIRS)/config
-+	awk -F = > $(SUBDIRS)/config.h < $(SUBDIRS)/config '/^CONFIG.*$\/ \
++default: config.h
++	$(MAKE) -C $(KSRC) M=$(PWD) modules
++
++config.h: config
++	awk -F = > config.h < config '/^CONFIG.*$\/ \
 +	{ \
 +		if($$2 == "y") { \
 +			print "#define " $$1; \
@@ -31,8 +39,10 @@
 +	}'
 +
 +clean:
-+	$(MAKE) -C $(KSRC) SUBDIRS=$(SUBDIRS) clean
-+	rm -f $(SUBDIRS)/config.h
++	$(MAKE) -C $(KSRC) M=$(PWD) clean
++	rm -f config.h
++
++endif
 --- /dev/null
 +++ rt2x00/drivers/net/wireless/rt2x00/config
 @@ -0,0 +1,16 @@
@@ -65,18 +75,26 @@
   * DRV_NAME should be set within the individual module source files.
 --- /dev/null
 +++ rt2x00/drivers/misc/Makefile
-@@ -0,0 +1,14 @@
-+SUBDIRS ?= $(shell pwd)
+@@ -0,0 +1,22 @@
++# If KERNELRELEASE is defined, we've been invoked from the
++# kernel build system and can use its language.
++ifneq ($(KERNELRELEASE),)
 +
-+# Include kernel config
-+include $(KSRC)/.config
++CPPFLAGS += -I$(M)/../../include
 +
 +obj-m      += eeprom_93cx6.o
 +
-+CPPFLAGS += -I$(SUBDIRS)/../../include
++# Otherwise we were called directly from the command
++# line; invoke the kernel build system.
++else
 +
++KSRC ?= /lib/modules/$(shell uname -r)/build
++PWD := $(shell pwd)
++
 +default:
-+	$(MAKE) -C $(KSRC) SUBDIRS=$(SUBDIRS) modules
++	$(MAKE) -C $(KSRC) M=$(PWD) modules
 +
 +clean:
-+	$(MAKE) -C $(KSRC) SUBDIRS=$(SUBDIRS) clean
++	$(MAKE) -C $(KSRC) M=$(PWD) clean
++
++endif




More information about the Pkg-ralink-commits mailing list