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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
|
diff -ru slmodem-2.9.9.orig/Makefile slmodem-2.9.9/Makefile
--- slmodem-2.9.9.orig/Makefile 2004-02-03 02:13:43.000000000 +0930
+++ slmodem-2.9.9/Makefile 2004-07-25 01:07:34.504873696 +0930
@@ -13,7 +13,9 @@
#
###########################################################################
-KERNEL_DIR:=/lib/modules/$(shell uname -r)/build
+KERNEL_VER:=$(shell uname -r)
+KERNEL_DIR:=/lib/modules/$(KERNEL_VER)/build
+KERNEL_OUTPUT_DIR:=$(KERNEL_DIR)
# tools
INSTALL:=install
@@ -28,21 +30,25 @@
$(RM) -rf ${DESTDIR}/var/lib/slmodem
$(INSTALL) -d -D -m 755 ${DESTDIR}/var/lib/slmodem
+install-test:
+ $(INSTALL) -D -m 755 modem/modem_test ${DESTDIR}/usr/sbin/modem_test
+
uninstall: uninstall-drivers
$(RM) ${DESTDIR}/usr/sbin/slmodemd
$(RM) -rf ${DESTDIR}/var/lib/slmodem
drivers:
- $(MAKE) -C drivers KERNEL_DIR=$(KERNEL_DIR)
+ $(MAKE) -C drivers
install-drivers:
- $(MAKE) install -C drivers KERNEL_DIR=$(KERNEL_DIR)
+ $(MAKE) install -C drivers
+
uninstall-drivers:
- $(MAKE) uninstall -C drivers KERNEL_DIR=$(KERNEL_DIR)
+ $(MAKE) uninstall -C drivers
# misc rules
sub-dirs:= modem drivers
-.PHONY: $(sub-dirs) all old clean dep install
+.PHONY: $(sub-dirs) all old clean dep install install-drivers install-test uninstall-drivers
clean dep: %: %-sub-dirs
%-sub-dirs:
$(foreach dir,$(sub-dirs),$(MAKE) -C $(dir) $(patsubst %-sub-dirs,%,$@) && ) echo "done."
Only in slmodem-2.9.9/drivers: .amrmo_init.o.d
Only in slmodem-2.9.9/drivers: .tmp_versions
diff -ru slmodem-2.9.9.orig/drivers/Makefile slmodem-2.9.9/drivers/Makefile
--- slmodem-2.9.9.orig/drivers/Makefile 2003-12-22 06:45:54.000000000 +0930
+++ slmodem-2.9.9/drivers/Makefile 2004-07-25 01:11:40.158528664 +0930
@@ -16,9 +16,17 @@
#KBUILD_VERBOSE=1
#export KBUILD_VERBOSE
-KERNEL_DIR:=/lib/modules/$(shell uname -r)/build
+ifndef KERNEL_VER
+KERNEL_VER:=$(shell uname -r)
+endif
+ifndef KERNEL_DIR
+KERNEL_DIR:=/lib/modules/$(KERNEL_VER)/build
+endif
+ifndef KERNEL_OUTPUT_DIR
+KERNEL_OUTPUT_DIR:=$(KERNEL_DIR)
+endif
-EXTRA_CFLAGS = -I$(obj) -I$(obj)/../modem
+EXTRA_CFLAGS+= -I$(obj) -I$(obj)/../modem
obj-m := slamr.o slusb.o
@@ -28,39 +36,35 @@
ifndef KERNELRELEASE
ifndef KERNEL_VER
-all install uninstall: kernel-ver
- $(MAKE) $@ KERNEL_VER=$(shell ./kernel-ver)
+all install uninstall:
+ $(MAKE) $@
install: install-devices
uninstall: remove-devices
-kernel-ver::
+kernel-ver:
$(CC) -I$(KERNEL_DIR)/include -o $@ $@.c
-dep:
-clean:
- $(RM) kernel-ver $(obj-m) $(obj-m:.o=.ko) *st7554.o amrmo_init.o sysdep_amr.o *.mod.* .*.cmd *~
-
install-devices:
mkdir -p ${DESTDIR}/dev
$(foreach minor,0 1 2 3, \
mknod -m 600 ${DESTDIR}/dev/slamr$(minor) c 212 $(minor) ; ) echo -n
$(foreach minor,0 1 2 3, \
mknod -m 600 ${DESTDIR}/dev/slusb$(minor) c 213 $(minor) ; ) echo -n
+
remove-devices:
- $(foreach minor,0 1 2 3, \
- $(RM) ${DESTDIR}/dev/slamr$(minor) ; ) echo -n
- $(foreach minor,0 1 2 3, \
- $(RM) ${DESTDIR}/dev/slusb$(minor) ; ) echo -n
+ $(RM) ${DESTDIR}/dev/slamr[0-3] ; ) echo -n
+ $(RM) ${DESTDIR}/dev/slusb[0-3] ; ) echo -n
else
ifeq ($(findstring 2.4,$(KERNEL_VER)),2.4)
+# 2.4 kernel
slusb-objs:= old_st7554.o
obj:=.
module-dir:=${DESTDIR}/lib/modules/$(KERNEL_VER)/misc
-CFLAGS:= -Wall -pipe -O3 -fomit-frame-pointer -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -DMODVERSIONS --include $(KERNEL_DIR)/include/linux/modversions.h -I$(KERNEL_DIR)/include
+EXTRA_CFLAGS+= -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -DMODVERSIONS --include $(KERNEL_DIR)/include/linux/modversions.h -I$(KERNEL_DIR)/include
all: $(obj-m)
@@ -69,13 +73,17 @@
slamr.o slusb.o:
$(LD) -r -o $@ $^
-install: uninstall-old
+install: install-modules
+ mkdir -p $(DESTDIR)/etc && \
+ cp /etc/modules.conf $(DESTDIR)/etc/modules.conf.slamr && \
+ echo 'alias char-major-212 slamr' >> $(DESTDIR)/etc/modules.conf && \
+ echo 'alias char-major-213 slusb' >> $(DESTDIR)/etc/modules.conf
+ /sbin/depmod -a
+
+install-modules: uninstall-old
install -D -m 644 slamr.o $(module-dir)/slamr.o
install -D -m 644 slusb.o $(module-dir)/slusb.o
- cp /etc/modules.conf /etc/modules.conf.slamr && \
- echo 'alias char-major-212 slamr' >> /etc/modules.conf && \
- echo 'alias char-major-213 slusb' >> /etc/modules.conf
- /sbin/depmod -a
+
uninstall:
/sbin/modprobe -r slamr slusb
cp /etc/modules.conf /etc/modules.conf.slamr && \
@@ -83,6 +91,7 @@
$(RM) $(module-dir)/slamr.o
$(RM) $(module-dir)/slusb.o
/sbin/depmod -a
+
uninstall-old:
$(RM) $(module-dir)/slmdm.o \
$(module-dir)/slfax.o \
@@ -94,15 +103,18 @@
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -o $@ -c $<
else
+# 2.6 Kernel
+
+EXTRA_CFLAGS+=-I $(KERNEL_INCLUDE_DIR) -I .
module-dir:=${DESTDIR}/lib/modules/$(KERNEL_VER)/extra
all:
- $(MAKE) modules -C $(KERNEL_DIR) SUBDIRS=$(shell pwd)
+ $(MAKE) modules -C $(KERNEL_DIR) SUBDIRS=$(shell pwd) O=$(KERNEL_OUTPUT_DIR)
install:
install -D -m 644 slamr.ko $(module-dir)/slamr.ko
install -D -m 644 slusb.ko $(module-dir)/slusb.ko
- /sbin/depmod -a
+# /sbin/depmod -a
uninstall:
modprobe -r slamr ; echo -n
modprobe -r slusb ; echo -n
@@ -114,6 +126,12 @@
endif
endif
+dep:
+clean:
+ $(RM) kernel-ver $(obj-m) $(obj-m:.o=.ko) *st7554.o amrmo_init.o sysdep_amr.o *.mod.* .*.cmd *~
+
$(obj)/amrlibs.o:
echo "$@ done"
+
+.PHONY: install install-modules uninstall-old install-devices remove-devices all
diff -ru slmodem-2.9.9.orig/modem/Makefile slmodem-2.9.9/modem/Makefile
--- slmodem-2.9.9.orig/modem/Makefile 2003-11-20 22:20:47.000000000 +0930
+++ slmodem-2.9.9/modem/Makefile 2004-07-25 01:07:34.539868376 +0930
@@ -16,8 +16,7 @@
CC:= gcc
RM:= rm -f
-CFLAGS:= -Wall -g -O -I. -DCONFIG_DEBUG_MODEM
-
+EXTRA_CFLAGS+= -I. -DCONFIG_DEBUG_MODEM
modem-objs:= \
modem.o modem_datafile.o modem_at.o modem_timer.o \
@@ -32,13 +31,13 @@
modem_test: modem_test.o modem_cmdline.o $(modem-objs) $(dp-objs) dsplibs.o $(sysdep-objs)
#SUPPORT_ALSA:=1
-ifdef SUPPORT_ALSA
+ifeq ($(SUPPORT_ALSA),1)
slmodemd: -lasound
-CFLAGS+= -DSUPPORT_ALSA=1
+EXTRA_CFLAGS+= -DSUPPORT_ALSA=1
endif
slmodemd modem_test:
- $(CC) -o $@ $^
+ $(CC) $(EXTRA_CFLAGS) -o $@ $^
clean:
$(RM) slmodemd modem_test modem_main.o modem_cmdline.o modem_test.o $(modem-objs) $(dp-objs) $(sysdep-objs)
Only in slmodem-2.9.9: workdir
|