summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-14 17:57:42 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-10-14 17:57:42 +0000
commitf15ae4010ac9b8159642e7682a7a518ef1c85e77 (patch)
tree1479493f02775536a6156384e744f8f07709fe21 /misc
parent2009-10-12 Glenn Humphrey <glenn.humphrey@OARcorp.com> (diff)
downloadrtems-examples-f15ae4010ac9b8159642e7682a7a518ef1c85e77.tar.bz2
2009-10-14 Joel Sherrill <joel.sherrill@oarcorp.com>
* applib/Makefile, applib/file_1.c, applib/private.h, applib/userLib.h: New files.
Diffstat (limited to 'misc')
-rw-r--r--misc/ChangeLog5
-rw-r--r--misc/applib/Makefile32
-rw-r--r--misc/applib/file_1.c13
-rw-r--r--misc/applib/private.h10
-rw-r--r--misc/applib/userLib.h12
5 files changed, 72 insertions, 0 deletions
diff --git a/misc/ChangeLog b/misc/ChangeLog
index 9888011..8406c15 100644
--- a/misc/ChangeLog
+++ b/misc/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-14 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * applib/Makefile, applib/file_1.c, applib/private.h,
+ applib/userLib.h: New files.
+
2009-09-24 Joel Sherrill <joel.sherrill@oarcorp.com>
* Makefile: Add example for extracting values from RTEMS Application
diff --git a/misc/applib/Makefile b/misc/applib/Makefile
new file mode 100644
index 0000000..835f0b6
--- /dev/null
+++ b/misc/applib/Makefile
@@ -0,0 +1,32 @@
+#
+# Example Library Makefile
+#
+
+#
+# RTEMS_MAKEFILE_PATH is typically set in an environment variable
+#
+
+LIB=${ARCH}/libUserLib.a
+
+# C source names
+CSRCS = file_1.c
+COBJS = $(CSRCS:%.c=${ARCH}/%.o)
+
+EXTERNAL_H_FILES=userLib.h
+
+include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
+include $(RTEMS_CUSTOM)
+include $(PROJECT_ROOT)/make/leaf.cfg
+
+CLEAN_ADDITIONS += $(LIB)
+
+OBJS= $(COBJS)
+
+all: ${ARCH} $(LIB)
+
+$(LIB): $(OBJS)
+ $(AR) crv $(LIB) $(OBJS)
+
+install: all
+ $(INSTALL_VARIANT) -m 555 ${LIB} ${PROJECT_RELEASE}/lib
+ $(INSTALL_VARIANT) -m 555 ${EXTERNAL_H_FILES} ${PROJECT_RELEASE}/include
diff --git a/misc/applib/file_1.c b/misc/applib/file_1.c
new file mode 100644
index 0000000..c2a1fe2
--- /dev/null
+++ b/misc/applib/file_1.c
@@ -0,0 +1,13 @@
+/*
+ * Example library file
+ */
+
+#include <stdio.h>
+#include "userLib.h"
+
+void example_library_function(
+ int x
+)
+{
+ printf( "example_library_function(%d)\n", x );
+}
diff --git a/misc/applib/private.h b/misc/applib/private.h
new file mode 100644
index 0000000..66a5b3b
--- /dev/null
+++ b/misc/applib/private.h
@@ -0,0 +1,10 @@
+/*
+ * Example Private .h file from user library
+ */
+
+#ifndef __Private_h
+#define __Private_h
+
+/* nothing to declare, just an example */
+
+#endif
diff --git a/misc/applib/userLib.h b/misc/applib/userLib.h
new file mode 100644
index 0000000..7dc954b
--- /dev/null
+++ b/misc/applib/userLib.h
@@ -0,0 +1,12 @@
+/*
+ * Example Public .h file from user library
+ */
+
+#ifndef __User_Library_h
+#define __User_Library_h
+
+void example_library_function(
+ int x
+);
+
+#endif