This page is a work in progress. |
When supplying patches to software in oi-build, please:
GNU Makefile's syntax can be mind-bending, so the general purpose of this style guide is to provide suggestions for how to make files as readable as possible. There are three basic guidelines:
Makefile should not have redundant settings or rules or preserve commented out lines that are no longer required. They should do the minimum necessary to provide a consistent build and do it in a way that a person can readily understand.COMPONENT_PRE_CONFIGURE_ACTION should come before CONFIGURE_OPTIONS. COMPONENT_BUILD_ENV should come before the build target is defined.Makefile should produce a sample manifest that approximates what is actually packaged as closely as possible. It is acceptable for packaging to pull augments out of the component directory, but any other magic should be done using pre- and post-target actions in the Makefile rather than in the packaging manifest.There are a number of conventions that should be respected, partly out of mechanics, partly for readability.
Makefile should start by providing an illumos CDDL declaration or preserve an OpenSolaris CDDL declaration if the Makefile was carried over from userland-gate. illumos-userland contributors individually unless they are required to assign copyright to an employer.Makefile should include shared-macros.mk using a relative directory. All subsequent includes should use $(WS_TOP).prep.mk;ant.mk, configure.mk, justmake.mk, makemaker.mk, or setup.py.mk;ips.mk.configure.in should have COMPONENT_PRE_CONFIGURE_ACTION setting that call autogen.sh.configure.in templates but do not come with pre-generated configure scripts should call autoconf.configure script should be listed as dependencies for the component or explicitly disabled.Makefile should include depend.mk.Packages that have a pre-existing legacy action should have this left intact/unchanged, unless a package is being split up or the version bump is major, and it no longer makes sense to deliver the legacy action.
(The legacy action provides an SVR4 package entry in /var/sadm/pkg, so that the package shows up via pkginfo SUNWfoo - provided for backwards compatibility).
New packages that were not delivered via legacy SVR4 packages in previous versions of Solaris/OpenSolaris do not need a legacy action.