From f15ae4010ac9b8159642e7682a7a518ef1c85e77 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 14 Oct 2009 17:57:42 +0000 Subject: 2009-10-14 Joel Sherrill * applib/Makefile, applib/file_1.c, applib/private.h, applib/userLib.h: New files. --- misc/ChangeLog | 5 +++++ misc/applib/Makefile | 32 ++++++++++++++++++++++++++++++++ misc/applib/file_1.c | 13 +++++++++++++ misc/applib/private.h | 10 ++++++++++ misc/applib/userLib.h | 12 ++++++++++++ 5 files changed, 72 insertions(+) create mode 100644 misc/applib/Makefile create mode 100644 misc/applib/file_1.c create mode 100644 misc/applib/private.h create mode 100644 misc/applib/userLib.h 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 + + * applib/Makefile, applib/file_1.c, applib/private.h, + applib/userLib.h: New files. + 2009-09-24 Joel Sherrill * 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 +#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 -- cgit v1.2.3