]> bbs.cooldavid.org Git - jme.git/blobdiff - Makefile
jme: Refill receive unicase MAC addr after resume
[jme.git] / Makefile
index c7f05ee2514b6c01663bf499ebc562a85c0cfaba..64e6dabb214079da760d18e9f7031800be2ad9f7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,48 @@
-
 MODNAME := jme
-TEMPFILES := $(MODNAME).o $(MODNAME).mod.c $(MODNAME).mod.o Module.symvers .$(MODNAME).*.cmd .tmp_versions
-#EXTRA_CFLAGS += -Wall -DDEBUG -DTX_DEBUG -DRX_DEBUG
-#EXTRA_CFLAGS += -Wall -DDEBUG
-EXTRA_CFLAGS += -Wall
-
 obj-m := $(MODNAME).o
 
+ifneq ($(KERNELRELEASE),)
+#########################
+# kbuild part of makefile
+#########################
+EXTRA_CFLAGS += -Wall -O3
+#EXTRA_CFLAGS += -DTX_DEBUG
+#EXTRA_CFLAGS += -DREG_DEBUG
+
+else
+#########################
+# Normal Makefile
+#########################
+TEMPFILES := $(MODNAME).o $(MODNAME).mod.c $(MODNAME).mod.o Module.symvers .$(MODNAME).*.cmd .tmp_versions modules.order Module.markers Modules.symvers
+
 ifeq (,$(BUILD_KERNEL))
 BUILD_KERNEL=$(shell uname -r)
 endif
+KSRC ?= /lib/modules/$(BUILD_KERNEL)/build
 
-KSRC := /lib/modules/$(BUILD_KERNEL)/build
+all: modules
+       @rm -rf $(TEMPFILES)
+modules:
+       @$(MAKE) -C $(KSRC) M=$(shell pwd) modules
 
-all:
-       @$(MAKE) -C $(KSRC) SUBDIRS=$(shell pwd) modules
+checkstack: modules
+       objdump -d $(obj-m) | perl $(KSRC)/scripts/checkstack.pl $(shell uname -m)
        @rm -rf $(TEMPFILES)
 
+namespacecheck: modules
+       perl $(KSRC)/scripts/namespace.pl
+       @rm -rf $(TEMPFILES)
+
+install: modules
+       $(MAKE) -C $(KSRC) M=`pwd` modules_install
+
+patch:
+       @/usr/bin/diff -uar -X dontdiff ../../trunc ./ > bc.patch || echo > /dev/null
+
 clean:
        @rm -rf $(MODNAME).ko $(TEMPFILES)
 
+%::
+       $(MAKE) -C $(KSRC) M=`pwd` $@
+
+endif