Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Check GCC version so we can apply -Wno-date-time if supported. GCC >= 4.9
- empty:=
- space:= $(empty) $(empty)
- GCCVERSIONSTRING := $(shell expr `$(CC) -dumpversion`)
- #Create version number without "."
- GCCVERSION := $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f1 -d.)
- GCCVERSION += $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f2 -d.)
- GCCVERSION += $(shell expr `echo $(GCCVERSIONSTRING)` | cut -f3 -d.)
- # Make sure the version number has at least 3 decimals
- GCCVERSION += 00
- # Remove spaces from the version number
- GCCVERSION := $(subst $(space),$(empty),$(GCCVERSION))
- # Crop the version number to 3 decimals.
- GCCVERSION := $(shell expr `echo $(GCCVERSION)` | cut -b1-3)
- GE_49 := $(shell expr `echo $(GCCVERSION)` >= 490)
- EXTRA_CFLAGS :=
- ifeq ($(APIFINAL),CFG80211)
- EXTRA_CFLAGS += -DUSE_CFG80211
- $(info Using CFG80211 API)
- endif
- ifeq ($(APIFINAL),WEXT)
- EXTRA_CFLAGS += -DUSE_IW
- $(info Using Wireless Extension API)
- endif
- obj-m += wl.o
- wl-objs :=
- wl-objs += src/shared/linux_osl.o
- wl-objs += src/wl/sys/wl_linux.o
- wl-objs += src/wl/sys/wl_iw.o
- wl-objs += src/wl/sys/wl_cfg80211_hybrid.o
- EXTRA_CFLAGS += -I$(src)/src/include -I$(src)/src/common/include
- EXTRA_CFLAGS += -I$(src)/src/wl/sys -I$(src)/src/wl/phy -I$(src)/src/wl/ppr/include
- EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include
- #EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR
- ifeq "$(GE_49)" "1"
- EXTRA_CFLAGS += -Wno-date-time
- endif
- EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
- KBASE ?= /lib/modules/`uname -r`
- KBUILD_DIR ?= $(KBASE)/build
- MDEST_DIR ?= $(KBASE)/kernel/drivers/net/wireless
- # Cross compile setup. Tool chain and kernel tree, replace with your own.
- CROSS_TOOLS = /path/to/tools
- CROSS_KBUILD_DIR = /path/to/kernel/tree
- all:
- KBUILD_NOPEDANTIC=1 make -C $(KBUILD_DIR) M=`pwd`
- cross:
- KBUILD_NOPEDANTIC=1 make CROSS_COMPILE=${CROSS_TOOLS} -C $(CROSS_KBUILD_DIR) M=`pwd`
- clean:
- KBUILD_NOPEDANTIC=1 make -C $(KBUILD_DIR) M=`pwd` clean
- install:
- install -D -m 755 wl.ko $(MDEST_DIR)
Add Comment
Please, Sign In to add comment