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 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
|
#
# Makefile for ALSA driver
# Copyright (c) 1994-98 by Jaroslav Kysela <perex@suse.cz>
#
ifneq ($(KERNELRELEASE),)
# call from 2.6 kernel build system
obj-m += acore/ i2c/ drivers/ isa/ pci/ ppc/ arm/ synth/ usb/ sparc/ parisc/ pcmcia/
else
ALSAKERNELDIR = ../alsa-kernel
ifndef IGROUP
IGROUP = root
endif
ifndef IUSER
IUSER = root
endif
ifeq (Makefile.conf,$(wildcard Makefile.conf))
include Makefile.conf
include toplevel.config
else
.PHONY: dummy1
dummy1:
$(MAKE) all-deps
@echo
@echo "Please, run the configure script as first..."
@echo
MAINSRCDIR := $(shell /bin/pwd)
endif
SND_TOPDIR = $(MAINSRCDIR)
export SND_TOPDIR
ifeq (,$(wildcard acinclude.m4))
.PHONY: dummy2
dummy2:
$(MAKE) all-deps
@echo
@echo "Please, run the configure script as first..."
@echo
endif
SUBDIRS = acore i2c drivers isa synth
CSUBDIRS =
ifndef NEW_KBUILD
SUBDIRS += support
endif
ifeq (y,$(CONFIG_PCI))
SUBDIRS += pci
endif
ifeq (y,$(CONFIG_ARM))
SUBDIRS += arm
endif
ifeq (y,$(CONFIG_PPC))
SUBDIRS += ppc
endif
ifeq (y,$(CONFIG_SPARC32))
SUBDIRS += sparc
else
ifeq (y,$(CONFIG_SPARC64))
SUBDIRS += sparc
endif
endif
ifeq (y,$(CONFIG_SGI))
SUBDIRS += hal2
endif
ifeq (y,$(CONFIG_USB))
SUBDIRS += usb
endif
ifeq (y,$(CONFIG_PCMCIA))
SUBDIRS += pcmcia
endif
ifeq (y,$(CONFIG_PARISC))
SUBDIRS += parisc
endif
CSUBDIRS += include test utils
KCONFIG_FILES = $(shell find $(SND_TOPDIR) -name Kconfig) $(shell find $(SND_TOPDIR)/alsa-kernel/ -name Kconfig)
.PHONY: all
all: compile
alsa-kernel/sound_core.c:
ln -sf $(ALSAKERNELDIR) alsa-kernel
ln -sf alsa-kernel sound
ln -sf alsa-kernel/scripts scripts
include/sound/version.h: include/version.h
if [ ! -d include/sound -a ! -L include/sound ]; then \
ln -sf ../alsa-kernel/include include/sound ; \
fi
cp -auvf include/version.h include/sound/version.h
utils/mod-deps: utils/mod-deps.c
gcc utils/mod-deps.c -o utils/mod-deps
toplevel.config.in: $(KCONFIG_FILES) alsa-kernel/sound_core.c utils/mod-deps
utils/mod-deps --basedir $(SND_TOPDIR)/alsa-kernel --hiddendir $(SND_TOPDIR) --makeconf > toplevel.config.in
acinclude.m4: $(KCONFIG_FILES) alsa-kernel/sound_core.c utils/mod-deps
utils/mod-deps --basedir $(SND_TOPDIR)/alsa-kernel --hiddendir $(SND_TOPDIR) --acinclude > acinclude.m4
include/config1.h.in: $(KCONFIG_FILES) alsa-kernel/sound_core.c utils/mod-deps
utils/mod-deps --basedir $(SND_TOPDIR)/alsa-kernel --hiddendir $(SND_TOPDIR) --include > include/config1.h.in
all-deps: toplevel.config.in acinclude.m4 include/config1.h.in
include/sndversions.h:
$(MAKE) dep
.PHONY: compile
compile: include/sound/version.h include/sndversions.h
ifdef NEW_KBUILD
$(MAKE) -C $(CONFIG_SND_KERNELDIR) SUBDIRS=$(MAINSRCDIR) $(MAKE_ADDS) modules
else
@for d in $(SUBDIRS); do if ! $(MAKE) -C $$d; then exit 1; fi; done
endif
@echo
@echo "ALSA modules were successfully compiled."
@echo
.PHONY: dep
dep: include/sound/version.h
ifdef NEW_KBUILD
@for d in $(SUBDIRS); do if ! $(MAKE) -C $$d prepare; then exit 1; fi; done
else
@for d in $(SUBDIRS); do if ! $(MAKE) -C $$d fastdep; then exit 1; fi; done
endif
.PHONY: map
map:
awk "{ if ( length( $$1 ) != 0 ) print $$1 }" snd.map | sort -o snd.map1
mv -f snd.map1 snd.map
.PHONY: install
install: install-modules install-headers install-scripts check-snd-prefix
@if [ -L /dev/snd ]; then \
echo "The ALSA devices were removed from /proc/asound/dev directory." ; \
echo "Creating static device entries in /dev/snd." ; \
$(SND_TOPDIR)/snddevices ; \
fi
cat WARNING
.PHONY: install-headers
install-headers:
if [ -L $(DESTDIR)$(prefix)/include/sound ]; then \
rm -f $(DESTDIR)$(prefix)/include/sound; \
ln -sf $(MAINSRCDIR)/include/sound $(DESTDIR)$(prefix)/include/sound; \
else \
rm -rf $(DESTDIR)$(prefix)/include/sound; \
install -d -m 755 -g $(IGROUP) -o $(IUSER) $(DESTDIR)$(prefix)/include/sound; \
for f in include/sound/*.h; do \
install -m 644 -g $(IGROUP) -o $(IUSER) $$f $(DESTDIR)$(prefix)/include/sound; \
done \
fi
ifeq ($(CONFIG_SND_KERNELDIR)/System.map,$(wildcard $(CONFIG_SND_KERNELDIR)/System.map))
SYSTEM_MAP_OPT = -F $(CONFIG_SND_KERNELDIR)/System.map
endif
.PHONY: install-modules
install-modules:
ifeq ($(moddir_tree),y)
find $(DESTDIR)$(moddir) -name 'snd*.*o' | xargs rm -f
else
rm -f $(DESTDIR)$(moddir)/snd*.*o $(DESTDIR)$(moddir)/persist.o $(DESTDIR)$(moddir)/isapnp.o
endif
@for d in $(SUBDIRS); do if ! $(MAKE) -C $$d modules_install; then exit 1; fi; done
ifeq ($(DESTDIR),)
-/sbin/depmod -a $(kaversion) $(SYSTEM_MAP_OPT)
else
-/sbin/depmod -a -b $(DESTDIR)/ $(SYSTEM_MAP_OPT) $(kaversion)
endif
.PHONY: install-scripts
install-scripts:
@for d in /sbin/init.d /etc/rc.d/init.d /etc/init.d; do \
if [ -d $(DESTDIR)$$d ]; then \
if [ -f $(DESTDIR)$$d/alsasound ]; then \
cmp -s utils/alsasound $(DESTDIR)$$d/alsasound || cp $(DESTDIR)$$d/alsasound $(DESTDIR)$$d/alsasound.old; \
fi; \
install -m 755 -g $(IGROUP) -o $(IUSER) utils/alsasound $(DESTDIR)$$d/alsasound; \
break; \
fi; done
.PHONY: check-snd-prefix
check-snd-prefix:
@ if [ x"$(DESTDIR)" = x -a -f /etc/modules.conf ]; then \
if grep -s -q snd_ /etc/modules.conf; then \
echo;\
echo " ===== WARNING =====";\
echo;\
echo "The options for ALSA modules on your system still include snd_ prefix,";\
echo "which is obsoleted now. Please fix /etc/modules.conf.";\
echo "For convenience, you can use utils/module-options script to convert";\
echo "the snd_ prefix automatically.";\
echo;\
fi; fi
.PHONY: clean1
clean1:
rm -f .depend *.o snd.map*
rm -f $(DEXPORT)/*.ver
rm -f modules/*.o
.PHONY: clean
clean: clean1
ifdef NEW_KBUILD
rm -rf .tmp_versions
@for d in $(SUBDIRS); do if ! $(MAKE) -C $$d cleanup; then exit 1; fi; done
else
@for d in $(SUBDIRS); do if ! $(MAKE) -C $$d clean; then exit 1; fi; done
endif
@for d in $(CSUBDIRS); do if ! $(MAKE) -C $$d clean; then exit 1; fi; done
.PHONY: mrproper
mrproper: clean1
@for d in $(SUBDIRS); do if ! $(MAKE) -C $$d mrproper; then exit 1; fi; done
@for d in $(CSUBDIRS); do if ! $(MAKE) -C $$d mrproper; then exit 1; fi; done
rm -f *~ out.txt *.orig *.rej .#* .gdb_history
rm -f doc/*~
rm -f config.cache config.log config.status Makefile.conf
rm -f utils/alsa-driver.spec
rm -f `find ../alsa-kernel -name "*~"`
rm -f `find ../alsa-kernel -name "*.orig"`
rm -f `find ../alsa-kernel -name "*.rej"`
rm -f `find ../alsa-kernel -name ".#*"`
rm -f `find ../alsa-kernel -name "out.txt"`
rm -rf autom4te.cache
.PHONY: cvsclean
cvsclean: mrproper
rm -f configure snddevices aclocal.m4 acinclude.m4 include/config.h include/config1.h \
include/config1.h.in toplevel.config toplevel.config.in \
alsa-kernel sound scripts include/sound
rm -rf include/linux
.PHONY: pack
pack: mrproper
chmod 755 utils/alsasound
# big note: use always '--bzip2 -p' where -p is fake argument
# it seems that some older tar has wrong getopt list
{ \
cd .. ; \
rm -f alsa-driver/alsa-kernel ; \
mv alsa-kernel alsa-driver ; \
mv alsa-driver alsa-driver-$(CONFIG_SND_VERSION) ; \
tar --exclude=CVS --exclude=kchanges --exclude=.cvsignore \
--owner=$(IGROUP) --group=$(IUSER) -cv --bzip2 -p \
-f alsa-driver-$(CONFIG_SND_VERSION).tar.bz2 alsa-driver-$(CONFIG_SND_VERSION) ; \
mv alsa-driver-$(CONFIG_SND_VERSION) alsa-driver ; \
mv alsa-driver/alsa-kernel . ; \
}
.PHONY: uninstall
uninstall:
-rm -rf $(DESTDIR)$(prefix)/include/sound
ifeq ($(moddir_tree),y)
{ \
for i in core $(SUBDIRS) ; do \
rm -rf $(DESTDIR)$(moddir)/$$i ; \
done ; \
}
else
rm -f $(DESTDIR)$(moddir)/snd*.o $(DESTDIR)$(moddir)/persist.o $(DESTDIR)$(moddir)/isapnp.o
endif
rm -f $(DESTDIR)/sbin/init.d/alsasound
rm -f $(DESTDIR)/etc/rc.d/init.d/alsasound
rm -f $(DESTDIR)/etc/init.d/alsasound
.PHONY: TAGS
TAGS:
find . ../alsa-kernel -name *.h -o -name *.c | xargs etags
endif
|