RickyZhou/PackageMaintainers/Makefile

From FedoraProject

Jump to: navigation, search

Handling the Makefile

The Makefile will include the stock Makefile rules from the Makefile.common file, which defines some common useful targets. For example, a sample Makefile will look like this:

NAME := kernel
SPECFILE := $(firstword $(wildcard *.spec))
include ../common/Makefile.common

This defines the name of the package and the specfile. (More things can be defined optionally, see the Makefile.common file.) For the overwhelming majority of packages, this simple Makefile is all that is needed to link the package to the build rules of the repository. Note that Makefile.common lies in the common module. CVS magic is done in the CVS's modules file to have the common module checked out every time a package module is checked out.

Makefile.common targets

These are all defined in the common Makefile fragment. A "make help" target is also available for a quick reference.

  • make sources:

Download sources from the lookaside cache, and verify their MD5 sums.

  • make <arch>:

Makes an <arch>; binary RPM Supported archs include noarch i386 i586 i686 x86_64 ia64 s390 s390x ppc ppc64 pseries ppc64pseries iseries ppc64iseries.

  • make export:

Exports a clean CVS checkout.

  • make clean:

Tries to mop up non-CVS files.

  • make prep:

Creates a local source RPM and runs through to %prep in the build.

  • make compile:

Gets the source, unpacks it and runs a build through it.