4 At the bare minimum, a package in contrib must provide two Makefile
5 targets in src/foo/rules.mak:
6 - .foo to build and install the package, and
7 - .sum-foo to fetch or create a source tarball and verify it,
8 where foo the package name.
14 .sum-foo typically depends on a separate target that fetches the source
15 code. In that case, .sum-foo needs only verify that the tarball
19 $(TARBALLS)/libfoo-$(FOO_VERSION).tar.bz2:
22 # This will use the default rule: check SHA-512
23 .sum-foo: libfoo-$(FOO_VERSION).tar.bz2
25 NOTE: contrary to the previous VLC contribs, this system always uses
26 a source tarball, even if the source code is downloaded from a VCS.
27 This serves two purposes:
28 - offline builds (or behind a firewall),
29 - source code requirements compliance.
35 Similarly, .foo typically depends on the source code directory. In this
36 case, care must be taken that the directory name only exists if the
37 source code is fully ready. Otherwise Makefile dependencies will break
38 (this is not an issue for files, only directories).
40 libfoo: libfoo-$(FOO_VERSION).tar.bz2 .sum-foo
41 $(UNPACK) # to libfoo-$(FOO_VERSION)
42 ### apply patches here ###
43 # last command: make the target directory
44 mv libfoo-$(FOO_VERSION) libfoo
47 cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
48 cd $< && $(MAKE) install
55 If package bar depends on package foo, a Makefile dependency can ensure
56 that bar will be built after foo. It will also ensure that foo will be
57 built even if it was not selected explicitly in the $(PKGS) variable:
60 cd $< && $(HOSTVARS) ./configure $(HOSTCONF)
61 cd $< && $(MAKE) install
68 Some packages may be provided by the target system. This is especially
69 common when building natively on Linux or BSD. A dummy build rule can
70 be used conditionally.
72 NEED_FOO := $(call need_pkg,'foo >= 1.2.3')
78 ### foo compilation rules here ###
82 If pkg-config finds foo.pc with version 1.2.3 or larger, this will be
87 Note: The need_pkg function always return 1 during cross-compilation.