summaryrefslogtreecommitdiff
path: root/drivers/mt5931/drv_wlan/GNUmakefile
blob: cdf60c9904cdbbf5f78e16b887103ccc02c83c84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# --------------------------------------------------------------------
# Copyright (c) 2010 MediaTek Inc.
#
# All rights reserved. Copying, compilation, modification, distribution
# or any other use whatsoever of this material is strictly prohibited
# except in accordance with a Software License Agreement with
# MediaTek Inc.
# --------------------------------------------------------------------

# --------------------------------------------------------------------
# This Makefile is major entrance for compiling driver module for 
# Linux Kernel 2.6
# --------------------------------------------------------------------

DRV_SRC_DIR := $(shell pwd)
export DRV_SRC_DIR

include $(DRV_SRC_DIR)/config.mk
include $(DRV_SRC_DIR)/GNUmakefile.inc

# Objects List for Linux 2.6
COMMON_OBJS   := $(patsubst %.o,$(COMMON_DIR)%.o,$(strip $(COMMON_OBJS)))
NIC_OBJS      := $(patsubst %.o,$(NIC_DIR)%.o,$(strip $(NIC_OBJS)))
OS_OBJS       := $(patsubst %.o,$(OS_DIR)%.o,$(strip $(OS_OBJS)))
HIF_OBJS      := $(patsubst %.o,$(HIF_DIR)%.o,$(strip $(HIF_OBJS)))
MGMT_OBJS     := $(patsubst %.o,$(MGMT_DIR)%.o,$(strip $(MGMT_OBJS)))


.PHONY: all clean install info build
all: build install

build: info
	@$(MAKE) -C $(LINUX_SRC) M=$(DRV_SRC_DIR) modules
	@echo
	@$(SIZE) -d $(patsubst %.o,%.ko,$(MTK_WLAN_MODULE))
	@echo


clean:
	@$(MAKE) -C $(LINUX_SRC) M=$(DRV_SRC_DIR) clean


install:
ifneq ($(INSTALL_PATH),)
	@echo Install $(patsubst %.o,%.ko,$(MTK_WLAN_MODULE)) to $(INSTALL_PATH)/$(INSTALL_MODULE_NAME)
	@cp $(patsubst %.o,%.ko,$(MTK_WLAN_MODULE)) $(INSTALL_PATH)/$(INSTALL_MODULE_NAME)
else
	@echo Warning INSTALL_PATH must be defined for 'make install' - check config.mk !
endif
	@echo


info:
	@echo ""
	@echo "The following settings will be used for compilation:"
	@echo "----------------------------------------------------"
	@echo "PLATFORM       : $(ARCH)"
	@echo "COMPILE        : $(LINUX26_CC)"
	@echo "KERNEL PATH    : $(LINUX_SRC)"
	@echo "KERNEL VERSION : $(KERNEL_RELEASE)"
	@echo "INSTALL PATH   : $(INSTALL_PATH)"
	@echo "INSTALL MODULE NAME : $(INSTALL_MODULE_NAME)"	
	@echo "----------------------------------------------------"
	@echo ""