Drivers with Several Source Files

Suppose that the driver snd-xyz have several source files. They are located in the new subdirectory, pci/xyz.

  1. Add a new directory (xyz) in alsa-driver/pci/Makefile as below

      obj-$(CONFIG_SND) += xyz/

  2. Under the directory xyz, create a Makefile

    Example 15.1. Sample Makefile for a driver xyz

      ifndef SND_TOPDIR
      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

  3. Create the Kconfig entry

    This procedure is as same as in the last section.

  4. Run cvscompile script to re-generate the configure script and build the whole stuff again.