From 9d097a780c0ffe2c9dbe146046d5b68123c47708 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 16 Mar 2014 19:51:41 +0100 Subject: add OpenADK manual. --- docs/writing-rules.txt | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 docs/writing-rules.txt (limited to 'docs/writing-rules.txt') diff --git a/docs/writing-rules.txt b/docs/writing-rules.txt new file mode 100644 index 000000000..22f6547ad --- /dev/null +++ b/docs/writing-rules.txt @@ -0,0 +1,91 @@ +// -*- mode:doc; -*- +// vim: set syntax=asciidoc: + +Coding style +------------ + +Overall, these coding style rules are here to help you to add new files in +OpenADK or refactor existing ones. + +[[writing-rules-config-in]] + ++Config.in+ +~~~~~~~~~~~ + ++Config.in+ files contain entries for almost anything configurable in +OpenADK. Mostly all Config.in files for packages are autogenerated and +should not be manually edited. The following rules apply for the top level +Config.in, for the files in target/config and target/linux/config. + +An entry has the following pattern: + +--------------------- +config ADK_TARGET_FOO + bool "foo" + depends on ADK_PACKAGE_LIBBAZ + select BR2_PACKAGE_LIBBAR + help + This is a comment that explains what foo is. + + http://foo.org/foo/ +--------------------- + +* The +bool+, +depends on+, +select+ and +help+ lines are indented + with one tab. + +* The help text itself should be indented with one tab and two + spaces. + +The +Config.in+ files are the input for the configuration tool +used in OpenADK, which is the regular _Kconfig_. For further +details about the _Kconfig_ language, refer to +http://kernel.org/doc/Documentation/kbuild/kconfig-language.txt[]. + +[[writing-rules-mk]] + ++Makefile+ +~~~~~~~~~~ + +* Header: The file starts with a license header. ++ +--------------------- +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. +--------------------- ++ +* Assignment: use +=+ followed by two tabs: ++ +--------------------- +PKG_VERSION:= 1.0 +PKG_BUILDDEP+= libfoo +--------------------- ++ + +* Indentation: use tab only: ++ +--------------------- +libfoo-install: + $(CP) $(WRKINST)/usr/lib/libfoo*.so* \ + $(IDIR_LIBFOO)/usr/lib +--------------------- ++ + +* Optional dependency: + +** Prefer multi-line syntax. +--------------------- +ifeq ($(ADK_PACKAGE_LIBFOO_WITH_PYTHON),y) +CONFIGURE_ARGS+= --with-python-support +else +CONFIGURE_ARGS+= --without-python-support +endif +--------------------- + +Documentation +~~~~~~~~~~~~~ + +The documentation uses the +http://www.methods.co.nz/asciidoc/[asciidoc] format. + +For further details about the http://www.methods.co.nz/asciidoc/[asciidoc] +syntax, refer to http://www.methods.co.nz/asciidoc/userguide.html[]. -- cgit v1.2.3