Skip to content

Commit

Permalink
split Makefile from Kbuild
Browse files Browse the repository at this point in the history
This is needed because dkms sets KERNELRELEASE from command line.

Issue-id: #26
Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
  • Loading branch information
kuba-moo committed Jun 29, 2015
1 parent c10471f commit 3a2e411
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
10 changes: 10 additions & 0 deletions Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
EXTRA_CFLAGS += -Werror -Wenum-compare
ccflags-y += -D__CHECK_ENDIAN__

obj-m := mt7601u.o

mt7601u-y := \
usb.o init.o main.o mcu.o trace.o dma.o core.o eeprom.o phy.o \
mac.o util.o debugfs.o tx.o

CFLAGS_trace.o := -I$(src)
19 changes: 5 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
ifeq ($(KERNELRELEASE),)
ifneq ($(KERNELRELEASE),)
KDIR ?= /lib/modules/$(KERNELRELEASE)/build
endif

KDIR ?= /lib/modules/`uname -r`/build

default:
$(MAKE) -C $(KDIR) M=$$PWD
clean:
$(MAKE) -C $(KDIR) M=$$PWD clean
install:
$(MAKE) -C $(KDIR) M=$$PWD modules_install
else
EXTRA_CFLAGS += -Werror -Wenum-compare
ccflags-y += -D__CHECK_ENDIAN__

obj-m := mt7601u.o

mt7601u-y := \
usb.o init.o main.o mcu.o trace.o dma.o core.o eeprom.o phy.o \
mac.o util.o debugfs.o tx.o

CFLAGS_trace.o := -I$(src)

endif

0 comments on commit 3a2e411

Please sign in to comment.