aboutsummaryrefslogtreecommitdiffstats
path: root/projects/sample/lib
diff options
context:
space:
mode:
Diffstat (limited to 'projects/sample/lib')
-rw-r--r--projects/sample/lib/Makefile13
-rw-r--r--projects/sample/lib/sample/Makefile18
-rw-r--r--projects/sample/lib/sample/sample.c25
3 files changed, 56 insertions, 0 deletions
diff --git a/projects/sample/lib/Makefile b/projects/sample/lib/Makefile
new file mode 100644
index 0000000..959038b
--- /dev/null
+++ b/projects/sample/lib/Makefile
@@ -0,0 +1,13 @@
+##===- projects/sample/lib/Makefile ------------------------*- Makefile -*-===##
+
+#
+# Relative path to the top of the source tree.
+#
+LEVEL=..
+
+#
+# List all of the subdirectories that we will compile.
+#
+DIRS=sample
+
+include $(LEVEL)/Makefile.common
diff --git a/projects/sample/lib/sample/Makefile b/projects/sample/lib/sample/Makefile
new file mode 100644
index 0000000..05bca61
--- /dev/null
+++ b/projects/sample/lib/sample/Makefile
@@ -0,0 +1,18 @@
+##===- projects/sample/lib/sample/Makefile -----------------*- Makefile -*-===##
+
+#
+# Indicate where we are relative to the top of the source tree.
+#
+LEVEL=../..
+
+#
+# Give the name of a library. This will build a dynamic version.
+#
+LIBRARYNAME=sample
+DONT_BUILD_RELINKED=1
+BUILD_ARCHIVE=1
+
+#
+# Include Makefile.common so we know what to do.
+#
+include $(LEVEL)/Makefile.common
diff --git a/projects/sample/lib/sample/sample.c b/projects/sample/lib/sample/sample.c
new file mode 100644
index 0000000..a5ae280
--- /dev/null
+++ b/projects/sample/lib/sample/sample.c
@@ -0,0 +1,25 @@
+/*
+ * File: sample.c
+ *
+ * Description:
+ * This is a sample source file for a library. It helps to demonstrate
+ * how to setup a project that uses the LLVM build system, header files,
+ * and libraries.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* LLVM Header File
+#include "llvm/Support/DataTypes.h"
+*/
+
+/* Header file global to this project */
+#include "sample.h"
+
+int
+compute_sample (int a)
+{
+ return a;
+}
+