-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathMakefile
137 lines (106 loc) · 3.37 KB
/
Makefile
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
ifeq ($(WIFI_MODE),)
RT28xx_MODE = AP
else
RT28xx_MODE = $(WIFI_MODE)
endif
ifeq ($(TARGET),)
TARGET = LINUX
endif
ifeq ($(CHIPSET),)
CHIPSET = 7601U
endif
MODULE = $(word 1, $(CHIPSET))
#OS ABL - YES or NO
OSABL = NO
#RT28xx_DIR = home directory of RT28xx source code
RT28xx_DIR = $(shell pwd)
include $(RT28xx_DIR)/os/linux/config.mk
RTMP_SRC_DIR = $(RT28xx_DIR)/RT$(MODULE)
#PLATFORM: Target platform
PLATFORM =
#APSOC
ifeq ($(MODULE),3050)
PLATFORM = RALINK_3050
endif
ifeq ($(MODULE),3052)
PLATFORM = RALINK_3052
endif
ifeq ($(MODULE),3350)
PLATFORM = RALINK_3050
endif
ifeq ($(MODULE),3352)
PLATFORM = RALINK_3352
endif
#RELEASE Package
RELEASE = DPA
MAKE = make
LINUX_VER = $(shell uname -r)
# Linux 2.6
LINUX_SRC ?= /lib/modules/$(LINUX_VER)/build
LINUX_SRC_MODULE = /lib/modules/$(LINUX_VER)/kernel/drivers/net/wireless
export OSABL RT28xx_DIR RT28xx_MODE LINUX_SRC CROSS_COMPILE CROSS_COMPILE_INCLUDE PLATFORM RELEASE CHIPSET MODULE RTMP_SRC_DIR LINUX_SRC_MODULE TARGET HAS_WOW_SUPPORT
# The targets that may be used.
PHONY += all build_tools test LINUX release prerelease clean uninstall install libwapi osabl
all: $(TARGET)
build_tools:
@$(MAKE) -C tools
$(RT28xx_DIR)/tools/bin2h
LINUX:
ifeq ($(OSABL),YES)
@cp os/linux/Makefile.6.util $(RT28xx_DIR)/os/linux/Makefile
$(MAKE) -C $(LINUX_SRC) M=$(RT28xx_DIR)/os/linux modules
endif
@cp os/linux/Makefile.6 $(RT28xx_DIR)/os/linux/Makefile
$(MAKE) -C $(LINUX_SRC) M=$(RT28xx_DIR)/os/linux modules
ifeq ($(OSABL),YES)
@cp os/linux/Makefile.6.netif $(RT28xx_DIR)/os/linux/Makefile
$(MAKE) -C $(LINUX_SRC) M=$(RT28xx_DIR)/os/linux modules
endif
release: build_tools
$(MAKE) -C $(RT28xx_DIR)/striptool -f Makefile.release clean
$(MAKE) -C $(RT28xx_DIR)/striptool -f Makefile.release
striptool/striptool.out
ifeq ($(RELEASE), DPO)
gcc -o striptool/banner striptool/banner.c
striptool/banner -b striptool/copyright.gpl -s DPO/ -d DPO_GPL -R
striptool/banner -b striptool/copyright.frm -s DPO_GPL/include/firmware.h
endif
prerelease:
ifeq ($(MODULE), 2880)
$(MAKE) -C $(RT28xx_DIR)/os/linux -f Makefile.release.2880 prerelease
else
$(MAKE) -C $(RT28xx_DIR)/os/linux -f Makefile.release prerelease
endif
cp $(RT28xx_DIR)/os/linux/Makefile.DPB $(RTMP_SRC_DIR)/os/linux/
cp $(RT28xx_DIR)/os/linux/Makefile.DPA $(RTMP_SRC_DIR)/os/linux/
cp $(RT28xx_DIR)/os/linux/Makefile.DPC $(RTMP_SRC_DIR)/os/linux/
ifeq ($(RT28xx_MODE),STA)
cp $(RT28xx_DIR)/os/linux/Makefile.DPD $(RTMP_SRC_DIR)/os/linux/
cp $(RT28xx_DIR)/os/linux/Makefile.DPO $(RTMP_SRC_DIR)/os/linux/
endif
clean:
$(MAKE) -C $(RT28xx_DIR)/os/linux -f Makefile.6 clean
strip:
@$(MAKE) -C $(RT28xx_DIR)/os/linux strip
uninstall:
$(MAKE) -C $(RT28xx_DIR)/os/linux uninstall
install:
$(MAKE) -C $(RT28xx_DIR)/os/linux install
libwapi:
cp os/linux/Makefile.libwapi.6 $(RT28xx_DIR)/os/linux/Makefile
$(MAKE) -C $(LINUX_SRC) M=$(RT28xx_DIR)/os/linux modules
osutil:
ifeq ($(OSABL),YES)
cp os/linux/Makefile.6.util $(RT28xx_DIR)/os/linux/Makefile
$(MAKE) -C $(LINUX_SRC) M=$(RT28xx_DIR)/os/linux modules
endif
osnet:
ifeq ($(OSABL),YES)
cp os/linux/Makefile.6.netif $(RT28xx_DIR)/os/linux/Makefile
$(MAKE) -C $(LINUX_SRC) M=$(RT28xx_DIR)/os/linux modules
endif
osdrv:
cp os/linux/Makefile.6 $(RT28xx_DIR)/os/linux/Makefile
$(MAKE) -C $(LINUX_SRC) M=$(RT28xx_DIR)/os/linux modules
# Declare the contents of the .PHONY variable as phony. We keep that information in a variable
.PHONY: $(PHONY)