1# Makefile for the Linux sound card driver
2#
3# 18 Apr 1998, Michael Elizabeth Chastain, <mailto:mec@shout.net>
4# Rewritten to use lists instead of if-statements.
5
6
7# All of the (potential) objects that export symbols.
8# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
9
10export-objs	:=  ad1848.o audio_syms.o midi_syms.o mpu401.o \
11		    msnd.o opl3.o sb_common.o sequencer_syms.o \
12		    sound_core.o sound_syms.o uart401.o	\
13		    nm256_audio.o ac97.o ac97_codec.o aci.o
14
15# Each configuration option enables a list of files.
16
17obj-$(CONFIG_SOUND)		+= soundcore.o
18obj-$(CONFIG_SOUND_OSS)		+= sound.o
19obj-$(CONFIG_SOUND_CS4232)	+= cs4232.o ad1848.o
20
21# Please leave it as is, cause the link order is significant !
22
23obj-$(CONFIG_SOUND_HAL2)	+= hal2.o
24obj-$(CONFIG_SOUND_AEDSP16)	+= aedsp16.o
25obj-$(CONFIG_SOUND_ALI5455)	+= ali5455.o ac97_codec.o
26obj-$(CONFIG_SOUND_PSS)		+= pss.o ad1848.o mpu401.o
27obj-$(CONFIG_SOUND_TRIX)	+= trix.o ad1848.o sb_lib.o uart401.o
28obj-$(CONFIG_SOUND_OPL3SA1)	+= opl3sa.o ad1848.o uart401.o
29obj-$(CONFIG_SOUND_SSCAPE)	+= sscape.o ad1848.o mpu401.o
30obj-$(CONFIG_SOUND_MAD16)	+= mad16.o ad1848.o sb_lib.o uart401.o
31obj-$(CONFIG_SOUND_CS4232)	+= cs4232.o uart401.o
32obj-$(CONFIG_SOUND_OPL3SA2)	+= opl3sa2.o ad1848.o mpu401.o
33obj-$(CONFIG_SOUND_MSS)		+= ad1848.o
34obj-$(CONFIG_SOUND_PAS)		+= pas2.o sb.o sb_lib.o uart401.o
35obj-$(CONFIG_SOUND_SB)		+= sb.o sb_lib.o uart401.o
36obj-$(CONFIG_SOUND_KAHLUA)	+= kahlua.o
37obj-$(CONFIG_SOUND_WAVEFRONT)	+= wavefront.o
38obj-$(CONFIG_SOUND_MAUI)	+= maui.o mpu401.o
39obj-$(CONFIG_SOUND_MPU401)	+= mpu401.o
40obj-$(CONFIG_SOUND_UART6850)	+= uart6850.o
41obj-$(CONFIG_SOUND_GUS)		+= gus.o ad1848.o
42obj-$(CONFIG_SOUND_ADLIB)	+= adlib_card.o opl3.o
43obj-$(CONFIG_SOUND_YM3812)	+= opl3.o
44obj-$(CONFIG_SOUND_VMIDI)	+= v_midi.o
45obj-$(CONFIG_SOUND_VIDC)	+= vidc_mod.o
46obj-$(CONFIG_SOUND_WAVEARTIST)	+= waveartist.o
47obj-$(CONFIG_SOUND_SGALAXY)	+= sgalaxy.o ad1848.o
48obj-$(CONFIG_SOUND_AD1816)	+= ad1816.o
49obj-$(CONFIG_SOUND_AD1889)      += ad1889.o ac97_codec.o
50obj-$(CONFIG_SOUND_ACI_MIXER)	+= aci.o
51obj-$(CONFIG_SOUND_AWE32_SYNTH)	+= awe_wave.o
52
53obj-$(CONFIG_SOUND_VIA82CXXX)	+= via82cxxx_audio.o ac97_codec.o
54ifeq ($(CONFIG_MIDI_VIA82CXXX),y)
55  obj-$(CONFIG_SOUND_VIA82CXXX) += sound.o uart401.o
56endif
57obj-$(CONFIG_SOUND_YMFPCI)	+= ymfpci.o ac97_codec.o
58ifeq ($(CONFIG_SOUND_YMFPCI_LEGACY),y)
59  obj-$(CONFIG_SOUND_YMFPCI)    += opl3.o uart401.o
60endif
61obj-$(CONFIG_SOUND_MSNDCLAS)	+= msnd.o msnd_classic.o
62obj-$(CONFIG_SOUND_MSNDPIN)	+= msnd.o msnd_pinnacle.o
63obj-$(CONFIG_SOUND_VWSND)	+= vwsnd.o
64obj-$(CONFIG_SOUND_NM256)	+= nm256_audio.o ac97.o
65obj-$(CONFIG_SOUND_ICH)		+= i810_audio.o ac97_codec.o
66obj-$(CONFIG_SOUND_SONICVIBES)	+= sonicvibes.o
67obj-$(CONFIG_SOUND_CMPCI)	+= cmpci.o
68obj-$(CONFIG_SOUND_ES1370)	+= es1370.o
69obj-$(CONFIG_SOUND_ES1371)	+= es1371.o ac97_codec.o
70obj-$(CONFIG_SOUND_VRC5477)	+= nec_vrc5477.o ac97_codec.o
71obj-$(CONFIG_SOUND_AU1X00)      += au1000.o ac97_codec.o
72obj-$(CONFIG_SOUND_AU1550_PSC)  += au1550_psc.o ac97_codec.o
73obj-$(CONFIG_SOUND_AU1550_I2S)  += au1550_i2s.o
74obj-$(CONFIG_SOUND_ESSSOLO1)	+= esssolo1.o
75obj-$(CONFIG_SOUND_FUSION)	+= cs46xx.o ac97_codec.o
76obj-$(CONFIG_SOUND_MAESTRO)	+= maestro.o
77obj-$(CONFIG_SOUND_MAESTRO3)	+= maestro3.o ac97_codec.o
78obj-$(CONFIG_SOUND_FORTE)	+= forte.o ac97_codec.o
79obj-$(CONFIG_SOUND_TRIDENT)	+= trident.o ac97_codec.o
80obj-$(CONFIG_SOUND_HARMONY)	+= harmony.o
81obj-$(CONFIG_SOUND_EMU10K1)	+= ac97_codec.o
82obj-$(CONFIG_SOUND_BCM_CS4297A)	+= swarm_cs4297a.o
83obj-$(CONFIG_SOUND_RME96XX)     += rme96xx.o
84obj-$(CONFIG_SOUND_BT878)	+= btaudio.o
85obj-$(CONFIG_SOUND_IT8172)	+= ite8172.o ac97_codec.o
86obj-$(CONFIG_SOUND_AD1980)	+= ac97_plugin_ad1980.o
87obj-$(CONFIG_SOUND_WM97XX)	+= ac97_plugin_wm97xx.o
88
89ifeq ($(CONFIG_MIDI_EMU10K1),y)
90  obj-$(CONFIG_SOUND_EMU10K1)	+= sound.o
91endif
92
93subdir-$(CONFIG_SOUND_EMU10K1) += emu10k1
94subdir-$(CONFIG_SOUND_CS4281) += cs4281
95
96ifeq ($(CONFIG_SOUND_EMU10K1),y)
97  obj-y += emu10k1/emu10k1.o
98endif
99
100ifeq ($(CONFIG_SOUND_CS4281),y)
101  obj-y += cs4281/cs4281.o
102endif
103
104subdir-$(CONFIG_DMASOUND) += dmasound
105
106ifeq ($(CONFIG_DMASOUND),y)
107  obj-y += dmasound/dmasound.o
108endif
109
110
111# Declare multi-part drivers.
112
113list-multi	:= sound.o gus.o pas2.o sb.o sb_lib.o vidc_mod.o \
114    soundcore.o wavefront.o
115
116sound-objs	:= 							\
117    dev_table.o soundcard.o sound_syms.o		\
118    audio.o audio_syms.o dmabuf.o					\
119    midi_syms.o midi_synth.o midibuf.o					\
120    sequencer.o sequencer_syms.o sound_timer.o sys_timer.o
121
122soundcore-objs	:= sound_core.o sound_firmware.o
123
124gus-objs	:= gus_card.o gus_midi.o gus_vol.o gus_wave.o ics2101.o
125pas2-objs	:= pas2_card.o pas2_midi.o pas2_mixer.o pas2_pcm.o
126sb-objs		:= sb_card.o
127sb_lib-objs	:= sb_common.o sb_audio.o sb_midi.o sb_mixer.o sb_ess.o
128vidc_mod-objs	:= vidc.o vidc_fill.o
129wavefront-objs  := wavfront.o wf_midi.o yss225.o
130
131
132O_TARGET	:= sounddrivers.o
133
134include $(TOPDIR)/Rules.make
135
136
137
138# Link rules for multi-part drivers.
139
140sound.o: $(sound-objs)
141	$(LD) -r -o $@ $(sound-objs)
142
143soundcore.o: $(soundcore-objs)
144	$(LD) -r -o $@ $(soundcore-objs)
145
146gus.o: $(gus-objs)
147	$(LD) -r -o $@ $(gus-objs)
148
149pas2.o: $(pas2-objs)
150	$(LD) -r -o $@ $(pas2-objs)
151
152sb.o: $(sb-objs)
153	$(LD) -r -o $@ $(sb-objs)
154
155sb_lib.o: $(sb_lib-objs)
156	$(LD) -r -o $@ $(sb_lib-objs)
157
158vidc_mod.o: $(vidc_mod-objs)
159	$(LD) -r -o $@ $(vidc_mod-objs)
160
161wavefront.o: $(wavefront-objs)
162	$(LD) -r -o $@ $(wavefront-objs)
163
164# Firmware files that need translation
165#
166# The translated files are protected by a file that keeps track
167# of what name was used to build them.  If the name changes, they
168# will be forced to be remade.
169#
170# First make the utilities.
171
172bin2hex: bin2hex.c
173	$(HOSTCC) $(HOSTCFLAGS) -o bin2hex bin2hex.c
174
175hex2hex: hex2hex.c
176	$(HOSTCC) $(HOSTCFLAGS) -o hex2hex hex2hex.c
177
178
179
180
181# Turtle Beach Maui / Tropez
182
183maui.o: maui_boot.h
184
185ifeq ($(CONFIG_MAUI_HAVE_BOOT),y)
186    maui_boot.h: $(patsubst "%", %, $(CONFIG_MAUI_BOOT_FILE)) bin2hex
187	./bin2hex -i maui_os < $(CONFIG_MAUI_BOOT_FILE) > $@
188else
189    maui_boot.h:
190	(							\
191	    echo 'static unsigned char * maui_os = NULL;';	\
192	    echo 'static int maui_osLen = 0;';			\
193	) > $@
194endif
195	@ ( \
196	    echo 'ifeq ($(strip $(CONFIG_MAUI_HAVE_BOOT) $(CONFIG_MAUI_BOOT_FILE)),$$(strip $$(CONFIG_MAUI_HAVE_BOOT) $$(CONFIG_MAUI_BOOT_FILE)))'; \
197	    echo 'FILES_BOOT_UP_TO_DATE += $@'; \
198	    echo 'endif' \
199	) > .$@.boot
200
201
202
203# Turtle Beach MultiSound
204
205ifeq ($(CONFIG_MSNDCLAS_HAVE_BOOT),y)
206    msnd_classic.o: msndperm.c msndinit.c
207
208    msndperm.c: $(patsubst "%", %, $(CONFIG_MSNDCLAS_PERM_FILE)) bin2hex
209	./bin2hex msndperm < $(CONFIG_MSNDCLAS_PERM_FILE) > $@
210	@ ( \
211	    echo 'ifeq ($(strip $(CONFIG_MSNDCLAS_HAVE_BOOT) $(CONFIG_MSNDCLAS_PERM_FILE)),$$(strip $$(CONFIG_MSNDCLAS_HAVE_BOOT) $$(CONFIG_MSNDCLAS_PERM_FILE)))'; \
212	    echo 'FILES_BOOT_UP_TO_DATE += $@'; \
213	    echo 'endif' \
214	) > .$@.boot
215
216    msndinit.c: $(patsubst "%", %, $(CONFIG_MSNDCLAS_INIT_FILE)) bin2hex
217	./bin2hex msndinit < $(CONFIG_MSNDCLAS_INIT_FILE) > $@
218	@ ( \
219	    echo 'ifeq ($(strip $(CONFIG_MSNDCLAS_HAVE_BOOT) $(CONFIG_MSNDCLAS_INIT_FILE)),$$(strip $$(CONFIG_MSNDCLAS_HAVE_BOOT) $$(CONFIG_MSNDCLAS_INIT_FILE)))'; \
220	    echo 'FILES_BOOT_UP_TO_DATE += $@'; \
221	    echo 'endif' \
222	) > .$@.boot
223endif
224
225ifeq ($(CONFIG_MSNDPIN_HAVE_BOOT),y)
226    msnd_pinnacle.o: pndsperm.c pndspini.c
227
228    pndsperm.c: $(patsubst "%", %, $(CONFIG_MSNDPIN_PERM_FILE)) bin2hex
229	./bin2hex pndsperm < $(CONFIG_MSNDPIN_PERM_FILE) > $@
230	@ ( \
231	    echo 'ifeq ($(strip $(CONFIG_MSNDPIN_HAVE_BOOT) $(CONFIG_MSNDPIN_PERM_FILE)),$$(strip $$(CONFIG_MSNDPIN_HAVE_BOOT) $$(CONFIG_MSNDPIN_PERM_FILE)))'; \
232	    echo 'FILES_BOOT_UP_TO_DATE += $@'; \
233	    echo 'endif' \
234	) > .$@.boot
235
236    pndspini.c: $(patsubst "%", %, $(CONFIG_MSNDPIN_INIT_FILE)) bin2hex
237	./bin2hex pndspini < $(CONFIG_MSNDPIN_INIT_FILE) > $@
238	@ ( \
239	    echo 'ifeq ($(strip $(CONFIG_MSNDPIN_HAVE_BOOT) $(CONFIG_MSNDPIN_INIT_FILE)),$$(strip $$(CONFIG_MSNDPIN_HAVE_BOOT) $$(CONFIG_MSNDPIN_INIT_FILE)))'; \
240	    echo 'FILES_BOOT_UP_TO_DATE += $@'; \
241	    echo 'endif' \
242	) > .$@.boot
243endif
244
245
246
247# PSS (ECHO-ADI2111)
248
249pss.o: pss_boot.h
250
251ifeq ($(CONFIG_PSS_HAVE_BOOT),y)
252    pss_boot.h: $(patsubst "%", %, $(CONFIG_PSS_BOOT_FILE)) bin2hex
253	./bin2hex pss_synth < $(CONFIG_PSS_BOOT_FILE) > $@
254else
255    pss_boot.h:
256	(							\
257	    echo 'static unsigned char * pss_synth = NULL;';	\
258	    echo 'static int pss_synthLen = 0;';		\
259	) > $@
260endif
261	@ ( \
262	    echo 'ifeq ($(strip $(CONFIG_PSS_HAVE_BOOT) $(CONFIG_PSS_BOOT_FILE)),$$(strip $$(CONFIG_PSS_HAVE_BOOT) $$(CONFIG_PSS_BOOT_FILE)))'; \
263	    echo 'FILES_BOOT_UP_TO_DATE += $@'; \
264	    echo 'endif' \
265	) > .$@.boot
266
267
268
269# MediaTrix AudioTrix Pro
270
271trix.o: trix_boot.h
272
273ifeq ($(CONFIG_TRIX_HAVE_BOOT),y)
274    trix_boot.h: $(patsubst "%", %, $(CONFIG_TRIX_BOOT_FILE)) hex2hex
275	./hex2hex -i trix_boot < $(CONFIG_TRIX_BOOT_FILE) > $@
276else
277    trix_boot.h:
278	(							\
279	    echo 'static unsigned char * trix_boot = NULL;';	\
280	    echo 'static int trix_boot_len = 0;';		\
281	) > $@
282endif
283	@ ( \
284	    echo 'ifeq ($(strip $(CONFIG_TRIX_HAVE_BOOT) $(CONFIG_TRIX_BOOT_FILE)),$$(strip $$(CONFIG_TRIX_HAVE_BOOT) $$(CONFIG_TRIX_BOOT_FILE)))'; \
285	    echo 'FILES_BOOT_UP_TO_DATE += $@'; \
286	    echo 'endif' \
287	) > .$@.boot
288
289
290
291# Find boot files whose source file names have changed and force rebuild.
292
293FILES_BOOT_UP_TO_DATE :=
294
295FILES_BOOT_EXIST := $(wildcard .*.boot)
296ifneq ($(FILES_BOOT_EXIST),)
297include $(FILES_BOOT_EXIST)
298endif
299
300FILES_BOOT_CHANGED := $(strip \
301    $(filter-out $(FILES_BOOT_UP_TO_DATE), \
302	maui_boot.h pss_boot.h trix_boot.h))
303
304ifneq ($(FILES_BOOT_CHANGED),)
305$(FILES_BOOT_CHANGED): dummy
306endif
307