Translation(s): none


The debian/rules file is nothing more than a conventional Makefile in which the function of certain targets is already defined. Some of these targets are required, and some others are optional. The lowest possible level of directly calling those targets is by typing: "fakeroot debian/rules <target>", even though you won't often be doing this often, as you'd probably use dpkg-buildpackage or debuild to create the binary packages. Those tools, in their internal implementation, do execute the targets by doing "fakeroot debian/rules <target>" themselves.

The "binary" target, required, shall generate all the binary packages from the source. If you do "fakeroot debian/rules binary", the system will do whatever needs to be done to create the final .deb files from the source tree. There are also two other required targets that create binary packages: "binary-arch" should generate all the arch-dependent packages from the source, while "binary-indep" should create all arch-intependent (aka. "all") packages. As this last two targets must be implemented, it's quite usual to make "binary" just depend on these.

Another required target is "build". This should include all the neccesary commands for compiling the contents of the package.

The last target that you'll have in a debian/rules script is "clean". This target should take care of cleaning all the intermediate and final results of creating the binary packages, and restore the source tree to its initial form.

There are also other optional targets that you can add, like "build-arch", "build-indep" or "get-orig-source". You can also create whatever additional targets you require, either as published or undocumented interfaces or for the package's internal use.