jbd: Fix a race between checkpointing code and journal_get_write_access()
[linux/fpc-iii.git] / drivers / staging / vt6655 / Makefile.arm
blob2d2ccaded6ac34ccbcd2464089d3f41b22a4f066
3 # Build options:
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
12 IO_MAP := 0
13 HOSTAP := 1
14 PRIV_OBJ := 1
15 BIG_ENDIAN := 1
17 test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
18 KSP := $(foreach dir, $(KSP), $(test_dir))
20 KSRC := $(firstword $(KSP))
22 #ifeq (,$(KSRC))
23 # $(error Linux kernel source not found)
24 #endif
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)
30 ifeq ($(KVER), 2.6)
31 # 2.6 kernel
32 TARGET = viawget.ko
34 else
35 TARGET = viawget.o
37 endif
39 INSTDIR := $(shell find /lib/modules/$(shell uname -r) -name $(TARGET) -printf "%h\n" | sort | head -1)
40 ifeq (,$(INSTDIR))
41 ifeq (,$(KERVER2))
42 ifneq (,$(wildcard /lib/modules/$(shell uname -r)/kernel))
43 INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
44 else
45 INSTDIR := /lib/modules/$(shell uname -r)/net
46 endif
47 else
48 ifneq ($(KERVER2),2)
49 INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
50 else
51 INSTDIR := /lib/modules/$(shell uname -r)/net
52 endif
53 endif
54 endif
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
62 ifeq ($(IO_MAP), 1)
63 CFLAGS += -DIO_MAP
64 endif
66 ifeq ($(HOSTAP), 1)
67 CFLAGS += -DHOSTAP
68 endif
70 ifeq ($(PRIV_OBJ), 1)
71 CFLAGS += -DPRIVATE_OBJ
72 endif
74 ifeq ($(BIG_ENDIAN), 1)
75 CFLAGS += -D__BIG_ENDIAN
76 CFLAGS += -mbig-endian
77 LDOPTS += -EB
78 else
79 CFLAGS += -mlittle-endian
80 LDOPTS += -EL
81 endif
83 CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/../solomon
86 # build rule
87 ifeq ($(KVER), 2.6)
88 # 2.6 kernel
90 ifndef KERNEL_CONF
91 KERNEL_CONF= $(KSRC)/.config
92 endif
94 include ${KERNEL_CONF}
96 obj-m += viawget.o
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
103 .c.o:
104 $(CC) $(CFLAGS) -o $@ $<
106 default:
107 make -C $(KSRC) SUBDIRS=$(shell pwd) modules
109 else
111 # 2.2/2.4 kernel
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)
135 TARGET = arm_be_g.o
136 else
137 TARGET = arm_le_g.o
138 endif
140 endif
144 $(TARGET): $(filter-out $(TARGET), $(SRC:.c=.o))
145 $(LD) $(LDOPTS) -r $^ -o $@
146 echo
147 echo "***********************************"
148 echo "Build options:"
149 echo " VERSION $(KVER)"
150 echo -n " SMP "
151 if [ "$(SMP)" = "1" ]; \
152 then echo "Enabled"; else echo "Disabled"; fi
155 endif # ifeq ($(KVER),2.6)
158 ifeq ($(KVER), 2.6)
159 install: default
160 else
161 install: clean $(TARGET)
162 endif
163 mkdir -p $(MOD_ROOT)$(INSTDIR)
164 install -m 644 -o root $(TARGET) $(MOD_ROOT)$(INSTDIR)
166 ifeq (,$(MOD_ROOT))
167 /sbin/depmod -a || true
168 else
169 /sbin/depmod -b $(MOD_ROOT) -a || true
170 endif
173 uninstall:
174 rm -f $(INSTDIR)/$(TARGET)
175 /sbin/depmod -a
177 clean:
178 rm -f $(TARGET) $(SRC:.c=.o) *~
179 rm -f .*.o.d .*.o.cmd .*.ko.cmd *.mod.c *.mod.o
181 -include .depend.mak