summaryrefslogtreecommitdiff
path: root/docs/writing-rules.txt
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-03-16 19:51:41 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2014-03-16 19:51:41 +0100
commit9d097a780c0ffe2c9dbe146046d5b68123c47708 (patch)
treebf05111572c2a996d0c911c2fe30075aab6de496 /docs/writing-rules.txt
parentf6161af2d6f3e0ed683fe77450aa2f9fe9ec100b (diff)
add OpenADK manual.
Diffstat (limited to 'docs/writing-rules.txt')
-rw-r--r--docs/writing-rules.txt91
1 files changed, 91 insertions, 0 deletions
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[].