add documentation to the sample package

Project: 
http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/commit/d12f2c56
Tree: 
http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/tree/d12f2c56
Diff: 
http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/diff/d12f2c56

Branch: refs/heads/master
Commit: d12f2c567da85bbfc2acfe5882425e83d12e4e5f
Parents: 1b73639
Author: Sterling Hughes <sterl...@apache.org>
Authored: Tue Oct 11 12:08:21 2016 +0200
Committer: Sterling Hughes <sterl...@apache.org>
Committed: Tue Oct 11 12:08:21 2016 +0200

----------------------------------------------------------------------
 .gitignore                    | 33 +++++++++++++++++++++++++++++++++
 README.md                     | 13 ++++++++++++-
 include/your-path/your-file.h | 31 +++++++++++++++++++++++++++++++
 src/your-source.c             | 18 ++++++++++++++++++
 4 files changed, 94 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/blob/d12f2c56/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..ff4c547
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,33 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+.app.db
+.app
+bin
+obj
+tags
+.gdb_history
+.gdb_out
+.gdb_cmds
+.gdbinit
+*~
+.DS_Store
+*.swp
+*.swo
+

http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/blob/d12f2c56/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index d9fd348..57d8245 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,12 @@
-# incubator-mynewt-pkg-pkg
+# Sample Package Definition
+
+This is a basic definition of a sample Mynewt package.
+
+The source files are located in the src/ directory.
+
+Header files are located in include/ 
+
+pkg.yml contains the base definition of the package.
+
+Any questions?  Please refer to the documentation at 
+http://mynewt.apache.org/ or ask questions on d...@mynewt.apache.org

http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/blob/d12f2c56/include/your-path/your-file.h
----------------------------------------------------------------------
diff --git a/include/your-path/your-file.h b/include/your-path/your-file.h
index e69de29..8716e48 100644
--- a/include/your-path/your-file.h
+++ b/include/your-path/your-file.h
@@ -0,0 +1,31 @@
+/*
+ * This is a sample header file for your package.  Feel free to delete this
+ * file, or rename it.
+ *
+ * Package include files are located under the <pkg>/include/<pkg-name>
+ * directory.  When referencing include files in this directory, the
+ * include statement should be:
+ *
+ * #include "pkg-name/file-name.h"
+ *
+ * If you are referencing package includes from another package, you must
+ * list the package who's includes you are referencing as a dependency in
+ * the pkg.yml file.  By adding the package as a dependency, newt will
+ * automatically add -I<pkg>/include to the CFLAGS when compiling your
+ * package.
+ *
+ * If you want to provide architecture specific header files, you can do
+ * this by putting it into the "arch/your-arch/pkg-name".  For example,
+ * to have a header file that is overrode for Cortex-M4 architectures, you
+ * would put the file in the following location:
+ *
+ * * <your-pkg>/include/<your-pkg>/arch/cortex_m4/<your-pkg>/file-name.h
+ *
+ * And you can then include it with the following include statement:
+ *
+ * #include "pkg-name/file-name.h"
+ *
+ * And depending on what architecture is specified (usually controlled by
+ * BSP or MCU definition), the correct architecture directory will be
+ * included.
+ */

http://git-wip-us.apache.org/repos/asf/incubator-incubator-mynewt-pkg-pkg/blob/d12f2c56/src/your-source.c
----------------------------------------------------------------------
diff --git a/src/your-source.c b/src/your-source.c
index e69de29..2f8c1dc 100644
--- a/src/your-source.c
+++ b/src/your-source.c
@@ -0,0 +1,18 @@
+/**
+ * Depending on the type of package, there are different
+ * compilation rules for this directory.  This comment applies
+ * to packages of type "pkg."  For other types of packages,
+ * please view the documentation at http://mynewt.apache.org/.
+ *
+ * Put source files in this directory.  All files that have a *.c
+ * ending are recursively compiled in the src/ directory and its
+ * descendants.  The exception here is the arch/ directory, which
+ * is ignored in the default compilation.
+ *
+ * The arch/<your-arch>/ directories are manually added and
+ * recursively compiled for all files that end with either *.c
+ * or *.a.  Any directories in arch/ that don't match the
+ * architecture being compiled are not compiled.
+ *
+ * Architecture is set by the BSP/MCU combination.
+ */

Reply via email to