4 # PRIV_OBJ
:= 1 for object version
5 # BIG_ENDIAN
:= 1 for big
-endian mode
7 # arm
-linux
-tools chain are located at
:
8 #
/usr
/local
/bin
/arm
-linux
-gcc
9 #
/usr
/local
/bin
/arm
-linux
-ld
17 test_dir
= $
(shell
[ -e $
(dir
)/include
/linux
] && echo $
(dir
))
18 KSP
:= $
(foreach dir
, $
(KSP
), $
(test_dir
))
20 KSRC
:= $
(firstword $
(KSP
))
23 # $
(error Linux kernel source not found
)
26 # check kernel version
27 KVER
:= $
(shell uname
-r | cut
-c1
-3 | sed 's
/2\.
[56]/2\
.6/'
)
28 KERVER2
=$
(shell uname
-r | cut
-d.
-f2)
39 INSTDIR
:= $
(shell find
/lib
/modules
/$
(shell uname
-r
) -name $
(TARGET
) -printf
"%h\n" | sort | head
-1)
42 ifneq
(,$
(wildcard
/lib
/modules
/$
(shell uname
-r
)/kernel
))
43 INSTDIR
:= /lib
/modules
/$
(shell uname
-r
)/kernel
/drivers
/net
45 INSTDIR
:= /lib
/modules
/$
(shell uname
-r
)/net
49 INSTDIR
:= /lib
/modules
/$
(shell uname
-r
)/kernel
/drivers
/net
51 INSTDIR
:= /lib
/modules
/$
(shell uname
-r
)/net
57 SRC
= device_main.c card.c mac.c baseband.c wctl.c
80211mgr.c \
58 wcmd.c wmgr.c bssdb.c rxtx.c dpc.c power.c datarate.c srom.c \
59 mib.c rc4.c tether.c tcrc.c ioctl.c hostap.c wpa.c key.c tkip.c \
60 michael.c wroute.c rf.c iwctl.c wpactl.c wpa2.c aes_ccmp.c
71 CFLAGS
+= -DPRIVATE_OBJ
74 ifeq
($
(BIG_ENDIAN
), 1)
75 CFLAGS
+= -D__BIG_ENDIAN
76 CFLAGS
+= -mbig
-endian
79 CFLAGS
+= -mlittle
-endian
83 CFLAGS
+= -I$
(PWD
) -I$
(PWD
)/..
/include
-I$
(PWD
)/..
/solomon
91 KERNEL_CONF
= $
(KSRC
)/.config
94 include $
{KERNEL_CONF
}
98 viawget
-objs
:= device_main.o card.o mac.o baseband.o wctl.o
80211mgr.o \
99 wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o srom.o \
100 mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
101 michael.o wroute.o rf.o iwctl.o wpactl.o wpa2.o aes_ccmp.o
104 $
(CC
) $
(CFLAGS
) -o $@ $
<
107 make
-C $
(KSRC
) SUBDIRS
=$
(shell pwd
) modules
112 OBJS
:= device_main.o card.o mac.o baseband.o wctl.o
80211mgr.o \
113 wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o srom.o \
114 mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
115 michael.o wroute.o rf.o iwctl.o wpactl.o wpa2.o
118 CC
:= /usr
/local
/bin
/arm
-linux
-gcc
119 LD
:= /usr
/local
/bin
/arm
-linux
-ld
121 CFLAGS
+= -Wall
-DLINUX
-D__KERNEL__
-DMODULE
-DEXPORT_SYMTAB
-D__NO_VERSION__
-O2
-pipe
122 #CFLAGS
+= -Wstrict
-prototypes
-fomit
-frame
-pointer
123 COPTS
+= -march
=armv4
-fno
-strict
-aliasing
-fno
-common
124 #COPTS
+= -mapcs
-32 -mtune
=xscale
-mshort
-load
-bytes
-msoft
-float
-mfp
=2
125 #COPTS
+= -mthumb
-mcpu
=arm9
-ffunction
-sections
-fdata
-sections
128 .SILENT
: $
(TARGET
) clean
132 ifeq
($
(PRIV_OBJ
), 1)
134 ifeq
($
(BIG_ENDIAN
), 1)
144 $
(TARGET
): $
(filter
-out $
(TARGET
), $
(SRC
:.c
=.o
))
145 $
(LD
) $
(LDOPTS
) -r $^
-o $@
147 echo
"***********************************"
148 echo
"Build options:"
149 echo
" VERSION $(KVER)"
151 if
[ "$(SMP)" = "1" ]; \
152 then echo
"Enabled"; else echo
"Disabled"; fi
155 endif # ifeq
($
(KVER
),2.6)
161 install
: clean $
(TARGET
)
163 mkdir
-p $
(MOD_ROOT
)$
(INSTDIR
)
164 install
-m
644 -o root $
(TARGET
) $
(MOD_ROOT
)$
(INSTDIR
)
167 /sbin
/depmod
-a || true
169 /sbin
/depmod
-b $
(MOD_ROOT
) -a || true
174 rm
-f $
(INSTDIR
)/$
(TARGET
)
178 rm
-f $
(TARGET
) $
(SRC
:.c
=.o
) *~
179 rm
-f .
*.o.d .
*.o.cmd .
*.ko.cmd
*.mod.c
*.mod.o