<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><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.76.1" /><link rel="home" href="index.html" title="Writing an ALSA Driver" /><link rel="up" href="how-to-put-your-driver.html" title="Chapter 15. 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 16. Useful Functions" /></head><body><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> </td><th width="60%" align="center">Chapter 15. How To Put Your Driver Into ALSA Tree</th><td width="20%" align="right"> <a accesskey="n" href="useful-functions.html">Next</a></td></tr></table><hr /></div><div class="section" title="Drivers with Several Source Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id3053010"></a>Drivers with Several Source Files</h2></div></div></div><p> Suppose that the driver snd-xyz have several source files. They are located in the new subdirectory, pci/xyz. </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p> Add a new directory (<code class="filename">xyz</code>) in <code class="filename">alsa-driver/pci/Makefile</code> as below </p><div class="informalexample"><pre class="programlisting"> obj-$(CONFIG_SND) += xyz/ </pre></div><p> </p></li><li class="listitem"><p> Under the directory <code class="filename">xyz</code>, create a Makefile </p><div class="example"><a id="id3053063"></a><p class="title"><strong>Example 15.1. Sample Makefile for a driver xyz</strong></p><div class="example-contents"><pre class="programlisting"> ifndef SND_TOPDIR SND_TOPDIR=../.. endif include $(SND_TOPDIR)/toplevel.config include $(SND_TOPDIR)/Makefile.conf snd-xyz-objs := xyz.o abc.o def.o obj-$(CONFIG_SND_XYZ) += snd-xyz.o include $(SND_TOPDIR)/Rules.make </pre></div></div><p><br class="example-break" /> </p></li><li class="listitem"><p> Create the Kconfig entry </p><p> This procedure is as same as in the last section. </p></li><li class="listitem"><p> Run cvscompile script to re-generate the configure script and build the whole stuff again. </p></li></ol></div><p> </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> </td><td width="20%" align="center"><a accesskey="u" href="how-to-put-your-driver.html">Up</a></td><td width="40%" align="right"> <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 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 16. Useful Functions</td></tr></table></div></body></html>