1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Drivers with Several Source Files</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Writing an ALSA Driver"><link rel="up" href="how-to-put-your-driver.html" title="Chapter&#160;15.&#160;How To Put Your Driver Into ALSA Tree"><link rel="prev" href="ch15s02.html" title="Driver with A Single Source File"><link rel="next" href="useful-functions.html" title="Chapter&#160;16.&#160;Useful Functions"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Drivers with Several Source Files</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch15s02.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;15.&#160;How To Put Your Driver Into ALSA Tree</th><td width="20%" align="right">&#160;<a accesskey="n" href="useful-functions.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="idp1094440508"></a>Drivers with Several Source Files</h2></div></div></div><p>
2	Suppose that the driver snd-xyz have several source files.
3	They are located in the new subdirectory,
4	pci/xyz.
5
6	</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
7	Add a new directory (<code class="filename">xyz</code>) in
8	<code class="filename">alsa-driver/pci/Makefile</code> as below
9
10      </p><div class="informalexample"><pre class="programlisting">
11
12  obj-$(CONFIG_SND) += xyz/
13
14        </pre></div><p>
15	</p></li><li class="listitem"><p>
16	Under the directory <code class="filename">xyz</code>, create a Makefile
17
18      </p><div class="example"><a name="idp1094443684"></a><p class="title"><b>Example&#160;15.1.&#160;Sample Makefile for a driver xyz</b></p><div class="example-contents"><pre class="programlisting">
19
20  ifndef SND_TOPDIR
21  SND_TOPDIR=../..
22  endif
23
24  include $(SND_TOPDIR)/toplevel.config
25  include $(SND_TOPDIR)/Makefile.conf
26
27  snd-xyz-objs := xyz.o abc.o def.o
28
29  obj-$(CONFIG_SND_XYZ) += snd-xyz.o
30
31  include $(SND_TOPDIR)/Rules.make
32
33        </pre></div></div><p><br class="example-break">
34	</p></li><li class="listitem"><p>
35	Create the Kconfig entry
36	</p><p>
37	This procedure is as same as in the last section.
38	</p></li><li class="listitem"><p>
39	Run cvscompile script to re-generate the configure script and
40	build the whole stuff again.
41	</p></li></ol></div><p>
42	</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch15s02.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="how-to-put-your-driver.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="useful-functions.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Driver with A Single Source File&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;16.&#160;Useful Functions</td></tr></table></div></body></html>
43